diff --git a/sdk/resourcemanager/datamigration/armdatamigration/CHANGELOG.md b/sdk/resourcemanager/datamigration/armdatamigration/CHANGELOG.md index 0558944ecfc7..1d5ff563c594 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/CHANGELOG.md +++ b/sdk/resourcemanager/datamigration/armdatamigration/CHANGELOG.md @@ -1,5 +1,227 @@ # Release History +## 2.0.0-beta.1 (2024-10-14) +### Breaking Changes + +- Type of `APIError.SystemData` has been changed from `*SystemData` to `*SystemDataAutoGenerated` +- Type of `CheckOCIDriverTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `CommandProperties.CommandType` has been changed from `*string` to `*CommandType` +- Type of `ConnectToMongoDbTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ConnectToSourceMySQLTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ConnectToSourceOracleSyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ConnectToSourcePostgreSQLSyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ConnectToSourceSQLServerSyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ConnectToSourceSQLServerTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ConnectToTargetAzureDbForMySQLTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ConnectToTargetAzureDbForPostgreSQLSyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ConnectToTargetSQLDbSyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ConnectToTargetSQLDbTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ConnectToTargetSQLMISyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ConnectToTargetSQLMITaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `GetTdeCertificatesSQLTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `GetUserTablesMySQLTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `GetUserTablesOracleTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `GetUserTablesPostgreSQLTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `GetUserTablesSQLSyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `GetUserTablesSQLTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `InstallOCIDriverTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `MigrateMISyncCompleteCommandProperties.CommandType` has been changed from `*string` to `*CommandType` +- Type of `MigrateMongoDbTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `MigrateMySQLAzureDbForMySQLOfflineTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `MigrateMySQLAzureDbForMySQLSyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `MigrateOracleAzureDbForPostgreSQLSyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput.MigrationSetting` has been changed from `map[string]*string` to `map[string]any` +- Type of `MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `MigrateSQLServerSQLDbSyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `MigrateSQLServerSQLDbTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `MigrateSQLServerSQLMISyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `MigrateSQLServerSQLMITaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `MigrateSchemaSQLServerSQLDbTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `MigrateSsisTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `MigrateSyncCompleteCommandProperties.CommandType` has been changed from `*string` to `*CommandType` +- Type of `MongoDbCancelCommand.CommandType` has been changed from `*string` to `*CommandType` +- Type of `MongoDbFinishCommand.CommandType` has been changed from `*string` to `*CommandType` +- Type of `MongoDbRestartCommand.CommandType` has been changed from `*string` to `*CommandType` +- Type of `Project.SystemData` has been changed from `*SystemData` to `*SystemDataAutoGenerated` +- Type of `ProjectFile.SystemData` has been changed from `*SystemData` to `*SystemDataAutoGenerated` +- Type of `ProjectTask.SystemData` has been changed from `*SystemData` to `*SystemDataAutoGenerated` +- Type of `ProjectTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `Service.SystemData` has been changed from `*SystemData` to `*SystemDataAutoGenerated` +- Type of `UploadOCIDriverTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ValidateMigrationInputSQLServerSQLDbSyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ValidateMigrationInputSQLServerSQLMISyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ValidateMigrationInputSQLServerSQLMITaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ValidateMongoDbTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Type of `ValidateOracleAzureDbForPostgreSQLSyncTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- Field `ServiceOperationList` of struct `OperationsClientListResponse` has been removed + +### Features Added + +- New value `ServerLevelPermissionsGroupMigrationFromSQLServerToAzureVM` added to enum type `ServerLevelPermissionsGroup` +- New enum type `CommandType` with values `CommandTypeCancel`, `CommandTypeFinish`, `CommandTypeMigrateSQLServerAzureDbSQLMiComplete`, `CommandTypeMigrateSyncCompleteDatabase`, `CommandTypeRestart` +- New enum type `MongoMigrationStatus` with values `MongoMigrationStatusCanceled`, `MongoMigrationStatusCompleted`, `MongoMigrationStatusFailed`, `MongoMigrationStatusInProgress`, `MongoMigrationStatusNotStarted` +- New enum type `OperationOrigin` with values `OperationOriginSystem`, `OperationOriginUser` +- New enum type `ProvisioningState` with values `ProvisioningStateCanceled`, `ProvisioningStateFailed`, `ProvisioningStateProvisioning`, `ProvisioningStateSucceeded`, `ProvisioningStateUpdating` +- New enum type `ResourceType` with values `ResourceTypeMongoToCosmosDbMongo`, `ResourceTypeSQLDb`, `ResourceTypeSQLMi`, `ResourceTypeSQLVM` +- New enum type `TaskType` with values `TaskTypeConnectMongoDb`, `TaskTypeConnectToSourceMySQL`, `TaskTypeConnectToSourceOracleSync`, `TaskTypeConnectToSourcePostgreSQLSync`, `TaskTypeConnectToSourceSQLServer`, `TaskTypeConnectToSourceSQLServerSync`, `TaskTypeConnectToTargetAzureDbForMySQL`, `TaskTypeConnectToTargetAzureDbForPostgreSQLSync`, `TaskTypeConnectToTargetAzureSQLDbMI`, `TaskTypeConnectToTargetAzureSQLDbMISyncLRS`, `TaskTypeConnectToTargetOracleAzureDbForPostgreSQLSync`, `TaskTypeConnectToTargetSQLDb`, `TaskTypeConnectToTargetSQLDbSync`, `TaskTypeGetTDECertificatesSQL`, `TaskTypeGetUserTablesAzureSQLDbSync`, `TaskTypeGetUserTablesMySQL`, `TaskTypeGetUserTablesOracle`, `TaskTypeGetUserTablesPostgreSQL`, `TaskTypeGetUserTablesSQL`, `TaskTypeMigrateMongoDb`, `TaskTypeMigrateMySQLAzureDbForMySQL`, `TaskTypeMigrateMySQLAzureDbForMySQLSync`, `TaskTypeMigrateOracleAzureDbForPostgreSQLSync`, `TaskTypeMigratePostgreSQLAzureDbForPostgreSQLSyncV2`, `TaskTypeMigrateSQLServerAzureSQLDbMI`, `TaskTypeMigrateSQLServerAzureSQLDbMISyncLRS`, `TaskTypeMigrateSQLServerAzureSQLDbSync`, `TaskTypeMigrateSQLServerSQLDb`, `TaskTypeMigrateSchemaSQLServerSQLDb`, `TaskTypeMigrateSsis`, `TaskTypeServiceCheckOCI`, `TaskTypeServiceInstallOCI`, `TaskTypeServiceUploadOCI`, `TaskTypeValidateMigrationInputSQLServerAzureSQLDbMI`, `TaskTypeValidateMigrationInputSQLServerAzureSQLDbMISyncLRS`, `TaskTypeValidateMigrationInputSQLServerSQLDbSync`, `TaskTypeValidateMongoDb`, `TaskTypeValidateOracleAzureDbPostgreSQLSync` +- New function `*ClientFactory.NewDatabaseMigrationsMongoToCosmosDbRUMongoClient() *DatabaseMigrationsMongoToCosmosDbRUMongoClient` +- New function `*ClientFactory.NewDatabaseMigrationsMongoToCosmosDbvCoreMongoClient() *DatabaseMigrationsMongoToCosmosDbvCoreMongoClient` +- New function `*ClientFactory.NewDatabaseMigrationsSQLDbClient() *DatabaseMigrationsSQLDbClient` +- New function `*ClientFactory.NewDatabaseMigrationsSQLMiClient() *DatabaseMigrationsSQLMiClient` +- New function `*ClientFactory.NewDatabaseMigrationsSQLVMClient() *DatabaseMigrationsSQLVMClient` +- New function `*ClientFactory.NewMigrationServicesClient() *MigrationServicesClient` +- New function `*ClientFactory.NewSQLMigrationServicesClient() *SQLMigrationServicesClient` +- New function `*DatabaseMigrationBaseProperties.GetDatabaseMigrationBaseProperties() *DatabaseMigrationBaseProperties` +- New function `*DatabaseMigrationProperties.GetDatabaseMigrationBaseProperties() *DatabaseMigrationBaseProperties` +- New function `*DatabaseMigrationProperties.GetDatabaseMigrationProperties() *DatabaseMigrationProperties` +- New function `*DatabaseMigrationPropertiesCosmosDbMongo.GetDatabaseMigrationBaseProperties() *DatabaseMigrationBaseProperties` +- New function `*DatabaseMigrationPropertiesSQLDb.GetDatabaseMigrationBaseProperties() *DatabaseMigrationBaseProperties` +- New function `*DatabaseMigrationPropertiesSQLDb.GetDatabaseMigrationProperties() *DatabaseMigrationProperties` +- New function `*DatabaseMigrationPropertiesSQLMi.GetDatabaseMigrationBaseProperties() *DatabaseMigrationBaseProperties` +- New function `*DatabaseMigrationPropertiesSQLMi.GetDatabaseMigrationProperties() *DatabaseMigrationProperties` +- New function `*DatabaseMigrationPropertiesSQLVM.GetDatabaseMigrationBaseProperties() *DatabaseMigrationBaseProperties` +- New function `*DatabaseMigrationPropertiesSQLVM.GetDatabaseMigrationProperties() *DatabaseMigrationProperties` +- New function `NewDatabaseMigrationsMongoToCosmosDbRUMongoClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseMigrationsMongoToCosmosDbRUMongoClient, error)` +- New function `*DatabaseMigrationsMongoToCosmosDbRUMongoClient.BeginCreate(context.Context, string, string, string, DatabaseMigrationCosmosDbMongo, *DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginCreateOptions) (*runtime.Poller[DatabaseMigrationsMongoToCosmosDbRUMongoClientCreateResponse], error)` +- New function `*DatabaseMigrationsMongoToCosmosDbRUMongoClient.BeginDelete(context.Context, string, string, string, *DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginDeleteOptions) (*runtime.Poller[DatabaseMigrationsMongoToCosmosDbRUMongoClientDeleteResponse], error)` +- New function `*DatabaseMigrationsMongoToCosmosDbRUMongoClient.Get(context.Context, string, string, string, *DatabaseMigrationsMongoToCosmosDbRUMongoClientGetOptions) (DatabaseMigrationsMongoToCosmosDbRUMongoClientGetResponse, error)` +- New function `*DatabaseMigrationsMongoToCosmosDbRUMongoClient.NewGetForScopePager(string, string, *DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeOptions) *runtime.Pager[DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse]` +- New function `NewDatabaseMigrationsMongoToCosmosDbvCoreMongoClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseMigrationsMongoToCosmosDbvCoreMongoClient, error)` +- New function `*DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.BeginCreate(context.Context, string, string, string, DatabaseMigrationCosmosDbMongo, *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginCreateOptions) (*runtime.Poller[DatabaseMigrationsMongoToCosmosDbvCoreMongoClientCreateResponse], error)` +- New function `*DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.BeginDelete(context.Context, string, string, string, *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginDeleteOptions) (*runtime.Poller[DatabaseMigrationsMongoToCosmosDbvCoreMongoClientDeleteResponse], error)` +- New function `*DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.Get(context.Context, string, string, string, *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetOptions) (DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetResponse, error)` +- New function `*DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.NewGetForScopePager(string, string, *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeOptions) *runtime.Pager[DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse]` +- New function `NewDatabaseMigrationsSQLDbClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseMigrationsSQLDbClient, error)` +- New function `*DatabaseMigrationsSQLDbClient.BeginCancel(context.Context, string, string, string, MigrationOperationInput, *DatabaseMigrationsSQLDbClientBeginCancelOptions) (*runtime.Poller[DatabaseMigrationsSQLDbClientCancelResponse], error)` +- New function `*DatabaseMigrationsSQLDbClient.BeginCreateOrUpdate(context.Context, string, string, string, DatabaseMigrationSQLDb, *DatabaseMigrationsSQLDbClientBeginCreateOrUpdateOptions) (*runtime.Poller[DatabaseMigrationsSQLDbClientCreateOrUpdateResponse], error)` +- New function `*DatabaseMigrationsSQLDbClient.BeginDelete(context.Context, string, string, string, *DatabaseMigrationsSQLDbClientBeginDeleteOptions) (*runtime.Poller[DatabaseMigrationsSQLDbClientDeleteResponse], error)` +- New function `*DatabaseMigrationsSQLDbClient.Get(context.Context, string, string, string, *DatabaseMigrationsSQLDbClientGetOptions) (DatabaseMigrationsSQLDbClientGetResponse, error)` +- New function `NewDatabaseMigrationsSQLMiClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseMigrationsSQLMiClient, error)` +- New function `*DatabaseMigrationsSQLMiClient.BeginCancel(context.Context, string, string, string, MigrationOperationInput, *DatabaseMigrationsSQLMiClientBeginCancelOptions) (*runtime.Poller[DatabaseMigrationsSQLMiClientCancelResponse], error)` +- New function `*DatabaseMigrationsSQLMiClient.BeginCreateOrUpdate(context.Context, string, string, string, DatabaseMigrationSQLMi, *DatabaseMigrationsSQLMiClientBeginCreateOrUpdateOptions) (*runtime.Poller[DatabaseMigrationsSQLMiClientCreateOrUpdateResponse], error)` +- New function `*DatabaseMigrationsSQLMiClient.BeginCutover(context.Context, string, string, string, MigrationOperationInput, *DatabaseMigrationsSQLMiClientBeginCutoverOptions) (*runtime.Poller[DatabaseMigrationsSQLMiClientCutoverResponse], error)` +- New function `*DatabaseMigrationsSQLMiClient.Get(context.Context, string, string, string, *DatabaseMigrationsSQLMiClientGetOptions) (DatabaseMigrationsSQLMiClientGetResponse, error)` +- New function `NewDatabaseMigrationsSQLVMClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseMigrationsSQLVMClient, error)` +- New function `*DatabaseMigrationsSQLVMClient.BeginCancel(context.Context, string, string, string, MigrationOperationInput, *DatabaseMigrationsSQLVMClientBeginCancelOptions) (*runtime.Poller[DatabaseMigrationsSQLVMClientCancelResponse], error)` +- New function `*DatabaseMigrationsSQLVMClient.BeginCreateOrUpdate(context.Context, string, string, string, DatabaseMigrationSQLVM, *DatabaseMigrationsSQLVMClientBeginCreateOrUpdateOptions) (*runtime.Poller[DatabaseMigrationsSQLVMClientCreateOrUpdateResponse], error)` +- New function `*DatabaseMigrationsSQLVMClient.BeginCutover(context.Context, string, string, string, MigrationOperationInput, *DatabaseMigrationsSQLVMClientBeginCutoverOptions) (*runtime.Poller[DatabaseMigrationsSQLVMClientCutoverResponse], error)` +- New function `*DatabaseMigrationsSQLVMClient.Get(context.Context, string, string, string, *DatabaseMigrationsSQLVMClientGetOptions) (DatabaseMigrationsSQLVMClientGetResponse, error)` +- New function `NewMigrationServicesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*MigrationServicesClient, error)` +- New function `*MigrationServicesClient.BeginCreateOrUpdate(context.Context, string, string, MigrationService, *MigrationServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[MigrationServicesClientCreateOrUpdateResponse], error)` +- New function `*MigrationServicesClient.BeginDelete(context.Context, string, string, *MigrationServicesClientBeginDeleteOptions) (*runtime.Poller[MigrationServicesClientDeleteResponse], error)` +- New function `*MigrationServicesClient.Get(context.Context, string, string, *MigrationServicesClientGetOptions) (MigrationServicesClientGetResponse, error)` +- New function `*MigrationServicesClient.NewListByResourceGroupPager(string, *MigrationServicesClientListByResourceGroupOptions) *runtime.Pager[MigrationServicesClientListByResourceGroupResponse]` +- New function `*MigrationServicesClient.NewListBySubscriptionPager(*MigrationServicesClientListBySubscriptionOptions) *runtime.Pager[MigrationServicesClientListBySubscriptionResponse]` +- New function `*MigrationServicesClient.NewListMigrationsPager(string, string, *MigrationServicesClientListMigrationsOptions) *runtime.Pager[MigrationServicesClientListMigrationsResponse]` +- New function `*MigrationServicesClient.BeginUpdate(context.Context, string, string, MigrationServiceUpdate, *MigrationServicesClientBeginUpdateOptions) (*runtime.Poller[MigrationServicesClientUpdateResponse], error)` +- New function `NewSQLMigrationServicesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SQLMigrationServicesClient, error)` +- New function `*SQLMigrationServicesClient.BeginCreateOrUpdate(context.Context, string, string, SQLMigrationService, *SQLMigrationServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SQLMigrationServicesClientCreateOrUpdateResponse], error)` +- New function `*SQLMigrationServicesClient.BeginDelete(context.Context, string, string, *SQLMigrationServicesClientBeginDeleteOptions) (*runtime.Poller[SQLMigrationServicesClientDeleteResponse], error)` +- New function `*SQLMigrationServicesClient.DeleteNode(context.Context, string, string, DeleteNode, *SQLMigrationServicesClientDeleteNodeOptions) (SQLMigrationServicesClientDeleteNodeResponse, error)` +- New function `*SQLMigrationServicesClient.Get(context.Context, string, string, *SQLMigrationServicesClientGetOptions) (SQLMigrationServicesClientGetResponse, error)` +- New function `*SQLMigrationServicesClient.ListAuthKeys(context.Context, string, string, *SQLMigrationServicesClientListAuthKeysOptions) (SQLMigrationServicesClientListAuthKeysResponse, error)` +- New function `*SQLMigrationServicesClient.NewListByResourceGroupPager(string, *SQLMigrationServicesClientListByResourceGroupOptions) *runtime.Pager[SQLMigrationServicesClientListByResourceGroupResponse]` +- New function `*SQLMigrationServicesClient.NewListBySubscriptionPager(*SQLMigrationServicesClientListBySubscriptionOptions) *runtime.Pager[SQLMigrationServicesClientListBySubscriptionResponse]` +- New function `*SQLMigrationServicesClient.NewListMigrationsPager(string, string, *SQLMigrationServicesClientListMigrationsOptions) *runtime.Pager[SQLMigrationServicesClientListMigrationsResponse]` +- New function `*SQLMigrationServicesClient.ListMonitoringData(context.Context, string, string, *SQLMigrationServicesClientListMonitoringDataOptions) (SQLMigrationServicesClientListMonitoringDataResponse, error)` +- New function `*SQLMigrationServicesClient.RegenerateAuthKeys(context.Context, string, string, RegenAuthKeys, *SQLMigrationServicesClientRegenerateAuthKeysOptions) (SQLMigrationServicesClientRegenerateAuthKeysResponse, error)` +- New function `*SQLMigrationServicesClient.BeginUpdate(context.Context, string, string, SQLMigrationServiceUpdate, *SQLMigrationServicesClientBeginUpdateOptions) (*runtime.Poller[SQLMigrationServicesClientUpdateResponse], error)` +- New struct `AuthenticationKeys` +- New struct `AzureBlob` +- New struct `BackupConfiguration` +- New struct `CopyProgressDetails` +- New struct `DatabaseMigration` +- New struct `DatabaseMigrationBase` +- New struct `DatabaseMigrationBaseListResult` +- New struct `DatabaseMigrationCosmosDbMongo` +- New struct `DatabaseMigrationCosmosDbMongoListResult` +- New struct `DatabaseMigrationListResult` +- New struct `DatabaseMigrationPropertiesCosmosDbMongo` +- New struct `DatabaseMigrationPropertiesSQLDb` +- New struct `DatabaseMigrationPropertiesSQLMi` +- New struct `DatabaseMigrationPropertiesSQLVM` +- New struct `DatabaseMigrationSQLDb` +- New struct `DatabaseMigrationSQLMi` +- New struct `DatabaseMigrationSQLVM` +- New struct `DeleteNode` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `ErrorInfo` +- New struct `ErrorResponse` +- New struct `IntegrationRuntimeMonitoringData` +- New struct `MigrationOperationInput` +- New struct `MigrationService` +- New struct `MigrationServiceListResult` +- New struct `MigrationServiceProperties` +- New struct `MigrationServiceUpdate` +- New struct `MigrationStatusDetails` +- New struct `MongoConnectionInformation` +- New struct `MongoMigrationCollection` +- New struct `MongoMigrationProgressDetails` +- New struct `NodeMonitoringData` +- New struct `OfflineConfiguration` +- New struct `OperationListResult` +- New struct `OperationsDefinition` +- New struct `OperationsDisplayDefinition` +- New struct `ProxyResource` +- New struct `ProxyResourceAutoGenerated` +- New struct `RegenAuthKeys` +- New struct `ResourceAutoGenerated` +- New struct `SQLBackupFileInfo` +- New struct `SQLBackupSetInfo` +- New struct `SQLConnectionInformation` +- New struct `SQLDbMigrationStatusDetails` +- New struct `SQLDbOfflineConfiguration` +- New struct `SQLFileShare` +- New struct `SQLMigrationListResult` +- New struct `SQLMigrationService` +- New struct `SQLMigrationServiceProperties` +- New struct `SQLMigrationServiceUpdate` +- New struct `SourceLocation` +- New struct `SystemDataAutoGenerated` +- New struct `TargetLocation` +- New struct `TrackedResourceAutoGenerated` +- New field `IgnoreAzurePermissions` in struct `AzureActiveDirectoryApp` +- New field `EncryptedKeyForSecureFields` in struct `ConnectToSourceSQLServerTaskInput` +- New field `TaskID` in struct `ConnectToSourceSQLServerTaskProperties` +- New field `QueryObjectCounts` in struct `ConnectToTargetSQLDbTaskInput` +- New field `CreatedOn` in struct `ConnectToTargetSQLDbTaskProperties` +- New field `EncryptedKeyForSecureFields` in struct `GetUserTablesSQLTaskInput` +- New field `TaskID` in struct `GetUserTablesSQLTaskProperties` +- New field `EncryptedKeyForSecureFields` in struct `MigrateMySQLAzureDbForMySQLOfflineTaskInput` +- New field `IsCloneable`, `TaskID` in struct `MigrateMySQLAzureDbForMySQLOfflineTaskProperties` +- New field `ID` in struct `MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput` +- New field `EncryptedKeyForSecureFields`, `StartedOn` in struct `MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput` +- New field `Events` in struct `MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError` +- New field `DatabaseCount` in struct `MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel` +- New field `CreatedOn`, `IsCloneable`, `TaskID` in struct `MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties` +- New field `ID`, `SchemaSetting` in struct `MigrateSQLServerSQLDbDatabaseInput` +- New field `EncryptedKeyForSecureFields`, `StartedOn` in struct `MigrateSQLServerSQLDbTaskInput` +- New field `CreatedOn`, `IsCloneable`, `TaskID` in struct `MigrateSQLServerSQLDbTaskProperties` +- New field `ID` in struct `MigrateSQLServerSQLMIDatabaseInput` +- New field `NumberOfParallelDatabaseMigrations` in struct `MigrateSQLServerSQLMISyncTaskInput` +- New field `CreatedOn` in struct `MigrateSQLServerSQLMISyncTaskProperties` +- New field `EncryptedKeyForSecureFields`, `StartedOn` in struct `MigrateSQLServerSQLMITaskInput` +- New field `CreatedOn`, `IsCloneable`, `ParentTaskID`, `TaskID` in struct `MigrateSQLServerSQLMITaskProperties` +- New field `ID` in struct `MigrateSchemaSQLServerSQLDbDatabaseInput` +- New field `EncryptedKeyForSecureFields`, `StartedOn` in struct `MigrateSchemaSQLServerSQLDbTaskInput` +- New field `CreatedOn`, `IsCloneable`, `TaskID` in struct `MigrateSchemaSQLServerSQLDbTaskProperties` +- New field `CommandID` in struct `MigrateSyncCompleteCommandProperties` +- New field `AdditionalSettings`, `Authentication`, `DataSource`, `EncryptConnection`, `EnforceSSL`, `Port`, `ServerBrandVersion`, `ServerName`, `ServerVersion`, `TrustServerCertificate` in struct `MongoDbConnectionInfo` +- New field `AdditionalSettings`, `Authentication`, `DataSource` in struct `MySQLConnectionInfo` +- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` +- New field `Authentication`, `Port`, `ServerName`, `ServerVersion` in struct `OracleConnectionInfo` +- New field `AdditionalSettings`, `Authentication`, `DataSource`, `ServerBrandVersion`, `ServerVersion` in struct `PostgreSQLConnectionInfo` +- New field `Etag` in struct `Project` +- New field `AzureAuthenticationInfo` in struct `ProjectProperties` +- New field `SystemData` in struct `Resource` +- New field `Port`, `ResourceID`, `ServerBrandVersion`, `ServerName`, `ServerVersion` in struct `SQLConnectionInfo` +- New field `FileName` in struct `SchemaMigrationSetting` +- New field `AutoStopDelay`, `DeleteResourcesOnStop` in struct `ServiceProperties` +- New field `AgentConfiguration` in struct `ServiceStatusResponse` + + ## 1.2.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/datamigration/armdatamigration/README.md b/sdk/resourcemanager/datamigration/armdatamigration/README.md index 6ccb9efa1d90..91581b22bc1c 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/README.md +++ b/sdk/resourcemanager/datamigration/armdatamigration/README.md @@ -1,6 +1,6 @@ # Azure Data Migration Module for Go -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2) The `armdatamigration` module provides operations for working with Azure Data Migration. @@ -20,7 +20,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Data Migration module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2 ``` ## Authorization @@ -57,7 +57,7 @@ clientFactory, err := armdatamigration.NewClientFactory(, cred, A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewServicesClient() +client := clientFactory.NewDatabaseMigrationsMongoToCosmosDbRUMongoClient() ``` ## Fakes diff --git a/sdk/resourcemanager/datamigration/armdatamigration/autorest.md b/sdk/resourcemanager/datamigration/armdatamigration/autorest.md index d8bef10ee723..f018557d23ab 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/autorest.md +++ b/sdk/resourcemanager/datamigration/armdatamigration/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/datamigration/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/datamigration/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.2.0 -tag: package-2021-06 +module-version: 2.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/datamigration/armdatamigration/client_factory.go b/sdk/resourcemanager/datamigration/armdatamigration/client_factory.go index 659f585ecd23..fe420350eff7 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/client_factory.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/client_factory.go @@ -17,70 +17,140 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - Identifier of the subscription +// - subscriptionID - Subscription ID that identifies an Azure subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } +// NewDatabaseMigrationsMongoToCosmosDbRUMongoClient creates a new instance of DatabaseMigrationsMongoToCosmosDbRUMongoClient. +func (c *ClientFactory) NewDatabaseMigrationsMongoToCosmosDbRUMongoClient() *DatabaseMigrationsMongoToCosmosDbRUMongoClient { + return &DatabaseMigrationsMongoToCosmosDbRUMongoClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewDatabaseMigrationsMongoToCosmosDbvCoreMongoClient creates a new instance of DatabaseMigrationsMongoToCosmosDbvCoreMongoClient. +func (c *ClientFactory) NewDatabaseMigrationsMongoToCosmosDbvCoreMongoClient() *DatabaseMigrationsMongoToCosmosDbvCoreMongoClient { + return &DatabaseMigrationsMongoToCosmosDbvCoreMongoClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewDatabaseMigrationsSQLDbClient creates a new instance of DatabaseMigrationsSQLDbClient. +func (c *ClientFactory) NewDatabaseMigrationsSQLDbClient() *DatabaseMigrationsSQLDbClient { + return &DatabaseMigrationsSQLDbClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewDatabaseMigrationsSQLMiClient creates a new instance of DatabaseMigrationsSQLMiClient. +func (c *ClientFactory) NewDatabaseMigrationsSQLMiClient() *DatabaseMigrationsSQLMiClient { + return &DatabaseMigrationsSQLMiClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewDatabaseMigrationsSQLVMClient creates a new instance of DatabaseMigrationsSQLVMClient. +func (c *ClientFactory) NewDatabaseMigrationsSQLVMClient() *DatabaseMigrationsSQLVMClient { + return &DatabaseMigrationsSQLVMClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewFilesClient creates a new instance of FilesClient. func (c *ClientFactory) NewFilesClient() *FilesClient { - subClient, _ := NewFilesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &FilesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewMigrationServicesClient creates a new instance of MigrationServicesClient. +func (c *ClientFactory) NewMigrationServicesClient() *MigrationServicesClient { + return &MigrationServicesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewProjectsClient creates a new instance of ProjectsClient. func (c *ClientFactory) NewProjectsClient() *ProjectsClient { - subClient, _ := NewProjectsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ProjectsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewResourceSKUsClient creates a new instance of ResourceSKUsClient. func (c *ClientFactory) NewResourceSKUsClient() *ResourceSKUsClient { - subClient, _ := NewResourceSKUsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ResourceSKUsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewSQLMigrationServicesClient creates a new instance of SQLMigrationServicesClient. +func (c *ClientFactory) NewSQLMigrationServicesClient() *SQLMigrationServicesClient { + return &SQLMigrationServicesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServiceTasksClient creates a new instance of ServiceTasksClient. func (c *ClientFactory) NewServiceTasksClient() *ServiceTasksClient { - subClient, _ := NewServiceTasksClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServiceTasksClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServicesClient creates a new instance of ServicesClient. func (c *ClientFactory) NewServicesClient() *ServicesClient { - subClient, _ := NewServicesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServicesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewTasksClient creates a new instance of TasksClient. func (c *ClientFactory) NewTasksClient() *TasksClient { - subClient, _ := NewTasksClient(c.subscriptionID, c.credential, c.options) - return subClient + return &TasksClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewUsagesClient creates a new instance of UsagesClient. func (c *ClientFactory) NewUsagesClient() *UsagesClient { - subClient, _ := NewUsagesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &UsagesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/datamigration/armdatamigration/constants.go b/sdk/resourcemanager/datamigration/armdatamigration/constants.go index d90bf8e66648..b34771eac2a9 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/constants.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/constants.go @@ -10,7 +10,7 @@ package armdatamigration const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" - moduleVersion = "v1.2.0" + moduleVersion = "v2.0.0-beta.1" ) // AuthenticationType - An enumeration of possible authentication types when connecting @@ -125,6 +125,28 @@ func PossibleCommandStateValues() []CommandState { } } +// CommandType - Command type. +type CommandType string + +const ( + CommandTypeCancel CommandType = "cancel" + CommandTypeFinish CommandType = "finish" + CommandTypeMigrateSQLServerAzureDbSQLMiComplete CommandType = "Migrate.SqlServer.AzureDbSqlMi.Complete" + CommandTypeMigrateSyncCompleteDatabase CommandType = "Migrate.Sync.Complete.Database" + CommandTypeRestart CommandType = "restart" +) + +// PossibleCommandTypeValues returns the possible values for the CommandType const type. +func PossibleCommandTypeValues() []CommandType { + return []CommandType{ + CommandTypeCancel, + CommandTypeFinish, + CommandTypeMigrateSQLServerAzureDbSQLMiComplete, + CommandTypeMigrateSyncCompleteDatabase, + CommandTypeRestart, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -558,6 +580,28 @@ func PossibleMongoDbShardKeyOrderValues() []MongoDbShardKeyOrder { } } +// MongoMigrationStatus - Migration Status +type MongoMigrationStatus string + +const ( + MongoMigrationStatusCanceled MongoMigrationStatus = "Canceled" + MongoMigrationStatusCompleted MongoMigrationStatus = "Completed" + MongoMigrationStatusFailed MongoMigrationStatus = "Failed" + MongoMigrationStatusInProgress MongoMigrationStatus = "InProgress" + MongoMigrationStatusNotStarted MongoMigrationStatus = "NotStarted" +) + +// PossibleMongoMigrationStatusValues returns the possible values for the MongoMigrationStatus const type. +func PossibleMongoMigrationStatusValues() []MongoMigrationStatus { + return []MongoMigrationStatus{ + MongoMigrationStatusCanceled, + MongoMigrationStatusCompleted, + MongoMigrationStatusFailed, + MongoMigrationStatusInProgress, + MongoMigrationStatusNotStarted, + } +} + // MySQLTargetPlatformType - An enumeration of possible target types when migrating from MySQL type MySQLTargetPlatformType string @@ -612,6 +656,21 @@ func PossibleObjectTypeValues() []ObjectType { } } +type OperationOrigin string + +const ( + OperationOriginSystem OperationOrigin = "system" + OperationOriginUser OperationOrigin = "user" +) + +// PossibleOperationOriginValues returns the possible values for the OperationOrigin const type. +func PossibleOperationOriginValues() []OperationOrigin { + return []OperationOrigin{ + OperationOriginSystem, + OperationOriginUser, + } +} + // ProjectProvisioningState - The project's provisioning state type ProjectProvisioningState string @@ -674,6 +733,29 @@ func PossibleProjectTargetPlatformValues() []ProjectTargetPlatform { } } +// ProvisioningState - Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been +// performed and migration has started. +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateCanceled, + ProvisioningStateFailed, + ProvisioningStateProvisioning, + ProvisioningStateSucceeded, + ProvisioningStateUpdating, + } +} + // ReplicateMigrationState - Wrapper for replicate reported migration states. type ReplicateMigrationState string @@ -746,6 +828,25 @@ func PossibleResourceSKURestrictionsTypeValues() []ResourceSKURestrictionsType { } } +type ResourceType string + +const ( + ResourceTypeMongoToCosmosDbMongo ResourceType = "MongoToCosmosDbMongo" + ResourceTypeSQLDb ResourceType = "SqlDb" + ResourceTypeSQLMi ResourceType = "SqlMi" + ResourceTypeSQLVM ResourceType = "SqlVm" +) + +// PossibleResourceTypeValues returns the possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{ + ResourceTypeMongoToCosmosDbMongo, + ResourceTypeSQLDb, + ResourceTypeSQLMi, + ResourceTypeSQLVM, + } +} + // SQLSourcePlatform - An enumeration of source platform types type SQLSourcePlatform string @@ -879,6 +980,7 @@ const ( ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" ServerLevelPermissionsGroupMigrationFromSQLServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" ServerLevelPermissionsGroupMigrationFromSQLServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" + ServerLevelPermissionsGroupMigrationFromSQLServerToAzureVM ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureVM" ) // PossibleServerLevelPermissionsGroupValues returns the possible values for the ServerLevelPermissionsGroup const type. @@ -888,6 +990,7 @@ func PossibleServerLevelPermissionsGroupValues() []ServerLevelPermissionsGroup { ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, ServerLevelPermissionsGroupMigrationFromSQLServerToAzureDB, ServerLevelPermissionsGroupMigrationFromSQLServerToAzureMI, + ServerLevelPermissionsGroupMigrationFromSQLServerToAzureVM, } } @@ -960,7 +1063,7 @@ func PossibleSeverityValues() []Severity { } // SsisMigrationOverwriteOption - 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 +// in DMS (classic) now and future may add Reuse option for container object type SsisMigrationOverwriteOption string const ( @@ -996,7 +1099,7 @@ func PossibleSsisMigrationStageValues() []SsisMigrationStage { } } -// SsisStoreType - An enumeration of supported source SSIS store type in DMS +// SsisStoreType - An enumeration of supported source SSIS store type in DMS (classic) type SsisStoreType string const ( @@ -1110,6 +1213,94 @@ func PossibleTaskStateValues() []TaskState { } } +// TaskType - Task type. +type TaskType string + +const ( + TaskTypeConnectMongoDb TaskType = "Connect.MongoDb" + TaskTypeConnectToSourceMySQL TaskType = "ConnectToSource.MySql" + TaskTypeConnectToSourceOracleSync TaskType = "ConnectToSource.Oracle.Sync" + TaskTypeConnectToSourcePostgreSQLSync TaskType = "ConnectToSource.PostgreSql.Sync" + TaskTypeConnectToSourceSQLServer TaskType = "ConnectToSource.SqlServer" + TaskTypeConnectToSourceSQLServerSync TaskType = "ConnectToSource.SqlServer.Sync" + TaskTypeConnectToTargetAzureDbForMySQL TaskType = "ConnectToTarget.AzureDbForMySql" + TaskTypeConnectToTargetAzureDbForPostgreSQLSync TaskType = "ConnectToTarget.AzureDbForPostgreSql.Sync" + TaskTypeConnectToTargetAzureSQLDbMI TaskType = "ConnectToTarget.AzureSqlDbMI" + TaskTypeConnectToTargetAzureSQLDbMISyncLRS TaskType = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + TaskTypeConnectToTargetOracleAzureDbForPostgreSQLSync TaskType = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync" + TaskTypeConnectToTargetSQLDb TaskType = "ConnectToTarget.SqlDb" + TaskTypeConnectToTargetSQLDbSync TaskType = "ConnectToTarget.SqlDb.Sync" + TaskTypeGetTDECertificatesSQL TaskType = "GetTDECertificates.Sql" + TaskTypeGetUserTablesAzureSQLDbSync TaskType = "GetUserTables.AzureSqlDb.Sync" + TaskTypeGetUserTablesMySQL TaskType = "GetUserTablesMySql" + TaskTypeGetUserTablesOracle TaskType = "GetUserTablesOracle" + TaskTypeGetUserTablesPostgreSQL TaskType = "GetUserTablesPostgreSql" + TaskTypeGetUserTablesSQL TaskType = "GetUserTables.Sql" + TaskTypeMigrateMongoDb TaskType = "Migrate.MongoDb" + TaskTypeMigrateMySQLAzureDbForMySQL TaskType = "Migrate.MySql.AzureDbForMySql" + TaskTypeMigrateMySQLAzureDbForMySQLSync TaskType = "Migrate.MySql.AzureDbForMySql.Sync" + TaskTypeMigrateOracleAzureDbForPostgreSQLSync TaskType = "Migrate.Oracle.AzureDbForPostgreSql.Sync" + TaskTypeMigratePostgreSQLAzureDbForPostgreSQLSyncV2 TaskType = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2" + TaskTypeMigrateSQLServerAzureSQLDbMI TaskType = "Migrate.SqlServer.AzureSqlDbMI" + TaskTypeMigrateSQLServerAzureSQLDbMISyncLRS TaskType = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + TaskTypeMigrateSQLServerAzureSQLDbSync TaskType = "Migrate.SqlServer.AzureSqlDb.Sync" + TaskTypeMigrateSQLServerSQLDb TaskType = "Migrate.SqlServer.SqlDb" + TaskTypeMigrateSchemaSQLServerSQLDb TaskType = "MigrateSchemaSqlServerSqlDb" + TaskTypeMigrateSsis TaskType = "Migrate.Ssis" + TaskTypeServiceCheckOCI TaskType = "Service.Check.OCI" + TaskTypeServiceInstallOCI TaskType = "Service.Install.OCI" + TaskTypeServiceUploadOCI TaskType = "Service.Upload.OCI" + TaskTypeValidateMigrationInputSQLServerAzureSQLDbMI TaskType = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + TaskTypeValidateMigrationInputSQLServerAzureSQLDbMISyncLRS TaskType = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + TaskTypeValidateMigrationInputSQLServerSQLDbSync TaskType = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + TaskTypeValidateMongoDb TaskType = "Validate.MongoDb" + TaskTypeValidateOracleAzureDbPostgreSQLSync TaskType = "Validate.Oracle.AzureDbPostgreSql.Sync" +) + +// PossibleTaskTypeValues returns the possible values for the TaskType const type. +func PossibleTaskTypeValues() []TaskType { + return []TaskType{ + TaskTypeConnectMongoDb, + TaskTypeConnectToSourceMySQL, + TaskTypeConnectToSourceOracleSync, + TaskTypeConnectToSourcePostgreSQLSync, + TaskTypeConnectToSourceSQLServer, + TaskTypeConnectToSourceSQLServerSync, + TaskTypeConnectToTargetAzureDbForMySQL, + TaskTypeConnectToTargetAzureDbForPostgreSQLSync, + TaskTypeConnectToTargetAzureSQLDbMI, + TaskTypeConnectToTargetAzureSQLDbMISyncLRS, + TaskTypeConnectToTargetOracleAzureDbForPostgreSQLSync, + TaskTypeConnectToTargetSQLDb, + TaskTypeConnectToTargetSQLDbSync, + TaskTypeGetTDECertificatesSQL, + TaskTypeGetUserTablesAzureSQLDbSync, + TaskTypeGetUserTablesMySQL, + TaskTypeGetUserTablesOracle, + TaskTypeGetUserTablesPostgreSQL, + TaskTypeGetUserTablesSQL, + TaskTypeMigrateMongoDb, + TaskTypeMigrateMySQLAzureDbForMySQL, + TaskTypeMigrateMySQLAzureDbForMySQLSync, + TaskTypeMigrateOracleAzureDbForPostgreSQLSync, + TaskTypeMigratePostgreSQLAzureDbForPostgreSQLSyncV2, + TaskTypeMigrateSQLServerAzureSQLDbMI, + TaskTypeMigrateSQLServerAzureSQLDbMISyncLRS, + TaskTypeMigrateSQLServerAzureSQLDbSync, + TaskTypeMigrateSQLServerSQLDb, + TaskTypeMigrateSchemaSQLServerSQLDb, + TaskTypeMigrateSsis, + TaskTypeServiceCheckOCI, + TaskTypeServiceInstallOCI, + TaskTypeServiceUploadOCI, + TaskTypeValidateMigrationInputSQLServerAzureSQLDbMI, + TaskTypeValidateMigrationInputSQLServerAzureSQLDbMISyncLRS, + TaskTypeValidateMigrationInputSQLServerSQLDbSync, + TaskTypeValidateMongoDb, + TaskTypeValidateOracleAzureDbPostgreSQLSync, + } +} + // UpdateActionType - Type of the actual difference for the compared object, while performing schema comparison type UpdateActionType string diff --git a/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationsmongotocosmosdbrumongo_client.go b/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationsmongotocosmosdbrumongo_client.go new file mode 100644 index 000000000000..d0d9b4a483cb --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationsmongotocosmosdbrumongo_client.go @@ -0,0 +1,353 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdatamigration + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// DatabaseMigrationsMongoToCosmosDbRUMongoClient contains the methods for the DatabaseMigrationsMongoToCosmosDbRUMongo group. +// Don't use this type directly, use NewDatabaseMigrationsMongoToCosmosDbRUMongoClient() instead. +type DatabaseMigrationsMongoToCosmosDbRUMongoClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDatabaseMigrationsMongoToCosmosDbRUMongoClient creates a new instance of DatabaseMigrationsMongoToCosmosDbRUMongoClient with the specified values. +// - subscriptionID - Subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDatabaseMigrationsMongoToCosmosDbRUMongoClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseMigrationsMongoToCosmosDbRUMongoClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DatabaseMigrationsMongoToCosmosDbRUMongoClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Create or Update Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetResourceName - The name of the target resource/account. +// - migrationName - Name of the migration. +// - parameters - Details of CosmosDB for Mongo API Migration resource. +// - options - DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginCreateOptions contains the optional parameters for the DatabaseMigrationsMongoToCosmosDbRUMongoClient.BeginCreate +// method. +func (client *DatabaseMigrationsMongoToCosmosDbRUMongoClient) BeginCreate(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, parameters DatabaseMigrationCosmosDbMongo, options *DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginCreateOptions) (*runtime.Poller[DatabaseMigrationsMongoToCosmosDbRUMongoClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, targetResourceName, migrationName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseMigrationsMongoToCosmosDbRUMongoClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabaseMigrationsMongoToCosmosDbRUMongoClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - Create or Update Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *DatabaseMigrationsMongoToCosmosDbRUMongoClient) create(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, parameters DatabaseMigrationCosmosDbMongo, options *DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginCreateOptions) (*http.Response, error) { + var err error + const operationName = "DatabaseMigrationsMongoToCosmosDbRUMongoClient.BeginCreate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createCreateRequest(ctx, resourceGroupName, targetResourceName, migrationName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createCreateRequest creates the Create request. +func (client *DatabaseMigrationsMongoToCosmosDbRUMongoClient) createCreateRequest(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, parameters DatabaseMigrationCosmosDbMongo, options *DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations/{migrationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if targetResourceName == "" { + return nil, errors.New("parameter targetResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetResourceName}", url.PathEscape(targetResourceName)) + if migrationName == "" { + return nil, errors.New("parameter migrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(migrationName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetResourceName - The name of the target resource/account. +// - migrationName - Name of the migration. +// - options - DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginDeleteOptions contains the optional parameters for the DatabaseMigrationsMongoToCosmosDbRUMongoClient.BeginDelete +// method. +func (client *DatabaseMigrationsMongoToCosmosDbRUMongoClient) BeginDelete(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, options *DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginDeleteOptions) (*runtime.Poller[DatabaseMigrationsMongoToCosmosDbRUMongoClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, targetResourceName, migrationName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseMigrationsMongoToCosmosDbRUMongoClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabaseMigrationsMongoToCosmosDbRUMongoClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *DatabaseMigrationsMongoToCosmosDbRUMongoClient) deleteOperation(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, options *DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "DatabaseMigrationsMongoToCosmosDbRUMongoClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, targetResourceName, migrationName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DatabaseMigrationsMongoToCosmosDbRUMongoClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, options *DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations/{migrationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if targetResourceName == "" { + return nil, errors.New("parameter targetResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetResourceName}", url.PathEscape(targetResourceName)) + if migrationName == "" { + return nil, errors.New("parameter migrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(migrationName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + if options != nil && options.Force != nil { + reqQP.Set("force", strconv.FormatBool(*options.Force)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetResourceName - The name of the target resource/account. +// - migrationName - Name of the migration. +// - options - DatabaseMigrationsMongoToCosmosDbRUMongoClientGetOptions contains the optional parameters for the DatabaseMigrationsMongoToCosmosDbRUMongoClient.Get +// method. +func (client *DatabaseMigrationsMongoToCosmosDbRUMongoClient) Get(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, options *DatabaseMigrationsMongoToCosmosDbRUMongoClientGetOptions) (DatabaseMigrationsMongoToCosmosDbRUMongoClientGetResponse, error) { + var err error + const operationName = "DatabaseMigrationsMongoToCosmosDbRUMongoClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, targetResourceName, migrationName, options) + if err != nil { + return DatabaseMigrationsMongoToCosmosDbRUMongoClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseMigrationsMongoToCosmosDbRUMongoClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseMigrationsMongoToCosmosDbRUMongoClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DatabaseMigrationsMongoToCosmosDbRUMongoClient) getCreateRequest(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, options *DatabaseMigrationsMongoToCosmosDbRUMongoClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations/{migrationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if targetResourceName == "" { + return nil, errors.New("parameter targetResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetResourceName}", url.PathEscape(targetResourceName)) + if migrationName == "" { + return nil, errors.New("parameter migrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(migrationName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DatabaseMigrationsMongoToCosmosDbRUMongoClient) getHandleResponse(resp *http.Response) (DatabaseMigrationsMongoToCosmosDbRUMongoClientGetResponse, error) { + result := DatabaseMigrationsMongoToCosmosDbRUMongoClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseMigrationCosmosDbMongo); err != nil { + return DatabaseMigrationsMongoToCosmosDbRUMongoClientGetResponse{}, err + } + return result, nil +} + +// NewGetForScopePager - Get Database Migration resources for the scope. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetResourceName - The name of the target resource/account. +// - options - DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeOptions contains the optional parameters for the DatabaseMigrationsMongoToCosmosDbRUMongoClient.NewGetForScopePager +// method. +func (client *DatabaseMigrationsMongoToCosmosDbRUMongoClient) NewGetForScopePager(resourceGroupName string, targetResourceName string, options *DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeOptions) *runtime.Pager[DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse] { + return runtime.NewPager(runtime.PagingHandler[DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse]{ + More: func(page DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse) (DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DatabaseMigrationsMongoToCosmosDbRUMongoClient.NewGetForScopePager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.getForScopeCreateRequest(ctx, resourceGroupName, targetResourceName, options) + }, nil) + if err != nil { + return DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse{}, err + } + return client.getForScopeHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// getForScopeCreateRequest creates the GetForScope request. +func (client *DatabaseMigrationsMongoToCosmosDbRUMongoClient) getForScopeCreateRequest(ctx context.Context, resourceGroupName string, targetResourceName string, options *DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if targetResourceName == "" { + return nil, errors.New("parameter targetResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetResourceName}", url.PathEscape(targetResourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getForScopeHandleResponse handles the GetForScope response. +func (client *DatabaseMigrationsMongoToCosmosDbRUMongoClient) getForScopeHandleResponse(resp *http.Response) (DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse, error) { + result := DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseMigrationCosmosDbMongoListResult); err != nil { + return DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationsmongotocosmosdbvcoremongo_client.go b/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationsmongotocosmosdbvcoremongo_client.go new file mode 100644 index 000000000000..25a67142d533 --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationsmongotocosmosdbvcoremongo_client.go @@ -0,0 +1,353 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdatamigration + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// DatabaseMigrationsMongoToCosmosDbvCoreMongoClient contains the methods for the DatabaseMigrationsMongoToCosmosDbvCoreMongo group. +// Don't use this type directly, use NewDatabaseMigrationsMongoToCosmosDbvCoreMongoClient() instead. +type DatabaseMigrationsMongoToCosmosDbvCoreMongoClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDatabaseMigrationsMongoToCosmosDbvCoreMongoClient creates a new instance of DatabaseMigrationsMongoToCosmosDbvCoreMongoClient with the specified values. +// - subscriptionID - Subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDatabaseMigrationsMongoToCosmosDbvCoreMongoClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseMigrationsMongoToCosmosDbvCoreMongoClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DatabaseMigrationsMongoToCosmosDbvCoreMongoClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Create or Update Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetResourceName - The name of the target resource/account. +// - migrationName - Name of the migration. +// - parameters - Details of CosmosDB for Mongo API Migration resource. +// - options - DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginCreateOptions contains the optional parameters for the +// DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.BeginCreate method. +func (client *DatabaseMigrationsMongoToCosmosDbvCoreMongoClient) BeginCreate(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, parameters DatabaseMigrationCosmosDbMongo, options *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginCreateOptions) (*runtime.Poller[DatabaseMigrationsMongoToCosmosDbvCoreMongoClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, targetResourceName, migrationName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseMigrationsMongoToCosmosDbvCoreMongoClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabaseMigrationsMongoToCosmosDbvCoreMongoClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - Create or Update Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *DatabaseMigrationsMongoToCosmosDbvCoreMongoClient) create(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, parameters DatabaseMigrationCosmosDbMongo, options *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginCreateOptions) (*http.Response, error) { + var err error + const operationName = "DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.BeginCreate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createCreateRequest(ctx, resourceGroupName, targetResourceName, migrationName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createCreateRequest creates the Create request. +func (client *DatabaseMigrationsMongoToCosmosDbvCoreMongoClient) createCreateRequest(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, parameters DatabaseMigrationCosmosDbMongo, options *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations/{migrationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if targetResourceName == "" { + return nil, errors.New("parameter targetResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetResourceName}", url.PathEscape(targetResourceName)) + if migrationName == "" { + return nil, errors.New("parameter migrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(migrationName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetResourceName - The name of the target resource/account. +// - migrationName - Name of the migration. +// - options - DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginDeleteOptions contains the optional parameters for the +// DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.BeginDelete method. +func (client *DatabaseMigrationsMongoToCosmosDbvCoreMongoClient) BeginDelete(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, options *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginDeleteOptions) (*runtime.Poller[DatabaseMigrationsMongoToCosmosDbvCoreMongoClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, targetResourceName, migrationName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseMigrationsMongoToCosmosDbvCoreMongoClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabaseMigrationsMongoToCosmosDbvCoreMongoClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *DatabaseMigrationsMongoToCosmosDbvCoreMongoClient) deleteOperation(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, options *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, targetResourceName, migrationName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DatabaseMigrationsMongoToCosmosDbvCoreMongoClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, options *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations/{migrationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if targetResourceName == "" { + return nil, errors.New("parameter targetResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetResourceName}", url.PathEscape(targetResourceName)) + if migrationName == "" { + return nil, errors.New("parameter migrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(migrationName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + if options != nil && options.Force != nil { + reqQP.Set("force", strconv.FormatBool(*options.Force)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetResourceName - The name of the target resource/account. +// - migrationName - Name of the migration. +// - options - DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetOptions contains the optional parameters for the DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.Get +// method. +func (client *DatabaseMigrationsMongoToCosmosDbvCoreMongoClient) Get(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, options *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetOptions) (DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetResponse, error) { + var err error + const operationName = "DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, targetResourceName, migrationName, options) + if err != nil { + return DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DatabaseMigrationsMongoToCosmosDbvCoreMongoClient) getCreateRequest(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, options *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations/{migrationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if targetResourceName == "" { + return nil, errors.New("parameter targetResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetResourceName}", url.PathEscape(targetResourceName)) + if migrationName == "" { + return nil, errors.New("parameter migrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(migrationName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DatabaseMigrationsMongoToCosmosDbvCoreMongoClient) getHandleResponse(resp *http.Response) (DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetResponse, error) { + result := DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseMigrationCosmosDbMongo); err != nil { + return DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetResponse{}, err + } + return result, nil +} + +// NewGetForScopePager - Get Database Migration resources for the scope. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetResourceName - The name of the target resource/account. +// - options - DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeOptions contains the optional parameters for the +// DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.NewGetForScopePager method. +func (client *DatabaseMigrationsMongoToCosmosDbvCoreMongoClient) NewGetForScopePager(resourceGroupName string, targetResourceName string, options *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeOptions) *runtime.Pager[DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse] { + return runtime.NewPager(runtime.PagingHandler[DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse]{ + More: func(page DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse) (DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.NewGetForScopePager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.getForScopeCreateRequest(ctx, resourceGroupName, targetResourceName, options) + }, nil) + if err != nil { + return DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse{}, err + } + return client.getForScopeHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// getForScopeCreateRequest creates the GetForScope request. +func (client *DatabaseMigrationsMongoToCosmosDbvCoreMongoClient) getForScopeCreateRequest(ctx context.Context, resourceGroupName string, targetResourceName string, options *DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if targetResourceName == "" { + return nil, errors.New("parameter targetResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetResourceName}", url.PathEscape(targetResourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getForScopeHandleResponse handles the GetForScope response. +func (client *DatabaseMigrationsMongoToCosmosDbvCoreMongoClient) getForScopeHandleResponse(resp *http.Response) (DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse, error) { + result := DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseMigrationCosmosDbMongoListResult); err != nil { + return DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationssqldb_client.go b/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationssqldb_client.go new file mode 100644 index 000000000000..e7b211982d7a --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationssqldb_client.go @@ -0,0 +1,373 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdatamigration + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// DatabaseMigrationsSQLDbClient contains the methods for the DatabaseMigrationsSQLDb group. +// Don't use this type directly, use NewDatabaseMigrationsSQLDbClient() instead. +type DatabaseMigrationsSQLDbClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDatabaseMigrationsSQLDbClient creates a new instance of DatabaseMigrationsSQLDbClient with the specified values. +// - subscriptionID - Subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDatabaseMigrationsSQLDbClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseMigrationsSQLDbClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DatabaseMigrationsSQLDbClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCancel - Stop on going migration for the database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetDbName - The name of the target database. +// - parameters - Required migration operation ID for which cancel will be initiated. +// - options - DatabaseMigrationsSQLDbClientBeginCancelOptions contains the optional parameters for the DatabaseMigrationsSQLDbClient.BeginCancel +// method. +func (client *DatabaseMigrationsSQLDbClient) BeginCancel(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLDbClientBeginCancelOptions) (*runtime.Poller[DatabaseMigrationsSQLDbClientCancelResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.cancel(ctx, resourceGroupName, sqlDbInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseMigrationsSQLDbClientCancelResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabaseMigrationsSQLDbClientCancelResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Cancel - Stop on going migration for the database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *DatabaseMigrationsSQLDbClient) cancel(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLDbClientBeginCancelOptions) (*http.Response, error) { + var err error + const operationName = "DatabaseMigrationsSQLDbClient.BeginCancel" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.cancelCreateRequest(ctx, resourceGroupName, sqlDbInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// cancelCreateRequest creates the Cancel request. +func (client *DatabaseMigrationsSQLDbClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLDbClientBeginCancelOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlDbInstanceName == "" { + return nil, errors.New("parameter sqlDbInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlDbInstanceName}", url.PathEscape(sqlDbInstanceName)) + if targetDbName == "" { + return nil, errors.New("parameter targetDbName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbName}", url.PathEscape(targetDbName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginCreateOrUpdate - Create or Update Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetDbName - The name of the target database. +// - parameters - Details of Sql Db migration resource. +// - options - DatabaseMigrationsSQLDbClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseMigrationsSQLDbClient.BeginCreateOrUpdate +// method. +func (client *DatabaseMigrationsSQLDbClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, parameters DatabaseMigrationSQLDb, options *DatabaseMigrationsSQLDbClientBeginCreateOrUpdateOptions) (*runtime.Poller[DatabaseMigrationsSQLDbClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, sqlDbInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseMigrationsSQLDbClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabaseMigrationsSQLDbClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or Update Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *DatabaseMigrationsSQLDbClient) createOrUpdate(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, parameters DatabaseMigrationSQLDb, options *DatabaseMigrationsSQLDbClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "DatabaseMigrationsSQLDbClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, sqlDbInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DatabaseMigrationsSQLDbClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, parameters DatabaseMigrationSQLDb, options *DatabaseMigrationsSQLDbClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlDbInstanceName == "" { + return nil, errors.New("parameter sqlDbInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlDbInstanceName}", url.PathEscape(sqlDbInstanceName)) + if targetDbName == "" { + return nil, errors.New("parameter targetDbName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbName}", url.PathEscape(targetDbName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetDbName - The name of the target database. +// - options - DatabaseMigrationsSQLDbClientBeginDeleteOptions contains the optional parameters for the DatabaseMigrationsSQLDbClient.BeginDelete +// method. +func (client *DatabaseMigrationsSQLDbClient) BeginDelete(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, options *DatabaseMigrationsSQLDbClientBeginDeleteOptions) (*runtime.Poller[DatabaseMigrationsSQLDbClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, sqlDbInstanceName, targetDbName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseMigrationsSQLDbClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabaseMigrationsSQLDbClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *DatabaseMigrationsSQLDbClient) deleteOperation(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, options *DatabaseMigrationsSQLDbClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "DatabaseMigrationsSQLDbClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, sqlDbInstanceName, targetDbName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DatabaseMigrationsSQLDbClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, options *DatabaseMigrationsSQLDbClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlDbInstanceName == "" { + return nil, errors.New("parameter sqlDbInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlDbInstanceName}", url.PathEscape(sqlDbInstanceName)) + if targetDbName == "" { + return nil, errors.New("parameter targetDbName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbName}", url.PathEscape(targetDbName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + if options != nil && options.Force != nil { + reqQP.Set("force", strconv.FormatBool(*options.Force)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Retrieve the Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetDbName - The name of the target database. +// - options - DatabaseMigrationsSQLDbClientGetOptions contains the optional parameters for the DatabaseMigrationsSQLDbClient.Get +// method. +func (client *DatabaseMigrationsSQLDbClient) Get(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, options *DatabaseMigrationsSQLDbClientGetOptions) (DatabaseMigrationsSQLDbClientGetResponse, error) { + var err error + const operationName = "DatabaseMigrationsSQLDbClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, sqlDbInstanceName, targetDbName, options) + if err != nil { + return DatabaseMigrationsSQLDbClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseMigrationsSQLDbClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseMigrationsSQLDbClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DatabaseMigrationsSQLDbClient) getCreateRequest(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, options *DatabaseMigrationsSQLDbClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlDbInstanceName == "" { + return nil, errors.New("parameter sqlDbInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlDbInstanceName}", url.PathEscape(sqlDbInstanceName)) + if targetDbName == "" { + return nil, errors.New("parameter targetDbName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbName}", url.PathEscape(targetDbName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + reqQP.Set("api-version", "2023-07-15-preview") + if options != nil && options.MigrationOperationID != nil { + reqQP.Set("migrationOperationId", *options.MigrationOperationID) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DatabaseMigrationsSQLDbClient) getHandleResponse(resp *http.Response) (DatabaseMigrationsSQLDbClientGetResponse, error) { + result := DatabaseMigrationsSQLDbClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseMigrationSQLDb); err != nil { + return DatabaseMigrationsSQLDbClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationssqlmi_client.go b/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationssqlmi_client.go new file mode 100644 index 000000000000..32b9d69098a3 --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationssqlmi_client.go @@ -0,0 +1,373 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdatamigration + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DatabaseMigrationsSQLMiClient contains the methods for the DatabaseMigrationsSQLMi group. +// Don't use this type directly, use NewDatabaseMigrationsSQLMiClient() instead. +type DatabaseMigrationsSQLMiClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDatabaseMigrationsSQLMiClient creates a new instance of DatabaseMigrationsSQLMiClient with the specified values. +// - subscriptionID - Subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDatabaseMigrationsSQLMiClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseMigrationsSQLMiClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DatabaseMigrationsSQLMiClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCancel - Stop in-progress database migration to SQL Managed Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetDbName - The name of the target database. +// - parameters - Required migration operation ID for which cancel will be initiated. +// - options - DatabaseMigrationsSQLMiClientBeginCancelOptions contains the optional parameters for the DatabaseMigrationsSQLMiClient.BeginCancel +// method. +func (client *DatabaseMigrationsSQLMiClient) BeginCancel(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLMiClientBeginCancelOptions) (*runtime.Poller[DatabaseMigrationsSQLMiClientCancelResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.cancel(ctx, resourceGroupName, managedInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseMigrationsSQLMiClientCancelResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabaseMigrationsSQLMiClientCancelResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Cancel - Stop in-progress database migration to SQL Managed Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *DatabaseMigrationsSQLMiClient) cancel(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLMiClientBeginCancelOptions) (*http.Response, error) { + var err error + const operationName = "DatabaseMigrationsSQLMiClient.BeginCancel" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.cancelCreateRequest(ctx, resourceGroupName, managedInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// cancelCreateRequest creates the Cancel request. +func (client *DatabaseMigrationsSQLMiClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLMiClientBeginCancelOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if targetDbName == "" { + return nil, errors.New("parameter targetDbName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbName}", url.PathEscape(targetDbName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginCreateOrUpdate - Create a new database migration to a given SQL Managed Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetDbName - The name of the target database. +// - parameters - Details of SqlMigrationService resource. +// - options - DatabaseMigrationsSQLMiClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseMigrationsSQLMiClient.BeginCreateOrUpdate +// method. +func (client *DatabaseMigrationsSQLMiClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters DatabaseMigrationSQLMi, options *DatabaseMigrationsSQLMiClientBeginCreateOrUpdateOptions) (*runtime.Poller[DatabaseMigrationsSQLMiClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseMigrationsSQLMiClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabaseMigrationsSQLMiClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create a new database migration to a given SQL Managed Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *DatabaseMigrationsSQLMiClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters DatabaseMigrationSQLMi, options *DatabaseMigrationsSQLMiClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "DatabaseMigrationsSQLMiClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DatabaseMigrationsSQLMiClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters DatabaseMigrationSQLMi, options *DatabaseMigrationsSQLMiClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if targetDbName == "" { + return nil, errors.New("parameter targetDbName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbName}", url.PathEscape(targetDbName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginCutover - Initiate cutover for in-progress online database migration to SQL Managed Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetDbName - The name of the target database. +// - parameters - Required migration operation ID for which cutover will be initiated. +// - options - DatabaseMigrationsSQLMiClientBeginCutoverOptions contains the optional parameters for the DatabaseMigrationsSQLMiClient.BeginCutover +// method. +func (client *DatabaseMigrationsSQLMiClient) BeginCutover(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLMiClientBeginCutoverOptions) (*runtime.Poller[DatabaseMigrationsSQLMiClientCutoverResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.cutover(ctx, resourceGroupName, managedInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseMigrationsSQLMiClientCutoverResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabaseMigrationsSQLMiClientCutoverResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Cutover - Initiate cutover for in-progress online database migration to SQL Managed Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *DatabaseMigrationsSQLMiClient) cutover(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLMiClientBeginCutoverOptions) (*http.Response, error) { + var err error + const operationName = "DatabaseMigrationsSQLMiClient.BeginCutover" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.cutoverCreateRequest(ctx, resourceGroupName, managedInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// cutoverCreateRequest creates the Cutover request. +func (client *DatabaseMigrationsSQLMiClient) cutoverCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLMiClientBeginCutoverOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if targetDbName == "" { + return nil, errors.New("parameter targetDbName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbName}", url.PathEscape(targetDbName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// Get - Retrieve the specified database migration for a given SQL Managed Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetDbName - The name of the target database. +// - options - DatabaseMigrationsSQLMiClientGetOptions contains the optional parameters for the DatabaseMigrationsSQLMiClient.Get +// method. +func (client *DatabaseMigrationsSQLMiClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, options *DatabaseMigrationsSQLMiClientGetOptions) (DatabaseMigrationsSQLMiClientGetResponse, error) { + var err error + const operationName = "DatabaseMigrationsSQLMiClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, targetDbName, options) + if err != nil { + return DatabaseMigrationsSQLMiClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseMigrationsSQLMiClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseMigrationsSQLMiClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DatabaseMigrationsSQLMiClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, options *DatabaseMigrationsSQLMiClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if targetDbName == "" { + return nil, errors.New("parameter targetDbName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbName}", url.PathEscape(targetDbName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + reqQP.Set("api-version", "2023-07-15-preview") + if options != nil && options.MigrationOperationID != nil { + reqQP.Set("migrationOperationId", *options.MigrationOperationID) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DatabaseMigrationsSQLMiClient) getHandleResponse(resp *http.Response) (DatabaseMigrationsSQLMiClientGetResponse, error) { + result := DatabaseMigrationsSQLMiClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseMigrationSQLMi); err != nil { + return DatabaseMigrationsSQLMiClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationssqlvm_client.go b/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationssqlvm_client.go new file mode 100644 index 000000000000..5b5498ff631d --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationssqlvm_client.go @@ -0,0 +1,371 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdatamigration + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DatabaseMigrationsSQLVMClient contains the methods for the DatabaseMigrationsSQLVM group. +// Don't use this type directly, use NewDatabaseMigrationsSQLVMClient() instead. +type DatabaseMigrationsSQLVMClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDatabaseMigrationsSQLVMClient creates a new instance of DatabaseMigrationsSQLVMClient with the specified values. +// - subscriptionID - Subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDatabaseMigrationsSQLVMClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseMigrationsSQLVMClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DatabaseMigrationsSQLVMClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCancel - Stop in-progress database migration to SQL VM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetDbName - The name of the target database. +// - options - DatabaseMigrationsSQLVMClientBeginCancelOptions contains the optional parameters for the DatabaseMigrationsSQLVMClient.BeginCancel +// method. +func (client *DatabaseMigrationsSQLVMClient) BeginCancel(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLVMClientBeginCancelOptions) (*runtime.Poller[DatabaseMigrationsSQLVMClientCancelResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.cancel(ctx, resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseMigrationsSQLVMClientCancelResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabaseMigrationsSQLVMClientCancelResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Cancel - Stop in-progress database migration to SQL VM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *DatabaseMigrationsSQLVMClient) cancel(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLVMClientBeginCancelOptions) (*http.Response, error) { + var err error + const operationName = "DatabaseMigrationsSQLVMClient.BeginCancel" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.cancelCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// cancelCreateRequest creates the Cancel request. +func (client *DatabaseMigrationsSQLVMClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLVMClientBeginCancelOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlVirtualMachineName == "" { + return nil, errors.New("parameter sqlVirtualMachineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlVirtualMachineName}", url.PathEscape(sqlVirtualMachineName)) + if targetDbName == "" { + return nil, errors.New("parameter targetDbName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbName}", url.PathEscape(targetDbName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginCreateOrUpdate - Create a new database migration to a given SQL VM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetDbName - The name of the target database. +// - parameters - Details of SqlMigrationService resource. +// - options - DatabaseMigrationsSQLVMClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseMigrationsSQLVMClient.BeginCreateOrUpdate +// method. +func (client *DatabaseMigrationsSQLVMClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters DatabaseMigrationSQLVM, options *DatabaseMigrationsSQLVMClientBeginCreateOrUpdateOptions) (*runtime.Poller[DatabaseMigrationsSQLVMClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseMigrationsSQLVMClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabaseMigrationsSQLVMClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create a new database migration to a given SQL VM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *DatabaseMigrationsSQLVMClient) createOrUpdate(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters DatabaseMigrationSQLVM, options *DatabaseMigrationsSQLVMClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "DatabaseMigrationsSQLVMClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DatabaseMigrationsSQLVMClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters DatabaseMigrationSQLVM, options *DatabaseMigrationsSQLVMClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlVirtualMachineName == "" { + return nil, errors.New("parameter sqlVirtualMachineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlVirtualMachineName}", url.PathEscape(sqlVirtualMachineName)) + if targetDbName == "" { + return nil, errors.New("parameter targetDbName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbName}", url.PathEscape(targetDbName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginCutover - Initiate cutover for in-progress online database migration to SQL VM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetDbName - The name of the target database. +// - options - DatabaseMigrationsSQLVMClientBeginCutoverOptions contains the optional parameters for the DatabaseMigrationsSQLVMClient.BeginCutover +// method. +func (client *DatabaseMigrationsSQLVMClient) BeginCutover(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLVMClientBeginCutoverOptions) (*runtime.Poller[DatabaseMigrationsSQLVMClientCutoverResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.cutover(ctx, resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseMigrationsSQLVMClientCutoverResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabaseMigrationsSQLVMClientCutoverResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Cutover - Initiate cutover for in-progress online database migration to SQL VM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *DatabaseMigrationsSQLVMClient) cutover(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLVMClientBeginCutoverOptions) (*http.Response, error) { + var err error + const operationName = "DatabaseMigrationsSQLVMClient.BeginCutover" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.cutoverCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// cutoverCreateRequest creates the Cutover request. +func (client *DatabaseMigrationsSQLVMClient) cutoverCreateRequest(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLVMClientBeginCutoverOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlVirtualMachineName == "" { + return nil, errors.New("parameter sqlVirtualMachineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlVirtualMachineName}", url.PathEscape(sqlVirtualMachineName)) + if targetDbName == "" { + return nil, errors.New("parameter targetDbName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbName}", url.PathEscape(targetDbName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// Get - Retrieve the specified database migration for a given SQL VM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - targetDbName - The name of the target database. +// - options - DatabaseMigrationsSQLVMClientGetOptions contains the optional parameters for the DatabaseMigrationsSQLVMClient.Get +// method. +func (client *DatabaseMigrationsSQLVMClient) Get(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, options *DatabaseMigrationsSQLVMClientGetOptions) (DatabaseMigrationsSQLVMClientGetResponse, error) { + var err error + const operationName = "DatabaseMigrationsSQLVMClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, targetDbName, options) + if err != nil { + return DatabaseMigrationsSQLVMClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseMigrationsSQLVMClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseMigrationsSQLVMClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DatabaseMigrationsSQLVMClient) getCreateRequest(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, options *DatabaseMigrationsSQLVMClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlVirtualMachineName == "" { + return nil, errors.New("parameter sqlVirtualMachineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlVirtualMachineName}", url.PathEscape(sqlVirtualMachineName)) + if targetDbName == "" { + return nil, errors.New("parameter targetDbName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbName}", url.PathEscape(targetDbName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + reqQP.Set("api-version", "2023-07-15-preview") + if options != nil && options.MigrationOperationID != nil { + reqQP.Set("migrationOperationId", *options.MigrationOperationID) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DatabaseMigrationsSQLVMClient) getHandleResponse(resp *http.Response) (DatabaseMigrationsSQLVMClientGetResponse, error) { + result := DatabaseMigrationsSQLVMClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseMigrationSQLVM); err != nil { + return DatabaseMigrationsSQLVMClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationsmongotocosmosdbrumongo_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationsmongotocosmosdbrumongo_server.go new file mode 100644 index 000000000000..9354486f4d23 --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationsmongotocosmosdbrumongo_server.go @@ -0,0 +1,288 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// DatabaseMigrationsMongoToCosmosDbRUMongoServer is a fake server for instances of the armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClient type. +type DatabaseMigrationsMongoToCosmosDbRUMongoServer struct { + // BeginCreate is the fake for method DatabaseMigrationsMongoToCosmosDbRUMongoClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreate func(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, parameters armdatamigration.DatabaseMigrationCosmosDbMongo, options *armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginCreateOptions) (resp azfake.PollerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientCreateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method DatabaseMigrationsMongoToCosmosDbRUMongoClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, options *armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginDeleteOptions) (resp azfake.PollerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method DatabaseMigrationsMongoToCosmosDbRUMongoClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, options *armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientGetOptions) (resp azfake.Responder[armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientGetResponse], errResp azfake.ErrorResponder) + + // NewGetForScopePager is the fake for method DatabaseMigrationsMongoToCosmosDbRUMongoClient.NewGetForScopePager + // HTTP status codes to indicate success: http.StatusOK + NewGetForScopePager func(resourceGroupName string, targetResourceName string, options *armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeOptions) (resp azfake.PagerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse]) +} + +// NewDatabaseMigrationsMongoToCosmosDbRUMongoServerTransport creates a new instance of DatabaseMigrationsMongoToCosmosDbRUMongoServerTransport with the provided implementation. +// The returned DatabaseMigrationsMongoToCosmosDbRUMongoServerTransport instance is connected to an instance of armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewDatabaseMigrationsMongoToCosmosDbRUMongoServerTransport(srv *DatabaseMigrationsMongoToCosmosDbRUMongoServer) *DatabaseMigrationsMongoToCosmosDbRUMongoServerTransport { + return &DatabaseMigrationsMongoToCosmosDbRUMongoServerTransport{ + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientDeleteResponse]](), + newGetForScopePager: newTracker[azfake.PagerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse]](), + } +} + +// DatabaseMigrationsMongoToCosmosDbRUMongoServerTransport connects instances of armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClient to instances of DatabaseMigrationsMongoToCosmosDbRUMongoServer. +// Don't use this type directly, use NewDatabaseMigrationsMongoToCosmosDbRUMongoServerTransport instead. +type DatabaseMigrationsMongoToCosmosDbRUMongoServerTransport struct { + srv *DatabaseMigrationsMongoToCosmosDbRUMongoServer + beginCreate *tracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientDeleteResponse]] + newGetForScopePager *tracker[azfake.PagerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse]] +} + +// Do implements the policy.Transporter interface for DatabaseMigrationsMongoToCosmosDbRUMongoServerTransport. +func (d *DatabaseMigrationsMongoToCosmosDbRUMongoServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "DatabaseMigrationsMongoToCosmosDbRUMongoClient.BeginCreate": + resp, err = d.dispatchBeginCreate(req) + case "DatabaseMigrationsMongoToCosmosDbRUMongoClient.BeginDelete": + resp, err = d.dispatchBeginDelete(req) + case "DatabaseMigrationsMongoToCosmosDbRUMongoClient.Get": + resp, err = d.dispatchGet(req) + case "DatabaseMigrationsMongoToCosmosDbRUMongoClient.NewGetForScopePager": + resp, err = d.dispatchNewGetForScopePager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (d *DatabaseMigrationsMongoToCosmosDbRUMongoServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { + if d.srv.BeginCreate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} + } + beginCreate := d.beginCreate.get(req) + if beginCreate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.DatabaseMigrationCosmosDbMongo](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + targetResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetResourceName")]) + if err != nil { + return nil, err + } + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.BeginCreate(req.Context(), resourceGroupNameParam, targetResourceNameParam, migrationNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreate = &respr + d.beginCreate.add(req, beginCreate) + } + + resp, err := server.PollerResponderNext(beginCreate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + d.beginCreate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreate) { + d.beginCreate.remove(req) + } + + return resp, nil +} + +func (d *DatabaseMigrationsMongoToCosmosDbRUMongoServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if d.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := d.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + targetResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetResourceName")]) + if err != nil { + return nil, err + } + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + if err != nil { + return nil, err + } + forceUnescaped, err := url.QueryUnescape(qp.Get("force")) + if err != nil { + return nil, err + } + forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + if err != nil { + return nil, err + } + var options *armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginDeleteOptions + if forceParam != nil { + options = &armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginDeleteOptions{ + Force: forceParam, + } + } + respr, errRespr := d.srv.BeginDelete(req.Context(), resourceGroupNameParam, targetResourceNameParam, migrationNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + d.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + d.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + d.beginDelete.remove(req) + } + + return resp, nil +} + +func (d *DatabaseMigrationsMongoToCosmosDbRUMongoServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if d.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + targetResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetResourceName")]) + if err != nil { + return nil, err + } + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, targetResourceNameParam, migrationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DatabaseMigrationCosmosDbMongo, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DatabaseMigrationsMongoToCosmosDbRUMongoServerTransport) dispatchNewGetForScopePager(req *http.Request) (*http.Response, error) { + if d.srv.NewGetForScopePager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewGetForScopePager not implemented")} + } + newGetForScopePager := d.newGetForScopePager.get(req) + if newGetForScopePager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + targetResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetResourceName")]) + if err != nil { + return nil, err + } + resp := d.srv.NewGetForScopePager(resourceGroupNameParam, targetResourceNameParam, nil) + newGetForScopePager = &resp + d.newGetForScopePager.add(req, newGetForScopePager) + server.PagerResponderInjectNextLinks(newGetForScopePager, req, func(page *armdatamigration.DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newGetForScopePager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newGetForScopePager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newGetForScopePager) { + d.newGetForScopePager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationsmongotocosmosdbvcoremongo_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationsmongotocosmosdbvcoremongo_server.go new file mode 100644 index 000000000000..6fbd34aadbc1 --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationsmongotocosmosdbvcoremongo_server.go @@ -0,0 +1,288 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// DatabaseMigrationsMongoToCosmosDbvCoreMongoServer is a fake server for instances of the armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClient type. +type DatabaseMigrationsMongoToCosmosDbvCoreMongoServer struct { + // BeginCreate is the fake for method DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreate func(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, parameters armdatamigration.DatabaseMigrationCosmosDbMongo, options *armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginCreateOptions) (resp azfake.PollerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientCreateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, options *armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginDeleteOptions) (resp azfake.PollerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, targetResourceName string, migrationName string, options *armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetOptions) (resp azfake.Responder[armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetResponse], errResp azfake.ErrorResponder) + + // NewGetForScopePager is the fake for method DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.NewGetForScopePager + // HTTP status codes to indicate success: http.StatusOK + NewGetForScopePager func(resourceGroupName string, targetResourceName string, options *armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeOptions) (resp azfake.PagerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse]) +} + +// NewDatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport creates a new instance of DatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport with the provided implementation. +// The returned DatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport instance is connected to an instance of armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewDatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport(srv *DatabaseMigrationsMongoToCosmosDbvCoreMongoServer) *DatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport { + return &DatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport{ + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientDeleteResponse]](), + newGetForScopePager: newTracker[azfake.PagerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse]](), + } +} + +// DatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport connects instances of armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClient to instances of DatabaseMigrationsMongoToCosmosDbvCoreMongoServer. +// Don't use this type directly, use NewDatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport instead. +type DatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport struct { + srv *DatabaseMigrationsMongoToCosmosDbvCoreMongoServer + beginCreate *tracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientDeleteResponse]] + newGetForScopePager *tracker[azfake.PagerResponder[armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse]] +} + +// Do implements the policy.Transporter interface for DatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport. +func (d *DatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.BeginCreate": + resp, err = d.dispatchBeginCreate(req) + case "DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.BeginDelete": + resp, err = d.dispatchBeginDelete(req) + case "DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.Get": + resp, err = d.dispatchGet(req) + case "DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.NewGetForScopePager": + resp, err = d.dispatchNewGetForScopePager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (d *DatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { + if d.srv.BeginCreate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} + } + beginCreate := d.beginCreate.get(req) + if beginCreate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.DatabaseMigrationCosmosDbMongo](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + targetResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetResourceName")]) + if err != nil { + return nil, err + } + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.BeginCreate(req.Context(), resourceGroupNameParam, targetResourceNameParam, migrationNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreate = &respr + d.beginCreate.add(req, beginCreate) + } + + resp, err := server.PollerResponderNext(beginCreate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + d.beginCreate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreate) { + d.beginCreate.remove(req) + } + + return resp, nil +} + +func (d *DatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if d.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := d.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + targetResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetResourceName")]) + if err != nil { + return nil, err + } + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + if err != nil { + return nil, err + } + forceUnescaped, err := url.QueryUnescape(qp.Get("force")) + if err != nil { + return nil, err + } + forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + if err != nil { + return nil, err + } + var options *armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginDeleteOptions + if forceParam != nil { + options = &armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginDeleteOptions{ + Force: forceParam, + } + } + respr, errRespr := d.srv.BeginDelete(req.Context(), resourceGroupNameParam, targetResourceNameParam, migrationNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + d.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + d.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + d.beginDelete.remove(req) + } + + return resp, nil +} + +func (d *DatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if d.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + targetResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetResourceName")]) + if err != nil { + return nil, err + } + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, targetResourceNameParam, migrationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DatabaseMigrationCosmosDbMongo, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport) dispatchNewGetForScopePager(req *http.Request) (*http.Response, error) { + if d.srv.NewGetForScopePager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewGetForScopePager not implemented")} + } + newGetForScopePager := d.newGetForScopePager.get(req) + if newGetForScopePager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + targetResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetResourceName")]) + if err != nil { + return nil, err + } + resp := d.srv.NewGetForScopePager(resourceGroupNameParam, targetResourceNameParam, nil) + newGetForScopePager = &resp + d.newGetForScopePager.add(req, newGetForScopePager) + server.PagerResponderInjectNextLinks(newGetForScopePager, req, func(page *armdatamigration.DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newGetForScopePager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newGetForScopePager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newGetForScopePager) { + d.newGetForScopePager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationssqldb_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationssqldb_server.go new file mode 100644 index 000000000000..98bd985acb24 --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationssqldb_server.go @@ -0,0 +1,316 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// DatabaseMigrationsSQLDbServer is a fake server for instances of the armdatamigration.DatabaseMigrationsSQLDbClient type. +type DatabaseMigrationsSQLDbServer struct { + // BeginCancel is the fake for method DatabaseMigrationsSQLDbClient.BeginCancel + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCancel func(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, parameters armdatamigration.MigrationOperationInput, options *armdatamigration.DatabaseMigrationsSQLDbClientBeginCancelOptions) (resp azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLDbClientCancelResponse], errResp azfake.ErrorResponder) + + // BeginCreateOrUpdate is the fake for method DatabaseMigrationsSQLDbClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, parameters armdatamigration.DatabaseMigrationSQLDb, options *armdatamigration.DatabaseMigrationsSQLDbClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLDbClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method DatabaseMigrationsSQLDbClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, options *armdatamigration.DatabaseMigrationsSQLDbClientBeginDeleteOptions) (resp azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLDbClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method DatabaseMigrationsSQLDbClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, options *armdatamigration.DatabaseMigrationsSQLDbClientGetOptions) (resp azfake.Responder[armdatamigration.DatabaseMigrationsSQLDbClientGetResponse], errResp azfake.ErrorResponder) +} + +// NewDatabaseMigrationsSQLDbServerTransport creates a new instance of DatabaseMigrationsSQLDbServerTransport with the provided implementation. +// The returned DatabaseMigrationsSQLDbServerTransport instance is connected to an instance of armdatamigration.DatabaseMigrationsSQLDbClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewDatabaseMigrationsSQLDbServerTransport(srv *DatabaseMigrationsSQLDbServer) *DatabaseMigrationsSQLDbServerTransport { + return &DatabaseMigrationsSQLDbServerTransport{ + srv: srv, + beginCancel: newTracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLDbClientCancelResponse]](), + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLDbClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLDbClientDeleteResponse]](), + } +} + +// DatabaseMigrationsSQLDbServerTransport connects instances of armdatamigration.DatabaseMigrationsSQLDbClient to instances of DatabaseMigrationsSQLDbServer. +// Don't use this type directly, use NewDatabaseMigrationsSQLDbServerTransport instead. +type DatabaseMigrationsSQLDbServerTransport struct { + srv *DatabaseMigrationsSQLDbServer + beginCancel *tracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLDbClientCancelResponse]] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLDbClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLDbClientDeleteResponse]] +} + +// Do implements the policy.Transporter interface for DatabaseMigrationsSQLDbServerTransport. +func (d *DatabaseMigrationsSQLDbServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "DatabaseMigrationsSQLDbClient.BeginCancel": + resp, err = d.dispatchBeginCancel(req) + case "DatabaseMigrationsSQLDbClient.BeginCreateOrUpdate": + resp, err = d.dispatchBeginCreateOrUpdate(req) + case "DatabaseMigrationsSQLDbClient.BeginDelete": + resp, err = d.dispatchBeginDelete(req) + case "DatabaseMigrationsSQLDbClient.Get": + resp, err = d.dispatchGet(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (d *DatabaseMigrationsSQLDbServerTransport) dispatchBeginCancel(req *http.Request) (*http.Response, error) { + if d.srv.BeginCancel == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCancel not implemented")} + } + beginCancel := d.beginCancel.get(req) + if beginCancel == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Sql/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancel` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.MigrationOperationInput](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlDbInstanceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlDbInstanceName")]) + if err != nil { + return nil, err + } + targetDbNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.BeginCancel(req.Context(), resourceGroupNameParam, sqlDbInstanceNameParam, targetDbNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCancel = &respr + d.beginCancel.add(req, beginCancel) + } + + resp, err := server.PollerResponderNext(beginCancel, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginCancel.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCancel) { + d.beginCancel.remove(req) + } + + return resp, nil +} + +func (d *DatabaseMigrationsSQLDbServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if d.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := d.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Sql/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.DatabaseMigrationSQLDb](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlDbInstanceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlDbInstanceName")]) + if err != nil { + return nil, err + } + targetDbNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, sqlDbInstanceNameParam, targetDbNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + d.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + d.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + d.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (d *DatabaseMigrationsSQLDbServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if d.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := d.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Sql/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlDbInstanceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlDbInstanceName")]) + if err != nil { + return nil, err + } + targetDbNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbName")]) + if err != nil { + return nil, err + } + forceUnescaped, err := url.QueryUnescape(qp.Get("force")) + if err != nil { + return nil, err + } + forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + if err != nil { + return nil, err + } + var options *armdatamigration.DatabaseMigrationsSQLDbClientBeginDeleteOptions + if forceParam != nil { + options = &armdatamigration.DatabaseMigrationsSQLDbClientBeginDeleteOptions{ + Force: forceParam, + } + } + respr, errRespr := d.srv.BeginDelete(req.Context(), resourceGroupNameParam, sqlDbInstanceNameParam, targetDbNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + d.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + d.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + d.beginDelete.remove(req) + } + + return resp, nil +} + +func (d *DatabaseMigrationsSQLDbServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if d.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Sql/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlDbInstanceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlDbInstanceName")]) + if err != nil { + return nil, err + } + targetDbNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbName")]) + if err != nil { + return nil, err + } + migrationOperationIDUnescaped, err := url.QueryUnescape(qp.Get("migrationOperationId")) + if err != nil { + return nil, err + } + migrationOperationIDParam := getOptional(migrationOperationIDUnescaped) + expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) + if err != nil { + return nil, err + } + expandParam := getOptional(expandUnescaped) + var options *armdatamigration.DatabaseMigrationsSQLDbClientGetOptions + if migrationOperationIDParam != nil || expandParam != nil { + options = &armdatamigration.DatabaseMigrationsSQLDbClientGetOptions{ + MigrationOperationID: migrationOperationIDParam, + Expand: expandParam, + } + } + respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, sqlDbInstanceNameParam, targetDbNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DatabaseMigrationSQLDb, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationssqlmi_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationssqlmi_server.go new file mode 100644 index 000000000000..416348e52494 --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationssqlmi_server.go @@ -0,0 +1,304 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" + "net/http" + "net/url" + "regexp" +) + +// DatabaseMigrationsSQLMiServer is a fake server for instances of the armdatamigration.DatabaseMigrationsSQLMiClient type. +type DatabaseMigrationsSQLMiServer struct { + // BeginCancel is the fake for method DatabaseMigrationsSQLMiClient.BeginCancel + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCancel func(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters armdatamigration.MigrationOperationInput, options *armdatamigration.DatabaseMigrationsSQLMiClientBeginCancelOptions) (resp azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLMiClientCancelResponse], errResp azfake.ErrorResponder) + + // BeginCreateOrUpdate is the fake for method DatabaseMigrationsSQLMiClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters armdatamigration.DatabaseMigrationSQLMi, options *armdatamigration.DatabaseMigrationsSQLMiClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLMiClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginCutover is the fake for method DatabaseMigrationsSQLMiClient.BeginCutover + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCutover func(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters armdatamigration.MigrationOperationInput, options *armdatamigration.DatabaseMigrationsSQLMiClientBeginCutoverOptions) (resp azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLMiClientCutoverResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method DatabaseMigrationsSQLMiClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, options *armdatamigration.DatabaseMigrationsSQLMiClientGetOptions) (resp azfake.Responder[armdatamigration.DatabaseMigrationsSQLMiClientGetResponse], errResp azfake.ErrorResponder) +} + +// NewDatabaseMigrationsSQLMiServerTransport creates a new instance of DatabaseMigrationsSQLMiServerTransport with the provided implementation. +// The returned DatabaseMigrationsSQLMiServerTransport instance is connected to an instance of armdatamigration.DatabaseMigrationsSQLMiClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewDatabaseMigrationsSQLMiServerTransport(srv *DatabaseMigrationsSQLMiServer) *DatabaseMigrationsSQLMiServerTransport { + return &DatabaseMigrationsSQLMiServerTransport{ + srv: srv, + beginCancel: newTracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLMiClientCancelResponse]](), + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLMiClientCreateOrUpdateResponse]](), + beginCutover: newTracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLMiClientCutoverResponse]](), + } +} + +// DatabaseMigrationsSQLMiServerTransport connects instances of armdatamigration.DatabaseMigrationsSQLMiClient to instances of DatabaseMigrationsSQLMiServer. +// Don't use this type directly, use NewDatabaseMigrationsSQLMiServerTransport instead. +type DatabaseMigrationsSQLMiServerTransport struct { + srv *DatabaseMigrationsSQLMiServer + beginCancel *tracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLMiClientCancelResponse]] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLMiClientCreateOrUpdateResponse]] + beginCutover *tracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLMiClientCutoverResponse]] +} + +// Do implements the policy.Transporter interface for DatabaseMigrationsSQLMiServerTransport. +func (d *DatabaseMigrationsSQLMiServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "DatabaseMigrationsSQLMiClient.BeginCancel": + resp, err = d.dispatchBeginCancel(req) + case "DatabaseMigrationsSQLMiClient.BeginCreateOrUpdate": + resp, err = d.dispatchBeginCreateOrUpdate(req) + case "DatabaseMigrationsSQLMiClient.BeginCutover": + resp, err = d.dispatchBeginCutover(req) + case "DatabaseMigrationsSQLMiClient.Get": + resp, err = d.dispatchGet(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (d *DatabaseMigrationsSQLMiServerTransport) dispatchBeginCancel(req *http.Request) (*http.Response, error) { + if d.srv.BeginCancel == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCancel not implemented")} + } + beginCancel := d.beginCancel.get(req) + if beginCancel == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Sql/managedInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancel` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.MigrationOperationInput](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + managedInstanceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("managedInstanceName")]) + if err != nil { + return nil, err + } + targetDbNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.BeginCancel(req.Context(), resourceGroupNameParam, managedInstanceNameParam, targetDbNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCancel = &respr + d.beginCancel.add(req, beginCancel) + } + + resp, err := server.PollerResponderNext(beginCancel, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginCancel.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCancel) { + d.beginCancel.remove(req) + } + + return resp, nil +} + +func (d *DatabaseMigrationsSQLMiServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if d.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := d.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Sql/managedInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.DatabaseMigrationSQLMi](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + managedInstanceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("managedInstanceName")]) + if err != nil { + return nil, err + } + targetDbNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, managedInstanceNameParam, targetDbNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + d.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + d.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + d.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (d *DatabaseMigrationsSQLMiServerTransport) dispatchBeginCutover(req *http.Request) (*http.Response, error) { + if d.srv.BeginCutover == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCutover not implemented")} + } + beginCutover := d.beginCutover.get(req) + if beginCutover == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Sql/managedInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cutover` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.MigrationOperationInput](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + managedInstanceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("managedInstanceName")]) + if err != nil { + return nil, err + } + targetDbNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.BeginCutover(req.Context(), resourceGroupNameParam, managedInstanceNameParam, targetDbNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCutover = &respr + d.beginCutover.add(req, beginCutover) + } + + resp, err := server.PollerResponderNext(beginCutover, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginCutover.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCutover) { + d.beginCutover.remove(req) + } + + return resp, nil +} + +func (d *DatabaseMigrationsSQLMiServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if d.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Sql/managedInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + managedInstanceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("managedInstanceName")]) + if err != nil { + return nil, err + } + targetDbNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbName")]) + if err != nil { + return nil, err + } + migrationOperationIDUnescaped, err := url.QueryUnescape(qp.Get("migrationOperationId")) + if err != nil { + return nil, err + } + migrationOperationIDParam := getOptional(migrationOperationIDUnescaped) + expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) + if err != nil { + return nil, err + } + expandParam := getOptional(expandUnescaped) + var options *armdatamigration.DatabaseMigrationsSQLMiClientGetOptions + if migrationOperationIDParam != nil || expandParam != nil { + options = &armdatamigration.DatabaseMigrationsSQLMiClientGetOptions{ + MigrationOperationID: migrationOperationIDParam, + Expand: expandParam, + } + } + respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, managedInstanceNameParam, targetDbNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DatabaseMigrationSQLMi, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationssqlvm_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationssqlvm_server.go new file mode 100644 index 000000000000..7eb66de809bc --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/databasemigrationssqlvm_server.go @@ -0,0 +1,304 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" + "net/http" + "net/url" + "regexp" +) + +// DatabaseMigrationsSQLVMServer is a fake server for instances of the armdatamigration.DatabaseMigrationsSQLVMClient type. +type DatabaseMigrationsSQLVMServer struct { + // BeginCancel is the fake for method DatabaseMigrationsSQLVMClient.BeginCancel + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCancel func(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters armdatamigration.MigrationOperationInput, options *armdatamigration.DatabaseMigrationsSQLVMClientBeginCancelOptions) (resp azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLVMClientCancelResponse], errResp azfake.ErrorResponder) + + // BeginCreateOrUpdate is the fake for method DatabaseMigrationsSQLVMClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters armdatamigration.DatabaseMigrationSQLVM, options *armdatamigration.DatabaseMigrationsSQLVMClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLVMClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginCutover is the fake for method DatabaseMigrationsSQLVMClient.BeginCutover + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCutover func(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters armdatamigration.MigrationOperationInput, options *armdatamigration.DatabaseMigrationsSQLVMClientBeginCutoverOptions) (resp azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLVMClientCutoverResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method DatabaseMigrationsSQLVMClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, options *armdatamigration.DatabaseMigrationsSQLVMClientGetOptions) (resp azfake.Responder[armdatamigration.DatabaseMigrationsSQLVMClientGetResponse], errResp azfake.ErrorResponder) +} + +// NewDatabaseMigrationsSQLVMServerTransport creates a new instance of DatabaseMigrationsSQLVMServerTransport with the provided implementation. +// The returned DatabaseMigrationsSQLVMServerTransport instance is connected to an instance of armdatamigration.DatabaseMigrationsSQLVMClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewDatabaseMigrationsSQLVMServerTransport(srv *DatabaseMigrationsSQLVMServer) *DatabaseMigrationsSQLVMServerTransport { + return &DatabaseMigrationsSQLVMServerTransport{ + srv: srv, + beginCancel: newTracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLVMClientCancelResponse]](), + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLVMClientCreateOrUpdateResponse]](), + beginCutover: newTracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLVMClientCutoverResponse]](), + } +} + +// DatabaseMigrationsSQLVMServerTransport connects instances of armdatamigration.DatabaseMigrationsSQLVMClient to instances of DatabaseMigrationsSQLVMServer. +// Don't use this type directly, use NewDatabaseMigrationsSQLVMServerTransport instead. +type DatabaseMigrationsSQLVMServerTransport struct { + srv *DatabaseMigrationsSQLVMServer + beginCancel *tracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLVMClientCancelResponse]] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLVMClientCreateOrUpdateResponse]] + beginCutover *tracker[azfake.PollerResponder[armdatamigration.DatabaseMigrationsSQLVMClientCutoverResponse]] +} + +// Do implements the policy.Transporter interface for DatabaseMigrationsSQLVMServerTransport. +func (d *DatabaseMigrationsSQLVMServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "DatabaseMigrationsSQLVMClient.BeginCancel": + resp, err = d.dispatchBeginCancel(req) + case "DatabaseMigrationsSQLVMClient.BeginCreateOrUpdate": + resp, err = d.dispatchBeginCreateOrUpdate(req) + case "DatabaseMigrationsSQLVMClient.BeginCutover": + resp, err = d.dispatchBeginCutover(req) + case "DatabaseMigrationsSQLVMClient.Get": + resp, err = d.dispatchGet(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (d *DatabaseMigrationsSQLVMServerTransport) dispatchBeginCancel(req *http.Request) (*http.Response, error) { + if d.srv.BeginCancel == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCancel not implemented")} + } + beginCancel := d.beginCancel.get(req) + if beginCancel == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.SqlVirtualMachine/sqlVirtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancel` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.MigrationOperationInput](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlVirtualMachineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlVirtualMachineName")]) + if err != nil { + return nil, err + } + targetDbNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.BeginCancel(req.Context(), resourceGroupNameParam, sqlVirtualMachineNameParam, targetDbNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCancel = &respr + d.beginCancel.add(req, beginCancel) + } + + resp, err := server.PollerResponderNext(beginCancel, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginCancel.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCancel) { + d.beginCancel.remove(req) + } + + return resp, nil +} + +func (d *DatabaseMigrationsSQLVMServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if d.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := d.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.SqlVirtualMachine/sqlVirtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.DatabaseMigrationSQLVM](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlVirtualMachineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlVirtualMachineName")]) + if err != nil { + return nil, err + } + targetDbNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, sqlVirtualMachineNameParam, targetDbNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + d.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + d.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + d.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (d *DatabaseMigrationsSQLVMServerTransport) dispatchBeginCutover(req *http.Request) (*http.Response, error) { + if d.srv.BeginCutover == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCutover not implemented")} + } + beginCutover := d.beginCutover.get(req) + if beginCutover == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.SqlVirtualMachine/sqlVirtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cutover` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.MigrationOperationInput](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlVirtualMachineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlVirtualMachineName")]) + if err != nil { + return nil, err + } + targetDbNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.BeginCutover(req.Context(), resourceGroupNameParam, sqlVirtualMachineNameParam, targetDbNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCutover = &respr + d.beginCutover.add(req, beginCutover) + } + + resp, err := server.PollerResponderNext(beginCutover, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginCutover.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCutover) { + d.beginCutover.remove(req) + } + + return resp, nil +} + +func (d *DatabaseMigrationsSQLVMServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if d.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.SqlVirtualMachine/sqlVirtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/databaseMigrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlVirtualMachineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlVirtualMachineName")]) + if err != nil { + return nil, err + } + targetDbNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbName")]) + if err != nil { + return nil, err + } + migrationOperationIDUnescaped, err := url.QueryUnescape(qp.Get("migrationOperationId")) + if err != nil { + return nil, err + } + migrationOperationIDParam := getOptional(migrationOperationIDUnescaped) + expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) + if err != nil { + return nil, err + } + expandParam := getOptional(expandUnescaped) + var options *armdatamigration.DatabaseMigrationsSQLVMClientGetOptions + if migrationOperationIDParam != nil || expandParam != nil { + options = &armdatamigration.DatabaseMigrationsSQLVMClientGetOptions{ + MigrationOperationID: migrationOperationIDParam, + Expand: expandParam, + } + } + respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, sqlVirtualMachineNameParam, targetDbNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DatabaseMigrationSQLVM, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/files_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/files_server.go index 2d1a84ca8597..e2af0747c04d 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/fake/files_server.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/files_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/migrationservices_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/migrationservices_server.go new file mode 100644 index 000000000000..09c2146bdd4d --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/migrationservices_server.go @@ -0,0 +1,402 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" + "net/http" + "net/url" + "regexp" +) + +// MigrationServicesServer is a fake server for instances of the armdatamigration.MigrationServicesClient type. +type MigrationServicesServer struct { + // BeginCreateOrUpdate is the fake for method MigrationServicesClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, migrationServiceName string, parameters armdatamigration.MigrationService, options *armdatamigration.MigrationServicesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdatamigration.MigrationServicesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method MigrationServicesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, migrationServiceName string, options *armdatamigration.MigrationServicesClientBeginDeleteOptions) (resp azfake.PollerResponder[armdatamigration.MigrationServicesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method MigrationServicesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, migrationServiceName string, options *armdatamigration.MigrationServicesClientGetOptions) (resp azfake.Responder[armdatamigration.MigrationServicesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByResourceGroupPager is the fake for method MigrationServicesClient.NewListByResourceGroupPager + // HTTP status codes to indicate success: http.StatusOK + NewListByResourceGroupPager func(resourceGroupName string, options *armdatamigration.MigrationServicesClientListByResourceGroupOptions) (resp azfake.PagerResponder[armdatamigration.MigrationServicesClientListByResourceGroupResponse]) + + // NewListBySubscriptionPager is the fake for method MigrationServicesClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armdatamigration.MigrationServicesClientListBySubscriptionOptions) (resp azfake.PagerResponder[armdatamigration.MigrationServicesClientListBySubscriptionResponse]) + + // NewListMigrationsPager is the fake for method MigrationServicesClient.NewListMigrationsPager + // HTTP status codes to indicate success: http.StatusOK + NewListMigrationsPager func(resourceGroupName string, migrationServiceName string, options *armdatamigration.MigrationServicesClientListMigrationsOptions) (resp azfake.PagerResponder[armdatamigration.MigrationServicesClientListMigrationsResponse]) + + // BeginUpdate is the fake for method MigrationServicesClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, migrationServiceName string, parameters armdatamigration.MigrationServiceUpdate, options *armdatamigration.MigrationServicesClientBeginUpdateOptions) (resp azfake.PollerResponder[armdatamigration.MigrationServicesClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewMigrationServicesServerTransport creates a new instance of MigrationServicesServerTransport with the provided implementation. +// The returned MigrationServicesServerTransport instance is connected to an instance of armdatamigration.MigrationServicesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewMigrationServicesServerTransport(srv *MigrationServicesServer) *MigrationServicesServerTransport { + return &MigrationServicesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdatamigration.MigrationServicesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armdatamigration.MigrationServicesClientDeleteResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armdatamigration.MigrationServicesClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armdatamigration.MigrationServicesClientListBySubscriptionResponse]](), + newListMigrationsPager: newTracker[azfake.PagerResponder[armdatamigration.MigrationServicesClientListMigrationsResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armdatamigration.MigrationServicesClientUpdateResponse]](), + } +} + +// MigrationServicesServerTransport connects instances of armdatamigration.MigrationServicesClient to instances of MigrationServicesServer. +// Don't use this type directly, use NewMigrationServicesServerTransport instead. +type MigrationServicesServerTransport struct { + srv *MigrationServicesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armdatamigration.MigrationServicesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armdatamigration.MigrationServicesClientDeleteResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armdatamigration.MigrationServicesClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armdatamigration.MigrationServicesClientListBySubscriptionResponse]] + newListMigrationsPager *tracker[azfake.PagerResponder[armdatamigration.MigrationServicesClientListMigrationsResponse]] + beginUpdate *tracker[azfake.PollerResponder[armdatamigration.MigrationServicesClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for MigrationServicesServerTransport. +func (m *MigrationServicesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "MigrationServicesClient.BeginCreateOrUpdate": + resp, err = m.dispatchBeginCreateOrUpdate(req) + case "MigrationServicesClient.BeginDelete": + resp, err = m.dispatchBeginDelete(req) + case "MigrationServicesClient.Get": + resp, err = m.dispatchGet(req) + case "MigrationServicesClient.NewListByResourceGroupPager": + resp, err = m.dispatchNewListByResourceGroupPager(req) + case "MigrationServicesClient.NewListBySubscriptionPager": + resp, err = m.dispatchNewListBySubscriptionPager(req) + case "MigrationServicesClient.NewListMigrationsPager": + resp, err = m.dispatchNewListMigrationsPager(req) + case "MigrationServicesClient.BeginUpdate": + resp, err = m.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (m *MigrationServicesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if m.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := m.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/migrationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.MigrationService](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + migrationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, migrationServiceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + m.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + m.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + m.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (m *MigrationServicesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if m.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := m.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/migrationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + migrationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.BeginDelete(req.Context(), resourceGroupNameParam, migrationServiceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + m.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + m.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + m.beginDelete.remove(req) + } + + return resp, nil +} + +func (m *MigrationServicesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if m.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/migrationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + migrationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameParam, migrationServiceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MigrationService, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *MigrationServicesServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListByResourceGroupPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} + } + newListByResourceGroupPager := m.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/migrationServices` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resp := m.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) + newListByResourceGroupPager = &resp + m.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armdatamigration.MigrationServicesClientListByResourceGroupResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListByResourceGroupPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByResourceGroupPager) { + m.newListByResourceGroupPager.remove(req) + } + return resp, nil +} + +func (m *MigrationServicesServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := m.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/migrationServices` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resp := m.srv.NewListBySubscriptionPager(nil) + newListBySubscriptionPager = &resp + m.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armdatamigration.MigrationServicesClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListBySubscriptionPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + m.newListBySubscriptionPager.remove(req) + } + return resp, nil +} + +func (m *MigrationServicesServerTransport) dispatchNewListMigrationsPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListMigrationsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListMigrationsPager not implemented")} + } + newListMigrationsPager := m.newListMigrationsPager.get(req) + if newListMigrationsPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/migrationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listMigrations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + migrationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationServiceName")]) + if err != nil { + return nil, err + } + resp := m.srv.NewListMigrationsPager(resourceGroupNameParam, migrationServiceNameParam, nil) + newListMigrationsPager = &resp + m.newListMigrationsPager.add(req, newListMigrationsPager) + server.PagerResponderInjectNextLinks(newListMigrationsPager, req, func(page *armdatamigration.MigrationServicesClientListMigrationsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListMigrationsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListMigrationsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListMigrationsPager) { + m.newListMigrationsPager.remove(req) + } + return resp, nil +} + +func (m *MigrationServicesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if m.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := m.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/migrationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.MigrationServiceUpdate](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + migrationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.BeginUpdate(req.Context(), resourceGroupNameParam, migrationServiceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + m.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + m.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + m.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/operations_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/operations_server.go index 40ad054a106c..ab23044faf41 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/fake/operations_server.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/operations_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" "net/http" ) diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/polymorphic_helpers.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/polymorphic_helpers.go index c1ab05b525de..39b11475eb03 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/fake/polymorphic_helpers.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/polymorphic_helpers.go @@ -10,11 +10,11 @@ package fake import ( "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" ) func unmarshalCommandPropertiesClassification(rawMsg json.RawMessage) (armdatamigration.CommandPropertiesClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -23,15 +23,15 @@ func unmarshalCommandPropertiesClassification(rawMsg json.RawMessage) (armdatami } var b armdatamigration.CommandPropertiesClassification switch m["commandType"] { - case "Migrate.SqlServer.AzureDbSqlMi.Complete": + case string(armdatamigration.CommandTypeMigrateSQLServerAzureDbSQLMiComplete): b = &armdatamigration.MigrateMISyncCompleteCommandProperties{} - case "Migrate.Sync.Complete.Database": + case string(armdatamigration.CommandTypeMigrateSyncCompleteDatabase): b = &armdatamigration.MigrateSyncCompleteCommandProperties{} - case "cancel": + case string(armdatamigration.CommandTypeCancel): b = &armdatamigration.MongoDbCancelCommand{} - case "finish": + case string(armdatamigration.CommandTypeFinish): b = &armdatamigration.MongoDbFinishCommand{} - case "restart": + case string(armdatamigration.CommandTypeRestart): b = &armdatamigration.MongoDbRestartCommand{} default: b = &armdatamigration.CommandProperties{} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/projects_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/projects_server.go index f65d06f18947..9eb0d3297b3c 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/fake/projects_server.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/projects_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/resourceskus_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/resourceskus_server.go index 7b1ce35116c2..42441de8736a 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/fake/resourceskus_server.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/resourceskus_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" "net/http" "regexp" ) diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/server_factory.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/server_factory.go index ffc16267db3f..26eae0249d32 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/fake/server_factory.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/server_factory.go @@ -19,14 +19,21 @@ import ( // ServerFactory is a fake server for instances of the armdatamigration.ClientFactory type. type ServerFactory struct { - FilesServer FilesServer - OperationsServer OperationsServer - ProjectsServer ProjectsServer - ResourceSKUsServer ResourceSKUsServer - ServiceTasksServer ServiceTasksServer - ServicesServer ServicesServer - TasksServer TasksServer - UsagesServer UsagesServer + DatabaseMigrationsMongoToCosmosDbRUMongoServer DatabaseMigrationsMongoToCosmosDbRUMongoServer + DatabaseMigrationsMongoToCosmosDbvCoreMongoServer DatabaseMigrationsMongoToCosmosDbvCoreMongoServer + DatabaseMigrationsSQLDbServer DatabaseMigrationsSQLDbServer + DatabaseMigrationsSQLMiServer DatabaseMigrationsSQLMiServer + DatabaseMigrationsSQLVMServer DatabaseMigrationsSQLVMServer + FilesServer FilesServer + MigrationServicesServer MigrationServicesServer + OperationsServer OperationsServer + ProjectsServer ProjectsServer + ResourceSKUsServer ResourceSKUsServer + SQLMigrationServicesServer SQLMigrationServicesServer + ServiceTasksServer ServiceTasksServer + ServicesServer ServicesServer + TasksServer TasksServer + UsagesServer UsagesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -41,16 +48,23 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armdatamigration.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trFilesServer *FilesServerTransport - trOperationsServer *OperationsServerTransport - trProjectsServer *ProjectsServerTransport - trResourceSKUsServer *ResourceSKUsServerTransport - trServiceTasksServer *ServiceTasksServerTransport - trServicesServer *ServicesServerTransport - trTasksServer *TasksServerTransport - trUsagesServer *UsagesServerTransport + srv *ServerFactory + trMu sync.Mutex + trDatabaseMigrationsMongoToCosmosDbRUMongoServer *DatabaseMigrationsMongoToCosmosDbRUMongoServerTransport + trDatabaseMigrationsMongoToCosmosDbvCoreMongoServer *DatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport + trDatabaseMigrationsSQLDbServer *DatabaseMigrationsSQLDbServerTransport + trDatabaseMigrationsSQLMiServer *DatabaseMigrationsSQLMiServerTransport + trDatabaseMigrationsSQLVMServer *DatabaseMigrationsSQLVMServerTransport + trFilesServer *FilesServerTransport + trMigrationServicesServer *MigrationServicesServerTransport + trOperationsServer *OperationsServerTransport + trProjectsServer *ProjectsServerTransport + trResourceSKUsServer *ResourceSKUsServerTransport + trSQLMigrationServicesServer *SQLMigrationServicesServerTransport + trServiceTasksServer *ServiceTasksServerTransport + trServicesServer *ServicesServerTransport + trTasksServer *TasksServerTransport + trUsagesServer *UsagesServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -66,9 +80,39 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { var err error switch client { + case "DatabaseMigrationsMongoToCosmosDbRUMongoClient": + initServer(s, &s.trDatabaseMigrationsMongoToCosmosDbRUMongoServer, func() *DatabaseMigrationsMongoToCosmosDbRUMongoServerTransport { + return NewDatabaseMigrationsMongoToCosmosDbRUMongoServerTransport(&s.srv.DatabaseMigrationsMongoToCosmosDbRUMongoServer) + }) + resp, err = s.trDatabaseMigrationsMongoToCosmosDbRUMongoServer.Do(req) + case "DatabaseMigrationsMongoToCosmosDbvCoreMongoClient": + initServer(s, &s.trDatabaseMigrationsMongoToCosmosDbvCoreMongoServer, func() *DatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport { + return NewDatabaseMigrationsMongoToCosmosDbvCoreMongoServerTransport(&s.srv.DatabaseMigrationsMongoToCosmosDbvCoreMongoServer) + }) + resp, err = s.trDatabaseMigrationsMongoToCosmosDbvCoreMongoServer.Do(req) + case "DatabaseMigrationsSQLDbClient": + initServer(s, &s.trDatabaseMigrationsSQLDbServer, func() *DatabaseMigrationsSQLDbServerTransport { + return NewDatabaseMigrationsSQLDbServerTransport(&s.srv.DatabaseMigrationsSQLDbServer) + }) + resp, err = s.trDatabaseMigrationsSQLDbServer.Do(req) + case "DatabaseMigrationsSQLMiClient": + initServer(s, &s.trDatabaseMigrationsSQLMiServer, func() *DatabaseMigrationsSQLMiServerTransport { + return NewDatabaseMigrationsSQLMiServerTransport(&s.srv.DatabaseMigrationsSQLMiServer) + }) + resp, err = s.trDatabaseMigrationsSQLMiServer.Do(req) + case "DatabaseMigrationsSQLVMClient": + initServer(s, &s.trDatabaseMigrationsSQLVMServer, func() *DatabaseMigrationsSQLVMServerTransport { + return NewDatabaseMigrationsSQLVMServerTransport(&s.srv.DatabaseMigrationsSQLVMServer) + }) + resp, err = s.trDatabaseMigrationsSQLVMServer.Do(req) case "FilesClient": initServer(s, &s.trFilesServer, func() *FilesServerTransport { return NewFilesServerTransport(&s.srv.FilesServer) }) resp, err = s.trFilesServer.Do(req) + case "MigrationServicesClient": + initServer(s, &s.trMigrationServicesServer, func() *MigrationServicesServerTransport { + return NewMigrationServicesServerTransport(&s.srv.MigrationServicesServer) + }) + resp, err = s.trMigrationServicesServer.Do(req) case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) @@ -78,6 +122,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "ResourceSKUsClient": initServer(s, &s.trResourceSKUsServer, func() *ResourceSKUsServerTransport { return NewResourceSKUsServerTransport(&s.srv.ResourceSKUsServer) }) resp, err = s.trResourceSKUsServer.Do(req) + case "SQLMigrationServicesClient": + initServer(s, &s.trSQLMigrationServicesServer, func() *SQLMigrationServicesServerTransport { + return NewSQLMigrationServicesServerTransport(&s.srv.SQLMigrationServicesServer) + }) + resp, err = s.trSQLMigrationServicesServer.Do(req) case "ServiceTasksClient": initServer(s, &s.trServiceTasksServer, func() *ServiceTasksServerTransport { return NewServiceTasksServerTransport(&s.srv.ServiceTasksServer) }) resp, err = s.trServiceTasksServer.Do(req) diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/services_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/services_server.go index 1ea3910aed9c..7ce76c9dda48 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/fake/services_server.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/services_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/servicetasks_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/servicetasks_server.go index f52d9b01bd06..acd7b0b6ce09 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/fake/servicetasks_server.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/servicetasks_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/sqlmigrationservices_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/sqlmigrationservices_server.go new file mode 100644 index 000000000000..5d9f187db28d --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/sqlmigrationservices_server.go @@ -0,0 +1,566 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" + "net/http" + "net/url" + "regexp" +) + +// SQLMigrationServicesServer is a fake server for instances of the armdatamigration.SQLMigrationServicesClient type. +type SQLMigrationServicesServer struct { + // BeginCreateOrUpdate is the fake for method SQLMigrationServicesClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters armdatamigration.SQLMigrationService, options *armdatamigration.SQLMigrationServicesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdatamigration.SQLMigrationServicesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method SQLMigrationServicesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *armdatamigration.SQLMigrationServicesClientBeginDeleteOptions) (resp azfake.PollerResponder[armdatamigration.SQLMigrationServicesClientDeleteResponse], errResp azfake.ErrorResponder) + + // DeleteNode is the fake for method SQLMigrationServicesClient.DeleteNode + // HTTP status codes to indicate success: http.StatusOK + DeleteNode func(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters armdatamigration.DeleteNode, options *armdatamigration.SQLMigrationServicesClientDeleteNodeOptions) (resp azfake.Responder[armdatamigration.SQLMigrationServicesClientDeleteNodeResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method SQLMigrationServicesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *armdatamigration.SQLMigrationServicesClientGetOptions) (resp azfake.Responder[armdatamigration.SQLMigrationServicesClientGetResponse], errResp azfake.ErrorResponder) + + // ListAuthKeys is the fake for method SQLMigrationServicesClient.ListAuthKeys + // HTTP status codes to indicate success: http.StatusOK + ListAuthKeys func(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *armdatamigration.SQLMigrationServicesClientListAuthKeysOptions) (resp azfake.Responder[armdatamigration.SQLMigrationServicesClientListAuthKeysResponse], errResp azfake.ErrorResponder) + + // NewListByResourceGroupPager is the fake for method SQLMigrationServicesClient.NewListByResourceGroupPager + // HTTP status codes to indicate success: http.StatusOK + NewListByResourceGroupPager func(resourceGroupName string, options *armdatamigration.SQLMigrationServicesClientListByResourceGroupOptions) (resp azfake.PagerResponder[armdatamigration.SQLMigrationServicesClientListByResourceGroupResponse]) + + // NewListBySubscriptionPager is the fake for method SQLMigrationServicesClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armdatamigration.SQLMigrationServicesClientListBySubscriptionOptions) (resp azfake.PagerResponder[armdatamigration.SQLMigrationServicesClientListBySubscriptionResponse]) + + // NewListMigrationsPager is the fake for method SQLMigrationServicesClient.NewListMigrationsPager + // HTTP status codes to indicate success: http.StatusOK + NewListMigrationsPager func(resourceGroupName string, sqlMigrationServiceName string, options *armdatamigration.SQLMigrationServicesClientListMigrationsOptions) (resp azfake.PagerResponder[armdatamigration.SQLMigrationServicesClientListMigrationsResponse]) + + // ListMonitoringData is the fake for method SQLMigrationServicesClient.ListMonitoringData + // HTTP status codes to indicate success: http.StatusOK + ListMonitoringData func(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *armdatamigration.SQLMigrationServicesClientListMonitoringDataOptions) (resp azfake.Responder[armdatamigration.SQLMigrationServicesClientListMonitoringDataResponse], errResp azfake.ErrorResponder) + + // RegenerateAuthKeys is the fake for method SQLMigrationServicesClient.RegenerateAuthKeys + // HTTP status codes to indicate success: http.StatusOK + RegenerateAuthKeys func(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters armdatamigration.RegenAuthKeys, options *armdatamigration.SQLMigrationServicesClientRegenerateAuthKeysOptions) (resp azfake.Responder[armdatamigration.SQLMigrationServicesClientRegenerateAuthKeysResponse], errResp azfake.ErrorResponder) + + // BeginUpdate is the fake for method SQLMigrationServicesClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginUpdate func(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters armdatamigration.SQLMigrationServiceUpdate, options *armdatamigration.SQLMigrationServicesClientBeginUpdateOptions) (resp azfake.PollerResponder[armdatamigration.SQLMigrationServicesClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewSQLMigrationServicesServerTransport creates a new instance of SQLMigrationServicesServerTransport with the provided implementation. +// The returned SQLMigrationServicesServerTransport instance is connected to an instance of armdatamigration.SQLMigrationServicesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSQLMigrationServicesServerTransport(srv *SQLMigrationServicesServer) *SQLMigrationServicesServerTransport { + return &SQLMigrationServicesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdatamigration.SQLMigrationServicesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armdatamigration.SQLMigrationServicesClientDeleteResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armdatamigration.SQLMigrationServicesClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armdatamigration.SQLMigrationServicesClientListBySubscriptionResponse]](), + newListMigrationsPager: newTracker[azfake.PagerResponder[armdatamigration.SQLMigrationServicesClientListMigrationsResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armdatamigration.SQLMigrationServicesClientUpdateResponse]](), + } +} + +// SQLMigrationServicesServerTransport connects instances of armdatamigration.SQLMigrationServicesClient to instances of SQLMigrationServicesServer. +// Don't use this type directly, use NewSQLMigrationServicesServerTransport instead. +type SQLMigrationServicesServerTransport struct { + srv *SQLMigrationServicesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armdatamigration.SQLMigrationServicesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armdatamigration.SQLMigrationServicesClientDeleteResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armdatamigration.SQLMigrationServicesClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armdatamigration.SQLMigrationServicesClientListBySubscriptionResponse]] + newListMigrationsPager *tracker[azfake.PagerResponder[armdatamigration.SQLMigrationServicesClientListMigrationsResponse]] + beginUpdate *tracker[azfake.PollerResponder[armdatamigration.SQLMigrationServicesClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for SQLMigrationServicesServerTransport. +func (s *SQLMigrationServicesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "SQLMigrationServicesClient.BeginCreateOrUpdate": + resp, err = s.dispatchBeginCreateOrUpdate(req) + case "SQLMigrationServicesClient.BeginDelete": + resp, err = s.dispatchBeginDelete(req) + case "SQLMigrationServicesClient.DeleteNode": + resp, err = s.dispatchDeleteNode(req) + case "SQLMigrationServicesClient.Get": + resp, err = s.dispatchGet(req) + case "SQLMigrationServicesClient.ListAuthKeys": + resp, err = s.dispatchListAuthKeys(req) + case "SQLMigrationServicesClient.NewListByResourceGroupPager": + resp, err = s.dispatchNewListByResourceGroupPager(req) + case "SQLMigrationServicesClient.NewListBySubscriptionPager": + resp, err = s.dispatchNewListBySubscriptionPager(req) + case "SQLMigrationServicesClient.NewListMigrationsPager": + resp, err = s.dispatchNewListMigrationsPager(req) + case "SQLMigrationServicesClient.ListMonitoringData": + resp, err = s.dispatchListMonitoringData(req) + case "SQLMigrationServicesClient.RegenerateAuthKeys": + resp, err = s.dispatchRegenerateAuthKeys(req) + case "SQLMigrationServicesClient.BeginUpdate": + resp, err = s.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (s *SQLMigrationServicesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := s.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/sqlMigrationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.SQLMigrationService](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlMigrationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlMigrationServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, sqlMigrationServiceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + s.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + s.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + s.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (s *SQLMigrationServicesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if s.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := s.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/sqlMigrationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlMigrationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlMigrationServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, sqlMigrationServiceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + s.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + s.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + s.beginDelete.remove(req) + } + + return resp, nil +} + +func (s *SQLMigrationServicesServerTransport) dispatchDeleteNode(req *http.Request) (*http.Response, error) { + if s.srv.DeleteNode == nil { + return nil, &nonRetriableError{errors.New("fake for method DeleteNode not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/sqlMigrationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deleteNode` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.DeleteNode](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlMigrationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlMigrationServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.DeleteNode(req.Context(), resourceGroupNameParam, sqlMigrationServiceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DeleteNode, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SQLMigrationServicesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if s.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/sqlMigrationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlMigrationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlMigrationServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, sqlMigrationServiceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SQLMigrationService, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SQLMigrationServicesServerTransport) dispatchListAuthKeys(req *http.Request) (*http.Response, error) { + if s.srv.ListAuthKeys == nil { + return nil, &nonRetriableError{errors.New("fake for method ListAuthKeys not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/sqlMigrationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listAuthKeys` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlMigrationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlMigrationServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.ListAuthKeys(req.Context(), resourceGroupNameParam, sqlMigrationServiceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AuthenticationKeys, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SQLMigrationServicesServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListByResourceGroupPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} + } + newListByResourceGroupPager := s.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/sqlMigrationServices` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resp := s.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) + newListByResourceGroupPager = &resp + s.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armdatamigration.SQLMigrationServicesClientListByResourceGroupResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListByResourceGroupPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByResourceGroupPager) { + s.newListByResourceGroupPager.remove(req) + } + return resp, nil +} + +func (s *SQLMigrationServicesServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := s.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/sqlMigrationServices` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resp := s.srv.NewListBySubscriptionPager(nil) + newListBySubscriptionPager = &resp + s.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armdatamigration.SQLMigrationServicesClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListBySubscriptionPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + s.newListBySubscriptionPager.remove(req) + } + return resp, nil +} + +func (s *SQLMigrationServicesServerTransport) dispatchNewListMigrationsPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListMigrationsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListMigrationsPager not implemented")} + } + newListMigrationsPager := s.newListMigrationsPager.get(req) + if newListMigrationsPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/sqlMigrationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listMigrations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlMigrationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlMigrationServiceName")]) + if err != nil { + return nil, err + } + resp := s.srv.NewListMigrationsPager(resourceGroupNameParam, sqlMigrationServiceNameParam, nil) + newListMigrationsPager = &resp + s.newListMigrationsPager.add(req, newListMigrationsPager) + server.PagerResponderInjectNextLinks(newListMigrationsPager, req, func(page *armdatamigration.SQLMigrationServicesClientListMigrationsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListMigrationsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListMigrationsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListMigrationsPager) { + s.newListMigrationsPager.remove(req) + } + return resp, nil +} + +func (s *SQLMigrationServicesServerTransport) dispatchListMonitoringData(req *http.Request) (*http.Response, error) { + if s.srv.ListMonitoringData == nil { + return nil, &nonRetriableError{errors.New("fake for method ListMonitoringData not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/sqlMigrationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listMonitoringData` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlMigrationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlMigrationServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.ListMonitoringData(req.Context(), resourceGroupNameParam, sqlMigrationServiceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).IntegrationRuntimeMonitoringData, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SQLMigrationServicesServerTransport) dispatchRegenerateAuthKeys(req *http.Request) (*http.Response, error) { + if s.srv.RegenerateAuthKeys == nil { + return nil, &nonRetriableError{errors.New("fake for method RegenerateAuthKeys not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/sqlMigrationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/regenerateAuthKeys` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.RegenAuthKeys](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlMigrationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlMigrationServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.RegenerateAuthKeys(req.Context(), resourceGroupNameParam, sqlMigrationServiceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RegenAuthKeys, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SQLMigrationServicesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if s.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := s.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataMigration/sqlMigrationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdatamigration.SQLMigrationServiceUpdate](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + sqlMigrationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sqlMigrationServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginUpdate(req.Context(), resourceGroupNameParam, sqlMigrationServiceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + s.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + s.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + s.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/tasks_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/tasks_server.go index fca96488e3b0..a73522f1aa24 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/fake/tasks_server.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/tasks_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/time_rfc3339.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/time_rfc3339.go index b0535a7b63e6..81f308b0d343 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/fake/time_rfc3339.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/datamigration/armdatamigration/fake/usages_server.go b/sdk/resourcemanager/datamigration/armdatamigration/fake/usages_server.go index ee1e81a6666e..feb440c961b2 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/fake/usages_server.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/fake/usages_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/datamigration/armdatamigration/files_client.go b/sdk/resourcemanager/datamigration/armdatamigration/files_client.go index 845b7cee8f47..b0dfee38a040 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/files_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/files_client.go @@ -28,7 +28,7 @@ type FilesClient struct { } // NewFilesClient creates a new instance of FilesClient with the specified values. -// - subscriptionID - Identifier of the subscription +// - subscriptionID - Subscription ID that identifies an Azure subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewFilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FilesClient, error) { @@ -46,7 +46,7 @@ func NewFilesClient(subscriptionID string, credential azcore.TokenCredential, op // CreateOrUpdate - The PUT method creates a new file or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -103,7 +103,7 @@ func (client *FilesClient) createOrUpdateCreateRequest(ctx context.Context, grou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -124,7 +124,7 @@ func (client *FilesClient) createOrUpdateHandleResponse(resp *http.Response) (Fi // Delete - This method deletes a file. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -179,7 +179,7 @@ func (client *FilesClient) deleteCreateRequest(ctx context.Context, groupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,7 +189,7 @@ func (client *FilesClient) deleteCreateRequest(ctx context.Context, groupName st // retrieves information about a file. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -245,7 +245,7 @@ func (client *FilesClient) getCreateRequest(ctx context.Context, groupName strin return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,7 @@ func (client *FilesClient) getHandleResponse(resp *http.Response) (FilesClientGe // NewListPager - The project resource is a nested resource representing a stored migration project. This method returns a // list of files owned by a project resource. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -315,7 +315,7 @@ func (client *FilesClient) listCreateRequest(ctx context.Context, groupName stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -333,7 +333,7 @@ func (client *FilesClient) listHandleResponse(resp *http.Response) (FilesClientL // Read - This method is used for requesting storage information using which contents of the file can be downloaded. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -389,7 +389,7 @@ func (client *FilesClient) readCreateRequest(ctx context.Context, groupName stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -407,7 +407,7 @@ func (client *FilesClient) readHandleResponse(resp *http.Response) (FilesClientR // ReadWrite - This method is used for requesting information for reading and writing the file content. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -463,7 +463,7 @@ func (client *FilesClient) readWriteCreateRequest(ctx context.Context, groupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -481,7 +481,7 @@ func (client *FilesClient) readWriteHandleResponse(resp *http.Response) (FilesCl // Update - This method updates an existing file. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -538,7 +538,7 @@ func (client *FilesClient) updateCreateRequest(ctx context.Context, groupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/datamigration/armdatamigration/files_client_example_test.go b/sdk/resourcemanager/datamigration/armdatamigration/files_client_example_test.go deleted file mode 100644 index b6a3ea8b0e8b..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/files_client_example_test.go +++ /dev/null @@ -1,240 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdatamigration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Files_List.json -func ExampleFilesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFilesClient().NewListPager("DmsSdkRg", "DmsSdkService", "DmsSdkProject", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FileList = armdatamigration.FileList{ - // Value: []*armdatamigration.ProjectFile{ - // { - // Name: to.Ptr("x114d023d8"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects/files"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/DmsSdkProject/files/x114d023d8"), - // Properties: &armdatamigration.ProjectFileProperties{ - // Extension: to.Ptr("sql"), - // FilePath: to.Ptr("SchemaInput/DmsSdkFile.sql"), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-15T20:01:33.000Z"); return t}()), - // MediaType: to.Ptr("text/plain"), - // Size: to.Ptr[int64](51835), - // }, - // }, - // { - // Name: to.Ptr("pfpu7fxqcpziyg2h3qj2vb7d8jpbbg7p"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects/files"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/DmsSdkProject/files/pfpu7fxqcpziyg2h3qj2vb7d8jpbbg7p"), - // Properties: &armdatamigration.ProjectFileProperties{ - // Extension: to.Ptr("sql"), - // FilePath: to.Ptr("7daf055f-82b0-483e-9da0-4244b4eaa9b0/AdventureWorks2008.sql"), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-05T16:51:03.000Z"); return t}()), - // MediaType: to.Ptr("text/plain"), - // Size: to.Ptr[int64](910278), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Files_Get.json -func ExampleFilesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFilesClient().Get(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProjectFile = armdatamigration.ProjectFile{ - // Name: to.Ptr("x114d023d8"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects/files"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/DmsSdkProject/files/x114d023d8"), - // Properties: &armdatamigration.ProjectFileProperties{ - // Extension: to.Ptr("sql"), - // FilePath: to.Ptr("SchemaInput/DmsSdkFile.sql"), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-15T20:01:33.000Z"); return t}()), - // MediaType: to.Ptr("text/plain"), - // Size: to.Ptr[int64](51835), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Files_CreateOrUpdate.json -func ExampleFilesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFilesClient().CreateOrUpdate(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", armdatamigration.ProjectFile{ - Properties: &armdatamigration.ProjectFileProperties{ - FilePath: to.Ptr("DmsSdkFilePath/DmsSdkFile.sql"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProjectFile = armdatamigration.ProjectFile{ - // Name: to.Ptr("x114d023d8"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects/files"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/DmsSdkProject/files/x114d023d8"), - // Etag: to.Ptr("C2WE6C3yt2I0hunjpjzffY8LhTLqrJZHJ20gkuq2ZOA="), - // Properties: &armdatamigration.ProjectFileProperties{ - // Extension: to.Ptr("sql"), - // FilePath: to.Ptr("DmsSdkFilePath/DmsSdkFile.sql"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Files_Delete.json -func ExampleFilesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewFilesClient().Delete(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Files_Update.json -func ExampleFilesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFilesClient().Update(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", armdatamigration.ProjectFile{ - Properties: &armdatamigration.ProjectFileProperties{ - FilePath: to.Ptr("DmsSdkFilePath/DmsSdkFile.sql"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProjectFile = armdatamigration.ProjectFile{ - // Name: to.Ptr("x114d023d8"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects/files"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/DmsSdkProject/files/x114d023d8"), - // Etag: to.Ptr("C2WE6C3yt2I0hunjpjzffY8LhTLqrJZHJ20gkuq2ZOA="), - // Properties: &armdatamigration.ProjectFileProperties{ - // Extension: to.Ptr("sql"), - // FilePath: to.Ptr("DmsSdkFilePath/DmsSdkFile.sql"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Files_Read.json -func ExampleFilesClient_Read() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFilesClient().Read(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FileStorageInfo = armdatamigration.FileStorageInfo{ - // Headers: map[string]*string{ - // "x-ms-blob-type": to.Ptr("BlockBlob"), - // }, - // URI: to.Ptr("https://dmssdkservicestorage.blob.core.windows.net/dmssdkservicecontainer/_rpfiles/dmssdkproject/pfpu7fxqcpziyg2h3qj2vb7d8jpbbg7p?sv=2016-05-31&sr=b&sig=sassignature&se=2018-10-05T18%3A21%3A42Z&sp=r"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Files_ReadWrite.json -func ExampleFilesClient_ReadWrite() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFilesClient().ReadWrite(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FileStorageInfo = armdatamigration.FileStorageInfo{ - // Headers: map[string]*string{ - // "x-ms-blob-type": to.Ptr("BlockBlob"), - // }, - // URI: to.Ptr("https://dmssdkservicestorage.blob.core.windows.net/dmssdkservicecontainer/_rpfiles/dmssdkproject/pfpu7fxqcpziyg2h3qj2vb7d8jpbbg7p?sv=2016-05-31&sr=b&sig=sassignature&se=2018-10-05T18%3A21%3A42Z&sp=racwd"), - // } -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/go.mod b/sdk/resourcemanager/datamigration/armdatamigration/go.mod index c49001dbd171..e9b3dde187c7 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/go.mod +++ b/sdk/resourcemanager/datamigration/armdatamigration/go.mod @@ -1,21 +1,11 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/datamigration/armdatamigration/go.sum b/sdk/resourcemanager/datamigration/armdatamigration/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/go.sum +++ b/sdk/resourcemanager/datamigration/armdatamigration/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/datamigration/armdatamigration/interfaces.go b/sdk/resourcemanager/datamigration/armdatamigration/interfaces.go index ede7259fae69..648d1b560fbd 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/interfaces.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/interfaces.go @@ -38,6 +38,26 @@ type ConnectionInfoClassification interface { GetConnectionInfo() *ConnectionInfo } +// DatabaseMigrationBasePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetDatabaseMigrationBaseProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DatabaseMigrationBaseProperties, *DatabaseMigrationProperties, *DatabaseMigrationPropertiesCosmosDbMongo, *DatabaseMigrationPropertiesSQLDb, +// - *DatabaseMigrationPropertiesSQLMi, *DatabaseMigrationPropertiesSQLVM +type DatabaseMigrationBasePropertiesClassification interface { + // GetDatabaseMigrationBaseProperties returns the DatabaseMigrationBaseProperties content of the underlying type. + GetDatabaseMigrationBaseProperties() *DatabaseMigrationBaseProperties +} + +// DatabaseMigrationPropertiesClassification provides polymorphic access to related types. +// Call the interface's GetDatabaseMigrationProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DatabaseMigrationProperties, *DatabaseMigrationPropertiesSQLDb, *DatabaseMigrationPropertiesSQLMi, *DatabaseMigrationPropertiesSQLVM +type DatabaseMigrationPropertiesClassification interface { + DatabaseMigrationBasePropertiesClassification + // GetDatabaseMigrationProperties returns the DatabaseMigrationProperties content of the underlying type. + GetDatabaseMigrationProperties() *DatabaseMigrationProperties +} + // MigrateMySQLAzureDbForMySQLOfflineTaskOutputClassification provides polymorphic access to related types. // Call the interface's GetMigrateMySQLAzureDbForMySQLOfflineTaskOutput() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: diff --git a/sdk/resourcemanager/datamigration/armdatamigration/migrationservices_client.go b/sdk/resourcemanager/datamigration/armdatamigration/migrationservices_client.go new file mode 100644 index 000000000000..ce543bfb56d7 --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/migrationservices_client.go @@ -0,0 +1,530 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdatamigration + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// MigrationServicesClient contains the methods for the MigrationServices group. +// Don't use this type directly, use NewMigrationServicesClient() instead. +type MigrationServicesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewMigrationServicesClient creates a new instance of MigrationServicesClient with the specified values. +// - subscriptionID - Subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewMigrationServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MigrationServicesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &MigrationServicesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or Update Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - migrationServiceName - Name of the Migration Service. +// - parameters - Details of MigrationService resource. +// - options - MigrationServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the MigrationServicesClient.BeginCreateOrUpdate +// method. +func (client *MigrationServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, migrationServiceName string, parameters MigrationService, options *MigrationServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[MigrationServicesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, migrationServiceName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MigrationServicesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MigrationServicesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or Update Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *MigrationServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, migrationServiceName string, parameters MigrationService, options *MigrationServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "MigrationServicesClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, migrationServiceName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *MigrationServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, migrationServiceName string, parameters MigrationService, options *MigrationServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/migrationServices/{migrationServiceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if migrationServiceName == "" { + return nil, errors.New("parameter migrationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationServiceName}", url.PathEscape(migrationServiceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - migrationServiceName - Name of the Migration Service. +// - options - MigrationServicesClientBeginDeleteOptions contains the optional parameters for the MigrationServicesClient.BeginDelete +// method. +func (client *MigrationServicesClient) BeginDelete(ctx context.Context, resourceGroupName string, migrationServiceName string, options *MigrationServicesClientBeginDeleteOptions) (*runtime.Poller[MigrationServicesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, migrationServiceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MigrationServicesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MigrationServicesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *MigrationServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, migrationServiceName string, options *MigrationServicesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "MigrationServicesClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, migrationServiceName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *MigrationServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, migrationServiceName string, options *MigrationServicesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/migrationServices/{migrationServiceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if migrationServiceName == "" { + return nil, errors.New("parameter migrationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationServiceName}", url.PathEscape(migrationServiceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieve the Database Migration Service +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - migrationServiceName - Name of the Migration Service. +// - options - MigrationServicesClientGetOptions contains the optional parameters for the MigrationServicesClient.Get method. +func (client *MigrationServicesClient) Get(ctx context.Context, resourceGroupName string, migrationServiceName string, options *MigrationServicesClientGetOptions) (MigrationServicesClientGetResponse, error) { + var err error + const operationName = "MigrationServicesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, migrationServiceName, options) + if err != nil { + return MigrationServicesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MigrationServicesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MigrationServicesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *MigrationServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, migrationServiceName string, options *MigrationServicesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/migrationServices/{migrationServiceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if migrationServiceName == "" { + return nil, errors.New("parameter migrationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationServiceName}", url.PathEscape(migrationServiceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *MigrationServicesClient) getHandleResponse(resp *http.Response) (MigrationServicesClientGetResponse, error) { + result := MigrationServicesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MigrationService); err != nil { + return MigrationServicesClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Retrieve all migration services in the resource group. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - options - MigrationServicesClientListByResourceGroupOptions contains the optional parameters for the MigrationServicesClient.NewListByResourceGroupPager +// method. +func (client *MigrationServicesClient) NewListByResourceGroupPager(resourceGroupName string, options *MigrationServicesClientListByResourceGroupOptions) *runtime.Pager[MigrationServicesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[MigrationServicesClientListByResourceGroupResponse]{ + More: func(page MigrationServicesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *MigrationServicesClientListByResourceGroupResponse) (MigrationServicesClientListByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "MigrationServicesClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return MigrationServicesClientListByResourceGroupResponse{}, err + } + return client.listByResourceGroupHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *MigrationServicesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *MigrationServicesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/migrationServices" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *MigrationServicesClient) listByResourceGroupHandleResponse(resp *http.Response) (MigrationServicesClientListByResourceGroupResponse, error) { + result := MigrationServicesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MigrationServiceListResult); err != nil { + return MigrationServicesClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Retrieve all migration services in the subscriptions. +// +// Generated from API version 2023-07-15-preview +// - options - MigrationServicesClientListBySubscriptionOptions contains the optional parameters for the MigrationServicesClient.NewListBySubscriptionPager +// method. +func (client *MigrationServicesClient) NewListBySubscriptionPager(options *MigrationServicesClientListBySubscriptionOptions) *runtime.Pager[MigrationServicesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[MigrationServicesClientListBySubscriptionResponse]{ + More: func(page MigrationServicesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *MigrationServicesClientListBySubscriptionResponse) (MigrationServicesClientListBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "MigrationServicesClient.NewListBySubscriptionPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, nil) + if err != nil { + return MigrationServicesClientListBySubscriptionResponse{}, err + } + return client.listBySubscriptionHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *MigrationServicesClient) listBySubscriptionCreateRequest(ctx context.Context, options *MigrationServicesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/migrationServices" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *MigrationServicesClient) listBySubscriptionHandleResponse(resp *http.Response) (MigrationServicesClientListBySubscriptionResponse, error) { + result := MigrationServicesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MigrationServiceListResult); err != nil { + return MigrationServicesClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// NewListMigrationsPager - Retrieve the List of database migrations attached to the service. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - migrationServiceName - Name of the Migration Service. +// - options - MigrationServicesClientListMigrationsOptions contains the optional parameters for the MigrationServicesClient.NewListMigrationsPager +// method. +func (client *MigrationServicesClient) NewListMigrationsPager(resourceGroupName string, migrationServiceName string, options *MigrationServicesClientListMigrationsOptions) *runtime.Pager[MigrationServicesClientListMigrationsResponse] { + return runtime.NewPager(runtime.PagingHandler[MigrationServicesClientListMigrationsResponse]{ + More: func(page MigrationServicesClientListMigrationsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *MigrationServicesClientListMigrationsResponse) (MigrationServicesClientListMigrationsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "MigrationServicesClient.NewListMigrationsPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listMigrationsCreateRequest(ctx, resourceGroupName, migrationServiceName, options) + }, nil) + if err != nil { + return MigrationServicesClientListMigrationsResponse{}, err + } + return client.listMigrationsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listMigrationsCreateRequest creates the ListMigrations request. +func (client *MigrationServicesClient) listMigrationsCreateRequest(ctx context.Context, resourceGroupName string, migrationServiceName string, options *MigrationServicesClientListMigrationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/migrationServices/{migrationServiceName}/listMigrations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if migrationServiceName == "" { + return nil, errors.New("parameter migrationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationServiceName}", url.PathEscape(migrationServiceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listMigrationsHandleResponse handles the ListMigrations response. +func (client *MigrationServicesClient) listMigrationsHandleResponse(resp *http.Response) (MigrationServicesClientListMigrationsResponse, error) { + result := MigrationServicesClientListMigrationsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseMigrationBaseListResult); err != nil { + return MigrationServicesClientListMigrationsResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - migrationServiceName - Name of the Migration Service. +// - parameters - Details of MigrationService resource. +// - options - MigrationServicesClientBeginUpdateOptions contains the optional parameters for the MigrationServicesClient.BeginUpdate +// method. +func (client *MigrationServicesClient) BeginUpdate(ctx context.Context, resourceGroupName string, migrationServiceName string, parameters MigrationServiceUpdate, options *MigrationServicesClientBeginUpdateOptions) (*runtime.Poller[MigrationServicesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, migrationServiceName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MigrationServicesClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MigrationServicesClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Update Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *MigrationServicesClient) update(ctx context.Context, resourceGroupName string, migrationServiceName string, parameters MigrationServiceUpdate, options *MigrationServicesClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "MigrationServicesClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, migrationServiceName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *MigrationServicesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, migrationServiceName string, parameters MigrationServiceUpdate, options *MigrationServicesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/migrationServices/{migrationServiceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if migrationServiceName == "" { + return nil, errors.New("parameter migrationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationServiceName}", url.PathEscape(migrationServiceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/models.go b/sdk/resourcemanager/datamigration/armdatamigration/models.go index ea4bbb3b9fdf..eaba413e4533 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/models.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/models.go @@ -16,7 +16,16 @@ type APIError struct { Error *ODataError // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData + SystemData *SystemDataAutoGenerated +} + +// AuthenticationKeys - An authentication key. +type AuthenticationKeys struct { + // The first authentication key. + AuthKey1 *string + + // The second authentication key. + AuthKey2 *string } // AvailableServiceSKU - Describes the available service SKU. @@ -63,16 +72,40 @@ type AvailableServiceSKUSKU struct { // AzureActiveDirectoryApp - Azure Active Directory Application type AzureActiveDirectoryApp struct { - // REQUIRED; Key used to authenticate to the Azure Active Directory Application + // Key used to authenticate to the Azure Active Directory Application AppKey *string - // REQUIRED; Application ID of the Azure Active Directory Application + // Application ID of the Azure Active Directory Application ApplicationID *string - // REQUIRED; Tenant id of the customer + // Ignore checking azure permissions on the AAD app + IgnoreAzurePermissions *bool + + // Tenant id of the customer TenantID *string } +// AzureBlob - Azure Blob Details +type AzureBlob struct { + // Storage Account Key. + AccountKey *string + + // Blob container name where backups are stored. + BlobContainerName *string + + // Resource Id of the storage account where backups are stored. + StorageAccountResourceID *string +} + +// BackupConfiguration - Backup Configuration +type BackupConfiguration struct { + // Source location of backups. + SourceLocation *SourceLocation + + // Target location for copying backups. + TargetLocation *TargetLocation +} + // BackupFileInfo - Information of the backup file type BackupFileInfo struct { // Sequence number of the backup file in the backup set @@ -120,7 +153,7 @@ type BackupSetInfo struct { // BlobShare - Blob container storage information. type BlobShare struct { - // REQUIRED; SAS URI of Azure Storage Account Container. + // SAS URI of Azure Storage Account Container. SasURI *string } @@ -142,7 +175,7 @@ type CheckOCIDriverTaskOutput struct { // CheckOCIDriverTaskProperties - Properties for the task that checks for OCI drivers. type CheckOCIDriverTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -174,11 +207,11 @@ func (c *CheckOCIDriverTaskProperties) GetProjectTaskProperties() *ProjectTaskPr } } -// CommandProperties - Base class for all types of DMS command properties. If command is not supported by current client, -// this object is returned. +// CommandProperties - Base class for all types of DMS (classic) command properties. If command is not supported by current +// client, this object is returned. type CommandProperties struct { // REQUIRED; Command type. - CommandType *string + CommandType *CommandType // READ-ONLY; Array of errors. This is ignored if submitted. Errors []*ODataError @@ -194,7 +227,7 @@ func (c *CommandProperties) GetCommandProperties() *CommandProperties { return c // a MongoDB server type ConnectToMongoDbTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -244,7 +277,7 @@ type ConnectToSourceMySQLTaskInput struct { // ConnectToSourceMySQLTaskProperties - Properties for the task that validates MySQL database connection type ConnectToSourceMySQLTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -318,7 +351,7 @@ type ConnectToSourceOracleSyncTaskOutput struct { // ConnectToSourceOracleSyncTaskProperties - Properties for the task that validates Oracle database connection type ConnectToSourceOracleSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -379,7 +412,7 @@ type ConnectToSourcePostgreSQLSyncTaskOutput struct { // source server requirements for online migration type ConnectToSourcePostgreSQLSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -415,7 +448,7 @@ func (c *ConnectToSourcePostgreSQLSyncTaskProperties) GetProjectTaskProperties() // server requirements for online migration type ConnectToSourceSQLServerSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -468,6 +501,9 @@ type ConnectToSourceSQLServerTaskInput struct { // Flag for whether to collect TDE Certificate names from source server. CollectTdeCertificateInfo *bool + // encrypted key for secure fields + EncryptedKeyForSecureFields *string + // Flag for whether to validate SSIS catalog is reachable on the source server. ValidateSsisCatalogOnly *bool } @@ -640,7 +676,7 @@ func (c *ConnectToSourceSQLServerTaskOutputTaskLevel) GetConnectToSourceSQLServe // source server requirements type ConnectToSourceSQLServerTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -648,6 +684,9 @@ type ConnectToSourceSQLServerTaskProperties struct { // Task input Input *ConnectToSourceSQLServerTaskInput + // Task id + TaskID *string + // READ-ONLY; Array of command properties. Commands []CommandPropertiesClassification @@ -708,7 +747,7 @@ type ConnectToTargetAzureDbForMySQLTaskOutput struct { // MySQL and target server requirements type ConnectToTargetAzureDbForMySQLTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -773,7 +812,7 @@ type ConnectToTargetAzureDbForPostgreSQLSyncTaskOutput struct { // For PostgreSQL server and target server requirements for online migration type ConnectToTargetAzureDbForPostgreSQLSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -840,7 +879,7 @@ type ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskOutputDatabaseSchemaMapIte // Database For PostgreSQL server and target server requirements for online migration for Oracle source. type ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -885,7 +924,7 @@ type ConnectToTargetSQLDbSyncTaskInput struct { // requirements for online migration type ConnectToTargetSQLDbSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -921,6 +960,9 @@ func (c *ConnectToTargetSQLDbSyncTaskProperties) GetProjectTaskProperties() *Pro type ConnectToTargetSQLDbTaskInput struct { // REQUIRED; Connection information for target SQL DB TargetConnectionInfo *SQLConnectionInfo + + // Boolean flag indicating whether to query object counts for each database on the target server + QueryObjectCounts *bool } // ConnectToTargetSQLDbTaskOutput - Output for the task that validates connection to SQL DB and target server requirements @@ -941,11 +983,14 @@ type ConnectToTargetSQLDbTaskOutput struct { // ConnectToTargetSQLDbTaskProperties - Properties for the task that validates connection to SQL DB and target server requirements type ConnectToTargetSQLDbTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string + // DateTime in UTC when the task was created + CreatedOn *string + // Task input Input *ConnectToTargetSQLDbTaskInput @@ -976,8 +1021,8 @@ func (c *ConnectToTargetSQLDbTaskProperties) GetProjectTaskProperties() *Project // ConnectToTargetSQLMISyncTaskInput - Input for the task that validates connection to Azure SQL Database Managed Instance // online scenario. type ConnectToTargetSQLMISyncTaskInput struct { - // REQUIRED; 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 + // REQUIRED; Azure Active Directory Application the DMS (classic) instance will use to connect to the target instance of Azure + // SQL Database Managed Instance and the Azure Storage Account AzureApp *AzureActiveDirectoryApp // REQUIRED; Connection information for Azure SQL Database Managed Instance @@ -1000,7 +1045,7 @@ type ConnectToTargetSQLMISyncTaskOutput struct { // Instance type ConnectToTargetSQLMISyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -1071,7 +1116,7 @@ type ConnectToTargetSQLMITaskOutput struct { // ConnectToTargetSQLMITaskProperties - Properties for the task that validates connection to Azure SQL Database Managed Instance type ConnectToTargetSQLMITaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -1118,6 +1163,42 @@ type ConnectionInfo struct { // GetConnectionInfo implements the ConnectionInfoClassification interface for type ConnectionInfo. func (c *ConnectionInfo) GetConnectionInfo() *ConnectionInfo { return c } +// CopyProgressDetails - Details on progress of ADF copy activity +type CopyProgressDetails struct { + // READ-ONLY; Copy Duration in seconds + CopyDuration *int32 + + // READ-ONLY; Copy Start + CopyStart *time.Time + + // READ-ONLY; Copy throughput in KBps + CopyThroughput *float64 + + // READ-ONLY; Bytes read + DataRead *int64 + + // READ-ONLY; Bytes written + DataWritten *int64 + + // READ-ONLY; Type of parallel copy (Dynamic range, Physical partition, none). + ParallelCopyType *string + + // READ-ONLY; Rows Copied + RowsCopied *int64 + + // READ-ONLY; Rows read + RowsRead *int64 + + // READ-ONLY; Status of the Copy activity (InProgress, Succeeded, Failed, Canceled). + Status *string + + // READ-ONLY; Table Name + TableName *string + + // READ-ONLY; The degree of parallelization. + UsedParallelCopies *int32 +} + // DataIntegrityValidationResult - Results for checksum based Data Integrity validation results type DataIntegrityValidationResult struct { // List of failed table names of source and target pair @@ -1286,271 +1367,899 @@ type DatabaseInfo struct { SourceDatabaseName *string } -// DatabaseObjectName - A representation of the name of an object in a database -type DatabaseObjectName struct { - // Type of the object in the database - ObjectType *ObjectType - - // READ-ONLY; The unescaped name of the database containing the object - DatabaseName *string +// DatabaseMigration - Database Migration Resource. +type DatabaseMigration struct { + // Database Migration Resource properties. + Properties DatabaseMigrationPropertiesClassification - // READ-ONLY; The unescaped name of the object - ObjectName *string + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string - // READ-ONLY; The unescaped name of the schema containing the object - SchemaName *string -} + // READ-ONLY; The name of the resource + Name *string -// DatabaseSummaryResult - Summary of database results in the migration -type DatabaseSummaryResult struct { - // READ-ONLY; Migration end time - EndedOn *time.Time + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData - // READ-ONLY; Wildcard string prefix to use for querying all errors of the item - ErrorPrefix *string + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} - // READ-ONLY; Number of successfully completed items - ItemsCompletedCount *int64 +// DatabaseMigrationBase - Database Migration Resource. +type DatabaseMigrationBase struct { + // Database Migration Base Resource properties. + Properties DatabaseMigrationBasePropertiesClassification - // READ-ONLY; Number of items - ItemsCount *int64 + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string - // READ-ONLY; Name of the item + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Wildcard string prefix to use for querying all sub-tem results of the item - ResultPrefix *string - - // READ-ONLY; Size of the database in megabytes - SizeMB *float64 + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData - // READ-ONLY; Migration start time - StartedOn *time.Time + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} - // READ-ONLY; Current state of migration - State *MigrationState +// DatabaseMigrationBaseListResult - A list of Database Migrations. +type DatabaseMigrationBaseListResult struct { + // READ-ONLY + NextLink *string - // READ-ONLY; Status message - StatusMessage *string + // READ-ONLY + Value []*DatabaseMigrationBase } -// DatabaseTable - Table properties -type DatabaseTable struct { - // READ-ONLY; Indicates whether table is empty or not - HasRows *bool +// DatabaseMigrationBaseProperties - Database Migration Base Resource properties. +type DatabaseMigrationBaseProperties struct { + // REQUIRED + Kind *ResourceType - // READ-ONLY; Schema-qualified name of the table - Name *string -} + // ID for current migration operation. + MigrationOperationID *string -// Error - Migration Task errors -type Error struct { - // Error type - Type *ErrorType + // Resource Id of the Migration Service. + MigrationService *string - // READ-ONLY; Error description - Message *string -} + // Error message for migration provisioning failure, if any. + ProvisioningError *string -// ExecutionStatistics - Description about the errors happen while performing migration validation -type ExecutionStatistics struct { - // CPU Time in millisecond(s) for the query execution - CPUTimeMs *float32 + // Resource Id of the target resource. + Scope *string - // Time taken in millisecond(s) for executing the query - ElapsedTimeMs *float32 + // READ-ONLY; Database migration end time. + EndedOn *time.Time - // No. of query executions - ExecutionCount *int64 + // READ-ONLY; Error details in case of migration failure. + MigrationFailureError *ErrorInfo - // Indicates whether the query resulted in an error - HasErrors *bool + // READ-ONLY; Migration status. + MigrationStatus *string - // List of sql Errors - SQLErrors []*string + // READ-ONLY; Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed + // and migration has started. + ProvisioningState *ProvisioningState - // Dictionary of sql query execution wait types and the respective statistics - WaitStats map[string]*WaitStatistics + // READ-ONLY; Database migration start time. + StartedOn *time.Time } -// FileList - OData page of files -type FileList struct { - // URL to load the next page of files - NextLink *string - - // List of files - Value []*ProjectFile +// GetDatabaseMigrationBaseProperties implements the DatabaseMigrationBasePropertiesClassification interface for type DatabaseMigrationBaseProperties. +func (d *DatabaseMigrationBaseProperties) GetDatabaseMigrationBaseProperties() *DatabaseMigrationBaseProperties { + return d } -// FileShare - File share information with Path, Username, and Password. -type FileShare struct { - // REQUIRED; The folder path for this share. - Path *string +// DatabaseMigrationCosmosDbMongo - Database Migration Resource for Mongo to CosmosDb. +type DatabaseMigrationCosmosDbMongo struct { + // Database Migration Resource properties for CosmosDb for Mongo. + Properties *DatabaseMigrationPropertiesCosmosDbMongo - // Password credential used to connect to the share location. - Password *string + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string - // User name credential to connect to the share location - UserName *string + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string } -// FileStorageInfo - File storage information. -type FileStorageInfo struct { - // Dictionary of - Headers map[string]*string +// DatabaseMigrationCosmosDbMongoListResult - A list of Database Migrations. +type DatabaseMigrationCosmosDbMongoListResult struct { + // READ-ONLY + NextLink *string - // A URI that can be used to access the file content. - URI *string + // READ-ONLY + Value []*DatabaseMigrationCosmosDbMongo } -// GetProjectDetailsNonSQLTaskInput - Input for the task that reads configuration from project artifacts -type GetProjectDetailsNonSQLTaskInput struct { - // REQUIRED; A URL that points to the location to access project artifacts - ProjectLocation *string +// DatabaseMigrationListResult - A list of Database Migrations. +type DatabaseMigrationListResult struct { + // READ-ONLY + NextLink *string - // REQUIRED; Name of the migration project - ProjectName *string + // READ-ONLY + Value []*DatabaseMigration } -// GetTdeCertificatesSQLTaskInput - Input for the task that gets TDE certificates in Base64 encoded format. -type GetTdeCertificatesSQLTaskInput struct { - // REQUIRED; Backup file share information for file share to be used for temporarily storing files. - BackupFileShare *FileShare +// DatabaseMigrationProperties - Database Migration Resource properties. +type DatabaseMigrationProperties struct { + // REQUIRED + Kind *ResourceType - // REQUIRED; Connection information for SQL Server - ConnectionInfo *SQLConnectionInfo + // ID for current migration operation. + MigrationOperationID *string - // REQUIRED; List containing certificate names and corresponding password to use for encrypting the exported certificate. - SelectedCertificates []*SelectedCertificateInput -} + // Resource Id of the Migration Service. + MigrationService *string -// GetTdeCertificatesSQLTaskOutput - Output of the task that gets TDE certificates in Base64 encoded format. -type GetTdeCertificatesSQLTaskOutput struct { - // READ-ONLY; Mapping from certificate name to base 64 encoded format. - Base64EncodedCertificates *string + // Error message for migration provisioning failure, if any. + ProvisioningError *string - // READ-ONLY; Validation errors - ValidationErrors []*ReportableException -} + // Resource Id of the target resource. + Scope *string -// GetTdeCertificatesSQLTaskProperties - Properties for the task that gets TDE certificates in Base64 encoded format. -type GetTdeCertificatesSQLTaskProperties struct { - // REQUIRED; Task type. - TaskType *string + // Name of the source database. + SourceDatabaseName *string - // Key value pairs of client data to attach meta data information to task - ClientData map[string]*string + // Source SQL Server connection details. + SourceSQLConnection *SQLConnectionInformation - // Task input - Input *GetTdeCertificatesSQLTaskInput + // Database collation to be used for the target database. + TargetDatabaseCollation *string - // READ-ONLY; Array of command properties. - Commands []CommandPropertiesClassification + // READ-ONLY; Database migration end time. + EndedOn *time.Time - // READ-ONLY; Array of errors. This is ignored if submitted. - Errors []*ODataError + // READ-ONLY; Error details in case of migration failure. + MigrationFailureError *ErrorInfo - // READ-ONLY; Task output. This is ignored if submitted. - Output []*GetTdeCertificatesSQLTaskOutput + // READ-ONLY; Migration status. + MigrationStatus *string - // READ-ONLY; The state of the task. This is ignored if submitted. - State *TaskState + // READ-ONLY; Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed + // and migration has started. + ProvisioningState *ProvisioningState + + // READ-ONLY; Name of the source sql server. + SourceServerName *string + + // READ-ONLY; Database migration start time. + StartedOn *time.Time } -// GetProjectTaskProperties implements the ProjectTaskPropertiesClassification interface for type GetTdeCertificatesSQLTaskProperties. -func (g *GetTdeCertificatesSQLTaskProperties) GetProjectTaskProperties() *ProjectTaskProperties { - return &ProjectTaskProperties{ - ClientData: g.ClientData, - Commands: g.Commands, - Errors: g.Errors, - State: g.State, - TaskType: g.TaskType, +// GetDatabaseMigrationBaseProperties implements the DatabaseMigrationBasePropertiesClassification interface for type DatabaseMigrationProperties. +func (d *DatabaseMigrationProperties) GetDatabaseMigrationBaseProperties() *DatabaseMigrationBaseProperties { + return &DatabaseMigrationBaseProperties{ + EndedOn: d.EndedOn, + Kind: d.Kind, + MigrationFailureError: d.MigrationFailureError, + MigrationOperationID: d.MigrationOperationID, + MigrationService: d.MigrationService, + MigrationStatus: d.MigrationStatus, + ProvisioningError: d.ProvisioningError, + ProvisioningState: d.ProvisioningState, + Scope: d.Scope, + StartedOn: d.StartedOn, } } -// GetUserTablesMySQLTaskInput - Input for the task that collects user tables for the given list of databases -type GetUserTablesMySQLTaskInput struct { - // REQUIRED; Connection information for SQL Server - ConnectionInfo *MySQLConnectionInfo - - // REQUIRED; List of database names to collect tables for - SelectedDatabases []*string +// GetDatabaseMigrationProperties implements the DatabaseMigrationPropertiesClassification interface for type DatabaseMigrationProperties. +func (d *DatabaseMigrationProperties) GetDatabaseMigrationProperties() *DatabaseMigrationProperties { + return d } -// GetUserTablesMySQLTaskOutput - Output of the task that collects user tables for the given list of databases -type GetUserTablesMySQLTaskOutput struct { - // READ-ONLY; Mapping from database name to list of tables - DatabasesToTables *string +// DatabaseMigrationPropertiesCosmosDbMongo - Database Migration Resource properties for CosmosDb for Mongo. +type DatabaseMigrationPropertiesCosmosDbMongo struct { + // REQUIRED + Kind *ResourceType - // READ-ONLY; Result identifier - ID *string + // List of Mongo Collections to be migrated. + CollectionList []*MongoMigrationCollection - // READ-ONLY; Validation errors - ValidationErrors []*ReportableException -} + // ID for current migration operation. + MigrationOperationID *string -// GetUserTablesMySQLTaskProperties - Properties for the task that collects user tables for the given list of databases -type GetUserTablesMySQLTaskProperties struct { - // REQUIRED; Task type. - TaskType *string + // Resource Id of the Migration Service. + MigrationService *string - // Key value pairs of client data to attach meta data information to task - ClientData map[string]*string + // Error message for migration provisioning failure, if any. + ProvisioningError *string - // Task input - Input *GetUserTablesMySQLTaskInput + // Resource Id of the target resource. + Scope *string - // READ-ONLY; Array of command properties. - Commands []CommandPropertiesClassification + // Source Mongo connection details. + SourceMongoConnection *MongoConnectionInformation - // READ-ONLY; Array of errors. This is ignored if submitted. - Errors []*ODataError + // Target Cosmos DB Mongo connection details. + TargetMongoConnection *MongoConnectionInformation - // READ-ONLY; Task output. This is ignored if submitted. - Output []*GetUserTablesMySQLTaskOutput + // READ-ONLY; Database migration end time. + EndedOn *time.Time - // READ-ONLY; The state of the task. This is ignored if submitted. - State *TaskState + // READ-ONLY; Error details in case of migration failure. + MigrationFailureError *ErrorInfo + + // READ-ONLY; Migration status. + MigrationStatus *string + + // READ-ONLY; Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed + // and migration has started. + ProvisioningState *ProvisioningState + + // READ-ONLY; Database migration start time. + StartedOn *time.Time } -// GetProjectTaskProperties implements the ProjectTaskPropertiesClassification interface for type GetUserTablesMySQLTaskProperties. -func (g *GetUserTablesMySQLTaskProperties) GetProjectTaskProperties() *ProjectTaskProperties { - return &ProjectTaskProperties{ - ClientData: g.ClientData, - Commands: g.Commands, - Errors: g.Errors, - State: g.State, - TaskType: g.TaskType, +// GetDatabaseMigrationBaseProperties implements the DatabaseMigrationBasePropertiesClassification interface for type DatabaseMigrationPropertiesCosmosDbMongo. +func (d *DatabaseMigrationPropertiesCosmosDbMongo) GetDatabaseMigrationBaseProperties() *DatabaseMigrationBaseProperties { + return &DatabaseMigrationBaseProperties{ + EndedOn: d.EndedOn, + Kind: d.Kind, + MigrationFailureError: d.MigrationFailureError, + MigrationOperationID: d.MigrationOperationID, + MigrationService: d.MigrationService, + MigrationStatus: d.MigrationStatus, + ProvisioningError: d.ProvisioningError, + ProvisioningState: d.ProvisioningState, + Scope: d.Scope, + StartedOn: d.StartedOn, } } -// GetUserTablesOracleTaskInput - Input for the task that gets the list of tables contained within a provided list of Oracle -// schemas. -type GetUserTablesOracleTaskInput struct { - // REQUIRED; Information for connecting to Oracle source - ConnectionInfo *OracleConnectionInfo +// DatabaseMigrationPropertiesSQLDb - Database Migration Resource properties for SQL database. +type DatabaseMigrationPropertiesSQLDb struct { + // REQUIRED + Kind *ResourceType - // REQUIRED; List of Oracle schemas for which to collect tables - SelectedSchemas []*string -} + // ID for current migration operation. + MigrationOperationID *string -// GetUserTablesOracleTaskOutput - Output for the task that gets the list of tables contained within a provided list of Oracle -// schemas. -type GetUserTablesOracleTaskOutput struct { - // READ-ONLY; The schema this result is for - SchemaName *string + // Resource Id of the Migration Service. + MigrationService *string - // READ-ONLY; List of valid tables found for this schema - Tables []*DatabaseTable + // Error message for migration provisioning failure, if any. + ProvisioningError *string - // READ-ONLY; Validation errors associated with the task - ValidationErrors []*ReportableException -} + // Resource Id of the target resource. + Scope *string + + // Name of the source database. + SourceDatabaseName *string + + // Source SQL Server connection details. + SourceSQLConnection *SQLConnectionInformation + + // List of tables to copy. + TableList []*string + + // Database collation to be used for the target database. + TargetDatabaseCollation *string + + // Target SQL DB connection details. + TargetSQLConnection *SQLConnectionInformation + + // READ-ONLY; Database migration end time. + EndedOn *time.Time + + // READ-ONLY; Error details in case of migration failure. + MigrationFailureError *ErrorInfo + + // READ-ONLY; Migration status. + MigrationStatus *string + + // READ-ONLY; Detailed migration status. Not included by default. + MigrationStatusDetails *SQLDbMigrationStatusDetails + + // READ-ONLY; Offline configuration. + OfflineConfiguration *SQLDbOfflineConfiguration + + // READ-ONLY; Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed + // and migration has started. + ProvisioningState *ProvisioningState + + // READ-ONLY; Name of the source sql server. + SourceServerName *string + + // READ-ONLY; Database migration start time. + StartedOn *time.Time +} + +// GetDatabaseMigrationBaseProperties implements the DatabaseMigrationBasePropertiesClassification interface for type DatabaseMigrationPropertiesSQLDb. +func (d *DatabaseMigrationPropertiesSQLDb) GetDatabaseMigrationBaseProperties() *DatabaseMigrationBaseProperties { + return &DatabaseMigrationBaseProperties{ + EndedOn: d.EndedOn, + Kind: d.Kind, + MigrationFailureError: d.MigrationFailureError, + MigrationOperationID: d.MigrationOperationID, + MigrationService: d.MigrationService, + MigrationStatus: d.MigrationStatus, + ProvisioningError: d.ProvisioningError, + ProvisioningState: d.ProvisioningState, + Scope: d.Scope, + StartedOn: d.StartedOn, + } +} + +// GetDatabaseMigrationProperties implements the DatabaseMigrationPropertiesClassification interface for type DatabaseMigrationPropertiesSQLDb. +func (d *DatabaseMigrationPropertiesSQLDb) GetDatabaseMigrationProperties() *DatabaseMigrationProperties { + return &DatabaseMigrationProperties{ + EndedOn: d.EndedOn, + Kind: d.Kind, + MigrationFailureError: d.MigrationFailureError, + MigrationOperationID: d.MigrationOperationID, + MigrationService: d.MigrationService, + MigrationStatus: d.MigrationStatus, + ProvisioningError: d.ProvisioningError, + ProvisioningState: d.ProvisioningState, + Scope: d.Scope, + SourceDatabaseName: d.SourceDatabaseName, + SourceSQLConnection: d.SourceSQLConnection, + SourceServerName: d.SourceServerName, + StartedOn: d.StartedOn, + TargetDatabaseCollation: d.TargetDatabaseCollation, + } +} + +// DatabaseMigrationPropertiesSQLMi - Database Migration Resource properties for SQL Managed Instance. +type DatabaseMigrationPropertiesSQLMi struct { + // REQUIRED + Kind *ResourceType + + // Backup configuration info. + BackupConfiguration *BackupConfiguration + + // ID for current migration operation. + MigrationOperationID *string + + // Resource Id of the Migration Service. + MigrationService *string + + // Offline configuration. + OfflineConfiguration *OfflineConfiguration + + // Error message for migration provisioning failure, if any. + ProvisioningError *string + + // Resource Id of the target resource. + Scope *string + + // Name of the source database. + SourceDatabaseName *string + + // Source SQL Server connection details. + SourceSQLConnection *SQLConnectionInformation + + // Database collation to be used for the target database. + TargetDatabaseCollation *string + + // READ-ONLY; Database migration end time. + EndedOn *time.Time + + // READ-ONLY; Error details in case of migration failure. + MigrationFailureError *ErrorInfo + + // READ-ONLY; Migration status. + MigrationStatus *string + + // READ-ONLY; Detailed migration status. Not included by default. + MigrationStatusDetails *MigrationStatusDetails + + // READ-ONLY; Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed + // and migration has started. + ProvisioningState *ProvisioningState + + // READ-ONLY; Name of the source sql server. + SourceServerName *string + + // READ-ONLY; Database migration start time. + StartedOn *time.Time +} + +// GetDatabaseMigrationBaseProperties implements the DatabaseMigrationBasePropertiesClassification interface for type DatabaseMigrationPropertiesSQLMi. +func (d *DatabaseMigrationPropertiesSQLMi) GetDatabaseMigrationBaseProperties() *DatabaseMigrationBaseProperties { + return &DatabaseMigrationBaseProperties{ + EndedOn: d.EndedOn, + Kind: d.Kind, + MigrationFailureError: d.MigrationFailureError, + MigrationOperationID: d.MigrationOperationID, + MigrationService: d.MigrationService, + MigrationStatus: d.MigrationStatus, + ProvisioningError: d.ProvisioningError, + ProvisioningState: d.ProvisioningState, + Scope: d.Scope, + StartedOn: d.StartedOn, + } +} + +// GetDatabaseMigrationProperties implements the DatabaseMigrationPropertiesClassification interface for type DatabaseMigrationPropertiesSQLMi. +func (d *DatabaseMigrationPropertiesSQLMi) GetDatabaseMigrationProperties() *DatabaseMigrationProperties { + return &DatabaseMigrationProperties{ + EndedOn: d.EndedOn, + Kind: d.Kind, + MigrationFailureError: d.MigrationFailureError, + MigrationOperationID: d.MigrationOperationID, + MigrationService: d.MigrationService, + MigrationStatus: d.MigrationStatus, + ProvisioningError: d.ProvisioningError, + ProvisioningState: d.ProvisioningState, + Scope: d.Scope, + SourceDatabaseName: d.SourceDatabaseName, + SourceSQLConnection: d.SourceSQLConnection, + SourceServerName: d.SourceServerName, + StartedOn: d.StartedOn, + TargetDatabaseCollation: d.TargetDatabaseCollation, + } +} + +// DatabaseMigrationPropertiesSQLVM - Database Migration Resource properties for SQL Virtual Machine. +type DatabaseMigrationPropertiesSQLVM struct { + // REQUIRED + Kind *ResourceType + + // Backup configuration info. + BackupConfiguration *BackupConfiguration + + // ID for current migration operation. + MigrationOperationID *string + + // Resource Id of the Migration Service. + MigrationService *string + + // Offline configuration. + OfflineConfiguration *OfflineConfiguration + + // Error message for migration provisioning failure, if any. + ProvisioningError *string + + // Resource Id of the target resource. + Scope *string + + // Name of the source database. + SourceDatabaseName *string + + // Source SQL Server connection details. + SourceSQLConnection *SQLConnectionInformation + + // Database collation to be used for the target database. + TargetDatabaseCollation *string + + // READ-ONLY; Database migration end time. + EndedOn *time.Time + + // READ-ONLY; Error details in case of migration failure. + MigrationFailureError *ErrorInfo + + // READ-ONLY; Migration status. + MigrationStatus *string + + // READ-ONLY; Detailed migration status. Not included by default. + MigrationStatusDetails *MigrationStatusDetails + + // READ-ONLY; Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed + // and migration has started. + ProvisioningState *ProvisioningState + + // READ-ONLY; Name of the source sql server. + SourceServerName *string + + // READ-ONLY; Database migration start time. + StartedOn *time.Time +} + +// GetDatabaseMigrationBaseProperties implements the DatabaseMigrationBasePropertiesClassification interface for type DatabaseMigrationPropertiesSQLVM. +func (d *DatabaseMigrationPropertiesSQLVM) GetDatabaseMigrationBaseProperties() *DatabaseMigrationBaseProperties { + return &DatabaseMigrationBaseProperties{ + EndedOn: d.EndedOn, + Kind: d.Kind, + MigrationFailureError: d.MigrationFailureError, + MigrationOperationID: d.MigrationOperationID, + MigrationService: d.MigrationService, + MigrationStatus: d.MigrationStatus, + ProvisioningError: d.ProvisioningError, + ProvisioningState: d.ProvisioningState, + Scope: d.Scope, + StartedOn: d.StartedOn, + } +} + +// GetDatabaseMigrationProperties implements the DatabaseMigrationPropertiesClassification interface for type DatabaseMigrationPropertiesSQLVM. +func (d *DatabaseMigrationPropertiesSQLVM) GetDatabaseMigrationProperties() *DatabaseMigrationProperties { + return &DatabaseMigrationProperties{ + EndedOn: d.EndedOn, + Kind: d.Kind, + MigrationFailureError: d.MigrationFailureError, + MigrationOperationID: d.MigrationOperationID, + MigrationService: d.MigrationService, + MigrationStatus: d.MigrationStatus, + ProvisioningError: d.ProvisioningError, + ProvisioningState: d.ProvisioningState, + Scope: d.Scope, + SourceDatabaseName: d.SourceDatabaseName, + SourceSQLConnection: d.SourceSQLConnection, + SourceServerName: d.SourceServerName, + StartedOn: d.StartedOn, + TargetDatabaseCollation: d.TargetDatabaseCollation, + } +} + +// DatabaseMigrationSQLDb - Database Migration Resource for SQL Database. +type DatabaseMigrationSQLDb struct { + // Database Migration Resource properties for SQL database. + Properties *DatabaseMigrationPropertiesSQLDb + + // READ-ONLY + ID *string + + // READ-ONLY + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemDataAutoGenerated + + // READ-ONLY + Type *string +} + +// DatabaseMigrationSQLMi - Database Migration Resource for SQL Managed Instance. +type DatabaseMigrationSQLMi struct { + // Database Migration Resource properties for SQL Managed Instance. + Properties *DatabaseMigrationPropertiesSQLMi + + // READ-ONLY + ID *string + + // READ-ONLY + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemDataAutoGenerated + + // READ-ONLY + Type *string +} + +// DatabaseMigrationSQLVM - Database Migration Resource for SQL Virtual Machine. +type DatabaseMigrationSQLVM struct { + // Database Migration Resource properties for SQL Virtual Machine. + Properties *DatabaseMigrationPropertiesSQLVM + + // READ-ONLY + ID *string + + // READ-ONLY + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemDataAutoGenerated + + // READ-ONLY + Type *string +} + +// DatabaseObjectName - A representation of the name of an object in a database +type DatabaseObjectName struct { + // Type of the object in the database + ObjectType *ObjectType + + // READ-ONLY; The unescaped name of the database containing the object + DatabaseName *string + + // READ-ONLY; The unescaped name of the object + ObjectName *string + + // READ-ONLY; The unescaped name of the schema containing the object + SchemaName *string +} + +// DatabaseSummaryResult - Summary of database results in the migration +type DatabaseSummaryResult struct { + // READ-ONLY; Migration end time + EndedOn *time.Time + + // READ-ONLY; Wildcard string prefix to use for querying all errors of the item + ErrorPrefix *string + + // READ-ONLY; Number of successfully completed items + ItemsCompletedCount *int64 + + // READ-ONLY; Number of items + ItemsCount *int64 + + // READ-ONLY; Name of the item + Name *string + + // READ-ONLY; Wildcard string prefix to use for querying all sub-tem results of the item + ResultPrefix *string + + // READ-ONLY; Size of the database in megabytes + SizeMB *float64 + + // READ-ONLY; Migration start time + StartedOn *time.Time + + // READ-ONLY; Current state of migration + State *MigrationState + + // READ-ONLY; Status message + StatusMessage *string +} + +// DatabaseTable - Table properties +type DatabaseTable struct { + // READ-ONLY; Indicates whether table is empty or not + HasRows *bool + + // READ-ONLY; Schema-qualified name of the table + Name *string +} + +// DeleteNode - Details of node to be deleted. +type DeleteNode struct { + // The name of integration runtime. + IntegrationRuntimeName *string + + // The name of node to delete. + NodeName *string +} + +// Error - Migration Task errors +type Error struct { + // Error type + Type *ErrorType + + // READ-ONLY; Error description + Message *string +} + +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info any + + // READ-ONLY; The additional info type. + Type *string +} + +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error details. + Details []*ErrorDetail + + // READ-ONLY; The error message. + Message *string + + // READ-ONLY; The error target. + Target *string +} + +// ErrorInfo - Error details +type ErrorInfo struct { + // READ-ONLY; Error code. + Code *string + + // READ-ONLY; Error message. + Message *string +} + +// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. +// (This also follows the OData error response format.). +type ErrorResponse struct { + // The error object. + Error *ErrorDetail +} + +// ExecutionStatistics - Description about the errors happen while performing migration validation +type ExecutionStatistics struct { + // CPU Time in millisecond(s) for the query execution + CPUTimeMs *float32 + + // Time taken in millisecond(s) for executing the query + ElapsedTimeMs *float32 + + // No. of query executions + ExecutionCount *int64 + + // Indicates whether the query resulted in an error + HasErrors *bool + + // List of sql Errors + SQLErrors []*string + + // Dictionary of sql query execution wait types and the respective statistics + WaitStats map[string]*WaitStatistics +} + +// FileList - OData page of files +type FileList struct { + // URL to load the next page of files + NextLink *string + + // List of files + Value []*ProjectFile +} + +// FileShare - File share information with Path, Username, and Password. +type FileShare struct { + // REQUIRED; The folder path for this share. + Path *string + + // Password credential used to connect to the share location. + Password *string + + // User name credential to connect to the share location + UserName *string +} + +// FileStorageInfo - File storage information. +type FileStorageInfo struct { + // Dictionary of + Headers map[string]*string + + // A URI that can be used to access the file content. + URI *string +} + +// GetProjectDetailsNonSQLTaskInput - Input for the task that reads configuration from project artifacts +type GetProjectDetailsNonSQLTaskInput struct { + // REQUIRED; A URL that points to the location to access project artifacts + ProjectLocation *string + + // REQUIRED; Name of the migration project + ProjectName *string +} + +// GetTdeCertificatesSQLTaskInput - Input for the task that gets TDE certificates in Base64 encoded format. +type GetTdeCertificatesSQLTaskInput struct { + // REQUIRED; Backup file share information for file share to be used for temporarily storing files. + BackupFileShare *FileShare + + // REQUIRED; Connection information for SQL Server + ConnectionInfo *SQLConnectionInfo + + // REQUIRED; List containing certificate names and corresponding password to use for encrypting the exported certificate. + SelectedCertificates []*SelectedCertificateInput +} + +// GetTdeCertificatesSQLTaskOutput - Output of the task that gets TDE certificates in Base64 encoded format. +type GetTdeCertificatesSQLTaskOutput struct { + // READ-ONLY; Mapping from certificate name to base 64 encoded format. + Base64EncodedCertificates *string + + // READ-ONLY; Validation errors + ValidationErrors []*ReportableException +} + +// GetTdeCertificatesSQLTaskProperties - Properties for the task that gets TDE certificates in Base64 encoded format. +type GetTdeCertificatesSQLTaskProperties struct { + // REQUIRED; Task type. + TaskType *TaskType + + // Key value pairs of client data to attach meta data information to task + ClientData map[string]*string + + // Task input + Input *GetTdeCertificatesSQLTaskInput + + // READ-ONLY; Array of command properties. + Commands []CommandPropertiesClassification + + // READ-ONLY; Array of errors. This is ignored if submitted. + Errors []*ODataError + + // READ-ONLY; Task output. This is ignored if submitted. + Output []*GetTdeCertificatesSQLTaskOutput + + // READ-ONLY; The state of the task. This is ignored if submitted. + State *TaskState +} + +// GetProjectTaskProperties implements the ProjectTaskPropertiesClassification interface for type GetTdeCertificatesSQLTaskProperties. +func (g *GetTdeCertificatesSQLTaskProperties) GetProjectTaskProperties() *ProjectTaskProperties { + return &ProjectTaskProperties{ + ClientData: g.ClientData, + Commands: g.Commands, + Errors: g.Errors, + State: g.State, + TaskType: g.TaskType, + } +} + +// GetUserTablesMySQLTaskInput - Input for the task that collects user tables for the given list of databases +type GetUserTablesMySQLTaskInput struct { + // REQUIRED; Connection information for SQL Server + ConnectionInfo *MySQLConnectionInfo + + // REQUIRED; List of database names to collect tables for + SelectedDatabases []*string +} + +// GetUserTablesMySQLTaskOutput - Output of the task that collects user tables for the given list of databases +type GetUserTablesMySQLTaskOutput struct { + // READ-ONLY; Mapping from database name to list of tables + DatabasesToTables *string + + // READ-ONLY; Result identifier + ID *string + + // READ-ONLY; Validation errors + ValidationErrors []*ReportableException +} + +// GetUserTablesMySQLTaskProperties - Properties for the task that collects user tables for the given list of databases +type GetUserTablesMySQLTaskProperties struct { + // REQUIRED; Task type. + TaskType *TaskType + + // Key value pairs of client data to attach meta data information to task + ClientData map[string]*string + + // Task input + Input *GetUserTablesMySQLTaskInput + + // READ-ONLY; Array of command properties. + Commands []CommandPropertiesClassification + + // READ-ONLY; Array of errors. This is ignored if submitted. + Errors []*ODataError + + // READ-ONLY; Task output. This is ignored if submitted. + Output []*GetUserTablesMySQLTaskOutput + + // READ-ONLY; The state of the task. This is ignored if submitted. + State *TaskState +} + +// GetProjectTaskProperties implements the ProjectTaskPropertiesClassification interface for type GetUserTablesMySQLTaskProperties. +func (g *GetUserTablesMySQLTaskProperties) GetProjectTaskProperties() *ProjectTaskProperties { + return &ProjectTaskProperties{ + ClientData: g.ClientData, + Commands: g.Commands, + Errors: g.Errors, + State: g.State, + TaskType: g.TaskType, + } +} + +// GetUserTablesOracleTaskInput - Input for the task that gets the list of tables contained within a provided list of Oracle +// schemas. +type GetUserTablesOracleTaskInput struct { + // REQUIRED; Information for connecting to Oracle source + ConnectionInfo *OracleConnectionInfo + + // REQUIRED; List of Oracle schemas for which to collect tables + SelectedSchemas []*string +} + +// GetUserTablesOracleTaskOutput - Output for the task that gets the list of tables contained within a provided list of Oracle +// schemas. +type GetUserTablesOracleTaskOutput struct { + // READ-ONLY; The schema this result is for + SchemaName *string + + // READ-ONLY; List of valid tables found for this schema + Tables []*DatabaseTable + + // READ-ONLY; Validation errors associated with the task + ValidationErrors []*ReportableException +} // GetUserTablesOracleTaskProperties - Properties for the task that collects user tables for the given list of Oracle schemas type GetUserTablesOracleTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -1607,7 +2316,7 @@ type GetUserTablesPostgreSQLTaskOutput struct { // GetUserTablesPostgreSQLTaskProperties - Properties for the task that collects user tables for the given list of databases type GetUserTablesPostgreSQLTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -1672,7 +2381,7 @@ type GetUserTablesSQLSyncTaskOutput struct { // GetUserTablesSQLSyncTaskProperties - Properties for the task that collects user tables for the given list of databases type GetUserTablesSQLSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -1711,6 +2420,9 @@ type GetUserTablesSQLTaskInput struct { // REQUIRED; List of database names to collect tables for SelectedDatabases []*string + + // encrypted key for secure fields + EncryptedKeyForSecureFields *string } // GetUserTablesSQLTaskOutput - Output of the task that collects user tables for the given list of databases @@ -1728,7 +2440,7 @@ type GetUserTablesSQLTaskOutput struct { // GetUserTablesSQLTaskProperties - Properties for the task that collects user tables for the given list of databases type GetUserTablesSQLTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -1736,6 +2448,9 @@ type GetUserTablesSQLTaskProperties struct { // Task input Input *GetUserTablesSQLTaskInput + // Task id + TaskID *string + // READ-ONLY; Array of command properties. Commands []CommandPropertiesClassification @@ -1775,7 +2490,7 @@ type InstallOCIDriverTaskOutput struct { // InstallOCIDriverTaskProperties - Properties for the task that installs an OCI driver. type InstallOCIDriverTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -1807,6 +2522,15 @@ func (i *InstallOCIDriverTaskProperties) GetProjectTaskProperties() *ProjectTask } } +// IntegrationRuntimeMonitoringData - Integration Runtime Monitoring Data. +type IntegrationRuntimeMonitoringData struct { + // READ-ONLY; The name of Integration Runtime. + Name *string + + // READ-ONLY; Integration Runtime node monitoring data. + Nodes []*NodeMonitoringData +} + // MiSQLConnectionInfo - Properties required to create a connection to Azure SQL database Managed instance type MiSQLConnectionInfo struct { // REQUIRED; Resource id for Azure SQL database Managed instance @@ -1849,7 +2573,7 @@ type MigrateMISyncCompleteCommandOutput struct { // Managed Instance. type MigrateMISyncCompleteCommandProperties struct { // REQUIRED; Command type. - CommandType *string + CommandType *CommandType // Command input Input *MigrateMISyncCompleteCommandInput @@ -1876,7 +2600,7 @@ func (m *MigrateMISyncCompleteCommandProperties) GetCommandProperties() *Command // MigrateMongoDbTaskProperties - Properties for the task that migrates data between MongoDB data sources type MigrateMongoDbTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -1933,6 +2657,9 @@ type MigrateMySQLAzureDbForMySQLOfflineTaskInput struct { // REQUIRED; Connection information for target Azure Database for MySQL TargetConnectionInfo *MySQLConnectionInfo + // encrypted key for secure fields + EncryptedKeyForSecureFields *string + // Setting to set the source server read only MakeSourceServerReadOnly *bool @@ -2154,7 +2881,7 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputTableLevel) GetMigrateMySQL // for MySQL for offline migrations type MigrateMySQLAzureDbForMySQLOfflineTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -2162,6 +2889,12 @@ type MigrateMySQLAzureDbForMySQLOfflineTaskProperties struct { // Task input Input *MigrateMySQLAzureDbForMySQLOfflineTaskInput + // whether the task can be cloned or not + IsCloneable *bool + + // Task id + TaskID *string + // READ-ONLY; Array of command properties. Commands []CommandPropertiesClassification @@ -2437,7 +3170,7 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputTableLevel) GetMigrateMySQLAzu // for MySQL for online migrations type MigrateMySQLAzureDbForMySQLSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -2473,7 +3206,7 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskProperties) GetProjectTaskProperties // PostgreSQL for online migrations type MigrateOracleAzureDbForPostgreSQLSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -2762,7 +3495,7 @@ func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel) GetMigrateOracl // for PostgreSQL migration task inputs type MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput struct { // Migration settings which tune the migration behavior - MigrationSetting map[string]*string + MigrationSetting map[string]any // Name of the database Name *string @@ -2778,6 +3511,9 @@ type MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput struct { // Target settings to tune target endpoint migration behavior TargetSetting map[string]*string + + // READ-ONLY; Result identifier + ID *string } // MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseTableInput - Selected tables for the migration @@ -2797,6 +3533,12 @@ type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput struct { // REQUIRED; Connection information for target Azure Database for PostgreSQL TargetConnectionInfo *PostgreSQLConnectionInfo + + // encrypted key for secure fields + EncryptedKeyForSecureFields *string + + // READ-ONLY; Migration start time + StartedOn *time.Time } // MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutput - Output for the task that migrates PostgreSQL databases to Azure Database @@ -2904,6 +3646,9 @@ type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError struct { // REQUIRED; Result type ResultType *string + // List of error events + Events []*SyncMigrationDatabaseErrorEvent + // READ-ONLY; Migration error Error *ReportableException @@ -2924,6 +3669,9 @@ type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel struct { // REQUIRED; Result type ResultType *string + // Number of databases to include + DatabaseCount *float32 + // READ-ONLY; Migration end time EndedOn *time.Time @@ -3024,14 +3772,23 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputTableLevel) GetMigra // Azure Database for PostgreSQL for online migrations type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string + // DateTime in UTC when the task was created + CreatedOn *string + // Task input Input *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput + // whether the task can be cloned or not + IsCloneable *bool + + // task id + TaskID *string + // READ-ONLY; Array of command properties. Commands []CommandPropertiesClassification @@ -3073,12 +3830,18 @@ type MigrateSQLServerDatabaseInput struct { // MigrateSQLServerSQLDbDatabaseInput - Database specific information for SQL to Azure SQL DB migration task inputs type MigrateSQLServerSQLDbDatabaseInput struct { + // id of the database + ID *string + // Whether to set database read only before migration MakeSourceDbReadOnly *bool // Name of the database Name *string + // Settings selected for DB schema migration. + SchemaSetting any + // Mapping of source to target tables TableMap map[string]*string @@ -3348,7 +4111,7 @@ func (m *MigrateSQLServerSQLDbSyncTaskOutputTableLevel) GetMigrateSQLServerSQLDb // Database for online migrations type MigrateSQLServerSQLDbSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -3391,6 +4154,12 @@ type MigrateSQLServerSQLDbTaskInput struct { // REQUIRED; Information for connecting to target TargetConnectionInfo *SQLConnectionInfo + // encrypted key for secure fields + EncryptedKeyForSecureFields *string + + // Date and time relative to UTC when the migration was started on + StartedOn *string + // 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 @@ -3668,14 +4437,23 @@ func (m *MigrateSQLServerSQLDbTaskOutputValidationResult) GetMigrateSQLServerSQL // MigrateSQLServerSQLDbTaskProperties - Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database type MigrateSQLServerSQLDbTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string + // DateTime in UTC when the task was created + CreatedOn *string + // Task input Input *MigrateSQLServerSQLDbTaskInput + // whether the task can be cloned or not + IsCloneable *bool + + // task id + TaskID *string + // READ-ONLY; Array of command properties. Commands []CommandPropertiesClassification @@ -3714,13 +4492,16 @@ type MigrateSQLServerSQLMIDatabaseInput struct { // Backup file share information for backing up this database. BackupFileShare *FileShare + + // id of the database + ID *string } // MigrateSQLServerSQLMISyncTaskInput - Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance // online scenario. type MigrateSQLServerSQLMISyncTaskInput struct { - // REQUIRED; 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 + // REQUIRED; Azure Active Directory Application the DMS (classic) instance will use to connect to the target instance of Azure + // SQL Database Managed Instance and the Azure Storage Account AzureApp *AzureActiveDirectoryApp // REQUIRED; Databases to migrate @@ -3737,6 +4518,9 @@ type MigrateSQLServerSQLMISyncTaskInput struct { // Backup file share information for all selected databases. BackupFileShare *FileShare + + // Number of database migrations to start in parallel + NumberOfParallelDatabaseMigrations *float32 } // MigrateSQLServerSQLMISyncTaskOutput - Output for task that migrates SQL Server databases to Azure SQL Database Managed @@ -3879,11 +4663,14 @@ func (m *MigrateSQLServerSQLMISyncTaskOutputMigrationLevel) GetMigrateSQLServerS // Managed Instance sync scenario type MigrateSQLServerSQLMISyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string + // DateTime in UTC when the task was created + CreatedOn *string + // Task input Input *MigrateSQLServerSQLMISyncTaskInput @@ -3936,11 +4723,17 @@ type MigrateSQLServerSQLMITaskInput struct { // are required to be provided in selectedDatabases. BackupMode *BackupMode + // encrypted key for secure fields + EncryptedKeyForSecureFields *string + // Agent Jobs to migrate. SelectedAgentJobs []*string // Logins to migrate. SelectedLogins []*string + + // Date and time relative to UTC when the migration was started on + StartedOn *string } // MigrateSQLServerSQLMITaskOutput - Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance. @@ -4155,14 +4948,26 @@ func (m *MigrateSQLServerSQLMITaskOutputMigrationLevel) GetMigrateSQLServerSQLMI // Instance type MigrateSQLServerSQLMITaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string + // DateTime in UTC when the task was created + CreatedOn *string + // Task input Input *MigrateSQLServerSQLMITaskInput + // whether the task can be cloned or not + IsCloneable *bool + + // parent task id + ParentTaskID *string + + // task id + TaskID *string + // READ-ONLY; Array of command properties. Commands []CommandPropertiesClassification @@ -4189,6 +4994,9 @@ func (m *MigrateSQLServerSQLMITaskProperties) GetProjectTaskProperties() *Projec // MigrateSchemaSQLServerSQLDbDatabaseInput - Database input for migrate schema Sql Server to Azure SQL Server scenario type MigrateSchemaSQLServerSQLDbDatabaseInput struct { + // Id of the source database + ID *string + // Name of source database Name *string @@ -4209,6 +5017,12 @@ type MigrateSchemaSQLServerSQLDbTaskInput struct { // REQUIRED; Information for connecting to target TargetConnectionInfo *SQLConnectionInfo + + // encrypted key for secure fields + EncryptedKeyForSecureFields *string + + // Migration start time + StartedOn *string } // MigrateSchemaSQLServerSQLDbTaskOutput - Output for the task that migrates Schema for SQL Server databases to Azure SQL @@ -4339,14 +5153,23 @@ func (m *MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel) GetMigrateSchemaSQ // SQL databases type MigrateSchemaSQLServerSQLDbTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string + // DateTime in UTC when the task was created + CreatedOn *string + // Task input Input *MigrateSchemaSQLServerSQLDbTaskInput + // whether the task can be cloned or not + IsCloneable *bool + + // Task id + TaskID *string + // READ-ONLY; Array of command properties. Commands []CommandPropertiesClassification @@ -4505,7 +5328,7 @@ func (m *MigrateSsisTaskOutputProjectLevel) GetMigrateSsisTaskOutput() *MigrateS // Managed Instance. type MigrateSsisTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -4558,7 +5381,10 @@ type MigrateSyncCompleteCommandOutput struct { // MigrateSyncCompleteCommandProperties - Properties for the command that completes sync migration for a database. type MigrateSyncCompleteCommandProperties struct { // REQUIRED; Command type. - CommandType *string + CommandType *CommandType + + // Command id + CommandID *string // Command input Input *MigrateSyncCompleteCommandInput @@ -4591,6 +5417,12 @@ type MigrationEligibilityInfo struct { ValidationMessages []*string } +// MigrationOperationInput - Migration Operation Input +type MigrationOperationInput struct { + // ID tracking migration operation. + MigrationOperationID *string +} + // MigrationReportResult - Migration validation report result, contains the url for downloading the generated report. type MigrationReportResult struct { // Migration validation result identifier @@ -4600,6 +5432,96 @@ type MigrationReportResult struct { ReportURL *string } +// MigrationService - A Migration Service. +type MigrationService struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // The Migration Service properties. + Properties *MigrationServiceProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// MigrationServiceListResult - A list of Migration Service. +type MigrationServiceListResult struct { + // READ-ONLY + NextLink *string + + // READ-ONLY + Value []*MigrationService +} + +// MigrationServiceProperties - The Migration Service properties. +type MigrationServiceProperties struct { + // READ-ONLY; Current state of the Integration runtime. + IntegrationRuntimeState *string + + // READ-ONLY; Provisioning state to track the async operation status. + ProvisioningState *ProvisioningState +} + +// MigrationServiceUpdate - An update to a Migration Service. +type MigrationServiceUpdate struct { + // Dictionary of + Tags map[string]*string +} + +// MigrationStatusDetails - Detailed status of current migration. +type MigrationStatusDetails struct { + // READ-ONLY; Backup sets that are currently active. + ActiveBackupSets []*SQLBackupSetInfo + + // READ-ONLY; Name of blob container. + BlobContainerName *string + + // READ-ONLY; Complete restore error message, if any + CompleteRestoreErrorMessage *string + + // READ-ONLY; File name that is currently being restored. + CurrentRestoringFilename *string + + // READ-ONLY; File upload blocking errors, if any. + FileUploadBlockingErrors []*string + + // READ-ONLY; Details of full backup set. + FullBackupSetInfo *SQLBackupSetInfo + + // READ-ONLY; Files that are not valid backup files. + InvalidFiles []*string + + // READ-ONLY; Whether full backup has been applied to the target database or not. + IsFullBackupRestored *bool + + // READ-ONLY; Last applied backup set information. + LastRestoredBackupSetInfo *SQLBackupSetInfo + + // READ-ONLY; Last restored file name. + LastRestoredFilename *string + + // READ-ONLY; Current State of Migration. + MigrationState *string + + // READ-ONLY; Total pending log backups. + PendingLogBackupsCount *int32 + + // READ-ONLY; Restore blocking reason, if any + RestoreBlockingReason *string +} + // MigrationTableMetadata - Metadata for tables selected in migration project type MigrationTableMetadata struct { // READ-ONLY; Source table name @@ -4697,10 +5619,31 @@ type MigrationValidationResult struct { Status *ValidationStatus } +// MongoConnectionInformation - Mongo Connection +type MongoConnectionInformation struct { + // ConnectionString to connect to Mongo. + ConnectionString *string + + // Host of mongo connection. + Host *string + + // Password to connect to Mongo. + Password *string + + // Port of mongo connection. + Port *int32 + + // Whether to UseSsl or UseTls to connect to Mongo. Default is true. + UseSSL *bool + + // User name to connect to Mongo. + UserName *string +} + // MongoDbCancelCommand - Properties for the command that cancels a migration in whole or in part type MongoDbCancelCommand struct { // REQUIRED; Command type. - CommandType *string + CommandType *CommandType // Command input Input *MongoDbCommandInput @@ -4873,9 +5816,37 @@ type MongoDbConnectionInfo struct { // REQUIRED; Type of connection info Type *string + // Additional connection settings + AdditionalSettings *string + + // Authentication type to use for connection + Authentication *AuthenticationType + + // Data source + DataSource *string + + // Whether to encrypt the connection + EncryptConnection *bool + EnforceSSL *bool + // Password credential. Password *string + // port for server + Port *int32 + + // server brand version + ServerBrandVersion *string + + // name of the server + ServerName *string + + // server version + ServerVersion *string + + // Whether to trust the server certificate + TrustServerCertificate *bool + // User name UserName *string } @@ -5014,7 +5985,7 @@ type MongoDbError struct { // MongoDbFinishCommand - Properties for the command that finishes a migration in whole or in part type MongoDbFinishCommand struct { // REQUIRED; Command type. - CommandType *string + CommandType *CommandType // Command input Input *MongoDbFinishCommandInput @@ -5213,7 +6184,7 @@ func (m *MongoDbProgress) GetMongoDbProgress() *MongoDbProgress { return m } // MongoDbRestartCommand - Properties for the command that restarts a migration in whole or in part type MongoDbRestartCommand struct { // REQUIRED; Command type. - CommandType *string + CommandType *CommandType // Command input Input *MongoDbCommandInput @@ -5257,7 +6228,7 @@ type MongoDbShardKeySetting struct { // REQUIRED; The fields within the shard key Fields []*MongoDbShardKeyField - // REQUIRED; Whether the shard key is unique + // Whether the shard key is unique IsUnique *bool } @@ -5273,6 +6244,42 @@ type MongoDbThrottlingSettings struct { MinFreeMemoryMb *int32 } +// MongoMigrationCollection - Mongo source and target database and collection details. +type MongoMigrationCollection struct { + // Source collection name. + SourceCollection *string + + // Source database name. + SourceDatabase *string + + // Target collection name. + TargetCollection *string + + // Target database name. + TargetDatabase *string + + // READ-ONLY; Detailed migration status. Not included by default. + MigrationProgressDetails *MongoMigrationProgressDetails +} + +// MongoMigrationProgressDetails - Detailed status of collection migration. +type MongoMigrationProgressDetails struct { + // READ-ONLY; Migration duration + DurationInSeconds *int32 + + // READ-ONLY; Migration Error + MigrationError *string + + // READ-ONLY; Migration Status + MigrationStatus *MongoMigrationStatus + + // READ-ONLY; Processed Document Count + ProcessedDocumentCount *int64 + + // READ-ONLY; Source Document Count + SourceDocumentCount *int64 +} + // MySQLConnectionInfo - Information for connecting to MySQL server type MySQLConnectionInfo struct { // REQUIRED; Port for Server @@ -5284,6 +6291,15 @@ type MySQLConnectionInfo struct { // REQUIRED; Type of connection info Type *string + // Additional connection settings + AdditionalSettings *string + + // Authentication type to use for connection + Authentication *AuthenticationType + + // Data source + DataSource *string + // Whether to encrypt the connection EncryptConnection *bool @@ -5317,11 +6333,40 @@ type NameAvailabilityResponse struct { // The localized reason why the name is not available, if nameAvailable is false Message *string - // If true, the name is valid and available. If false, 'reason' describes why not. - NameAvailable *bool + // If true, the name is valid and available. If false, 'reason' describes why not. + NameAvailable *bool + + // The reason why the name is not available, if nameAvailable is false + Reason *NameCheckFailureReason +} + +type NodeMonitoringData struct { + // READ-ONLY; Unmatched properties from the message are deserialized in this collection. + AdditionalProperties map[string]any + + // READ-ONLY; Available memory (MB) on the integration runtime node. + AvailableMemoryInMB *int32 + + // READ-ONLY; CPU percentage on the integration runtime node. + CPUUtilization *int32 + + // READ-ONLY; Maximum concurrent jobs on the integration runtime node. + ConcurrentJobsLimit *int32 + + // READ-ONLY; The number of jobs currently running on the integration runtime node. + ConcurrentJobsRunning *int32 + + // READ-ONLY; The maximum concurrent jobs in this integration runtime. + MaxConcurrentJobs *int32 + + // READ-ONLY; Name of the integration runtime node. + NodeName *string + + // READ-ONLY; Received bytes on the integration runtime node. + ReceivedBytes *float64 - // The reason why the name is not available, if nameAvailable is false - Reason *NameCheckFailureReason + // READ-ONLY; Sent bytes on the integration runtime node. + SentBytes *float64 } // NonSQLDataMigrationTable - Defines metadata for table to be migrated @@ -5411,6 +6456,57 @@ type ODataError struct { Message *string } +// OfflineConfiguration - Offline configuration +type OfflineConfiguration struct { + // 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. + LastBackupName *string + + // Offline migration + Offline *bool +} + +// OperationListResult - Result of the request to list SQL operations. +type OperationListResult struct { + // READ-ONLY + NextLink *string + + // READ-ONLY + Value []*OperationsDefinition +} + +type OperationsDefinition struct { + // Indicates whether the operation is a data action + IsDataAction *bool + + // READ-ONLY + Display *OperationsDisplayDefinition + + // READ-ONLY + Name *string + + // READ-ONLY + Origin *OperationOrigin + + // READ-ONLY; Dictionary of + Properties map[string]any +} + +type OperationsDisplayDefinition struct { + // READ-ONLY + Description *string + + // READ-ONLY + Operation *string + + // READ-ONLY + Provider *string + + // READ-ONLY + Resource *string +} + // OracleConnectionInfo - Information for connecting to Oracle server type OracleConnectionInfo struct { // REQUIRED; EZConnect or TNSName connection string. @@ -5419,9 +6515,21 @@ type OracleConnectionInfo struct { // REQUIRED; Type of connection info Type *string + // Authentication type to use for connection + Authentication *AuthenticationType + // Password credential. Password *string + // port for server + Port *int32 + + // name of the server + ServerName *string + + // server version + ServerVersion *string + // User name UserName *string } @@ -5476,6 +6584,15 @@ type PostgreSQLConnectionInfo struct { // REQUIRED; Type of connection info Type *string + // Additional connection settings + AdditionalSettings *string + + // Authentication type to use for connection + Authentication *AuthenticationType + + // Data source + DataSource *string + // Name of the database DatabaseName *string @@ -5485,6 +6602,12 @@ type PostgreSQLConnectionInfo struct { // Password credential. Password *string + // server brand version + ServerBrandVersion *string + + // server version + ServerVersion *string + // Whether to trust the server certificate TrustServerCertificate *bool @@ -5503,25 +6626,26 @@ func (p *PostgreSQLConnectionInfo) GetConnectionInfo() *ConnectionInfo { // Project - A project resource type Project struct { - // REQUIRED; Resource location. + // HTTP strong entity tag value. This is ignored if submitted. + Etag *string Location *string // Project properties Properties *ProjectProperties - // Resource tags. + // Dictionary of Tags map[string]*string - // READ-ONLY; Resource ID. + // READ-ONLY ID *string - // READ-ONLY; Resource name. + // READ-ONLY Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData + // READ-ONLY + SystemData *SystemDataAutoGenerated - // READ-ONLY; Resource type. + // READ-ONLY Type *string } @@ -5540,7 +6664,7 @@ type ProjectFile struct { Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData + SystemData *SystemDataAutoGenerated // READ-ONLY; Resource type. Type *string @@ -5608,6 +6732,9 @@ type ProjectProperties struct { // REQUIRED; Target platform for the project TargetPlatform *ProjectTargetPlatform + // Field that defines the Azure active directory application info, used to connect to the target Azure resource + AzureAuthenticationInfo *AzureActiveDirectoryApp + // List of DatabaseInfo DatabasesInfo []*DatabaseInfo @@ -5639,17 +6766,17 @@ type ProjectTask struct { Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData + SystemData *SystemDataAutoGenerated // READ-ONLY; Resource type. Type *string } -// ProjectTaskProperties - Base class for all types of DMS task properties. If task is not supported by current client, this -// object is returned. +// ProjectTaskProperties - Base class for all types of DMS (classic) task properties. If task is not supported by current +// client, this object is returned. type ProjectTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -5667,6 +6794,36 @@ type ProjectTaskProperties struct { // GetProjectTaskProperties implements the ProjectTaskPropertiesClassification interface for type ProjectTaskProperties. func (p *ProjectTaskProperties) GetProjectTaskProperties() *ProjectTaskProperties { return p } +// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a +// location +type ProxyResource struct { + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +type ProxyResourceAutoGenerated struct { + // READ-ONLY + ID *string + + // READ-ONLY + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemDataAutoGenerated + + // READ-ONLY + Type *string +} + // QueryAnalysisValidationResult - Results for query analysis comparison between the source and target type QueryAnalysisValidationResult struct { // List of queries executed and it's execution results in source and target @@ -5727,6 +6884,18 @@ type QuotaName struct { Value *string } +// RegenAuthKeys - An authentication key to regenerate. +type RegenAuthKeys struct { + // The first authentication key. + AuthKey1 *string + + // The second authentication key. + AuthKey2 *string + + // The name of authentication key to generate. + KeyName *string +} + // ReportableException - Exception object for all custom exceptions type ReportableException struct { // Actionable steps for this exception @@ -5748,8 +6917,23 @@ type ReportableException struct { StackTrace *string } -// Resource - ARM resource. +// Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// ResourceAutoGenerated - ARM resource. +type ResourceAutoGenerated struct { // READ-ONLY; Resource ID. ID *string @@ -5760,7 +6944,7 @@ type Resource struct { Type *string } -// ResourceSKU - Describes an available DMS SKU. +// ResourceSKU - Describes an available DMS (classic) SKU. type ResourceSKU struct { // READ-ONLY; The api versions that support this SKU. APIVersions []*string @@ -5795,7 +6979,7 @@ type ResourceSKU struct { // READ-ONLY; The Size of the SKU. Size *string - // READ-ONLY; Specifies the tier of DMS in a scale set. + // READ-ONLY; Specifies the tier of DMS (classic) in a scale set. Tier *string } @@ -5848,15 +7032,79 @@ type ResourceSKURestrictions struct { Values []*string } -// ResourceSKUsResult - The DMS List SKUs operation response. +// ResourceSKUsResult - The DMS (classic) List SKUs operation response. type ResourceSKUsResult struct { // REQUIRED; The list of SKUs available for the subscription. Value []*ResourceSKU - // The uri to fetch the next page of DMS SKUs. Call ListNext() with this to fetch the next page of DMS SKUs. + // The uri to fetch the next page of DMS (classic) SKUs. Call ListNext() with this to fetch the next page of DMS (classic) + // SKUs. NextLink *string } +// SQLBackupFileInfo - Information of backup file +type SQLBackupFileInfo struct { + // READ-ONLY; Copy Duration in seconds + CopyDuration *int32 + + // READ-ONLY; Copy throughput in KBps + CopyThroughput *float64 + + // READ-ONLY; Bytes read + DataRead *int64 + + // READ-ONLY; Bytes written + DataWritten *int64 + + // READ-ONLY; Media family sequence number + FamilySequenceNumber *int32 + + // READ-ONLY; File name. + FileName *string + + // READ-ONLY; Status of the file. (Initial, Uploading, Uploaded, Restoring, Restored or Skipped) + Status *string + + // READ-ONLY; File size in bytes + TotalSize *int64 +} + +// SQLBackupSetInfo - Information of backup set +type SQLBackupSetInfo struct { + // READ-ONLY; Backup end time. + BackupFinishDate *time.Time + + // READ-ONLY; Backup set id. + BackupSetID *string + + // READ-ONLY; Backup start date. + BackupStartDate *time.Time + + // READ-ONLY; Backup type. + BackupType *string + + // READ-ONLY; Media family count + FamilyCount *int32 + + // READ-ONLY; First LSN of the backup set. + FirstLSN *string + + // READ-ONLY; Has Backup Checksums + HasBackupChecksums *bool + + // READ-ONLY; The reasons why the backup set is ignored + IgnoreReasons []*string + + // READ-ONLY; Whether this backup set has been restored or not. + IsBackupRestored *bool + + // READ-ONLY; Last LSN of the backup set. + LastLSN *string + + // READ-ONLY; List of files in the backup set. + ListOfBackupFiles []*SQLBackupFileInfo +} + // SQLConnectionInfo - Information for connecting to SQL database server type SQLConnectionInfo struct { // REQUIRED; Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber @@ -5880,6 +7128,21 @@ type SQLConnectionInfo struct { // Server platform type for connection Platform *SQLSourcePlatform + // Port for Server + Port *int32 + + // Represents the ID of an HTTP resource represented by an Azure resource provider. + ResourceID *string + + // server brand version + ServerBrandVersion *string + + // name of the server + ServerName *string + + // server version + ServerVersion *string + // Whether to trust the server certificate TrustServerCertificate *bool @@ -5896,6 +7159,104 @@ func (s *SQLConnectionInfo) GetConnectionInfo() *ConnectionInfo { } } +// SQLConnectionInformation - Source SQL Connection +type SQLConnectionInformation struct { + // Authentication type. + Authentication *string + + // Data source. + DataSource *string + + // Whether to encrypt connection or not. + EncryptConnection *bool + + // Password to connect to source SQL. + Password *string + + // Whether to trust server certificate or not. + TrustServerCertificate *bool + + // User name to connect to source SQL. + UserName *string +} + +// SQLDbMigrationStatusDetails - Detailed status of current Sql Db migration. +type SQLDbMigrationStatusDetails struct { + // READ-ONLY; Details on progress of ADF copy activities. + ListOfCopyProgressDetails []*CopyProgressDetails + + // READ-ONLY; Current State of Migration. + MigrationState *string + + // READ-ONLY; Sql Data Copy errors, if any. + SQLDataCopyErrors []*string +} + +// SQLDbOfflineConfiguration - Offline configuration +type SQLDbOfflineConfiguration struct { + // READ-ONLY; Offline migration + Offline *bool +} + +// SQLFileShare - File share +type SQLFileShare struct { + // Password for username to access file share location. + Password *string + + // Location as SMB share or local drive where backups are placed. + Path *string + + // Username to access the file share location for backups. + Username *string +} + +// SQLMigrationListResult - A list of SQL Migration Service. +type SQLMigrationListResult struct { + // READ-ONLY + NextLink *string + + // READ-ONLY + Value []*SQLMigrationService +} + +// SQLMigrationService - A SQL Migration Service. +type SQLMigrationService struct { + Location *string + + // The SQL Migration Service properties. + Properties *SQLMigrationServiceProperties + + // Dictionary of + Tags map[string]*string + + // READ-ONLY + ID *string + + // READ-ONLY + Name *string + + // READ-ONLY + SystemData *SystemDataAutoGenerated + + // READ-ONLY + Type *string +} + +// SQLMigrationServiceProperties - The SQL Migration Service properties. +type SQLMigrationServiceProperties struct { + // READ-ONLY; Current state of the Integration runtime. + IntegrationRuntimeState *string + + // READ-ONLY; Provisioning state to track the async operation status. + ProvisioningState *string +} + +// SQLMigrationServiceUpdate - An update to a SQL Migration Service. +type SQLMigrationServiceUpdate struct { + // Dictionary of + Tags map[string]*string +} + // SQLMigrationTaskInput - Base class for migration task input type SQLMigrationTaskInput struct { // REQUIRED; Information for connecting to source @@ -5908,8 +7269,8 @@ type SQLMigrationTaskInput struct { // SQLServerSQLMISyncTaskInput - Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance // online scenario. type SQLServerSQLMISyncTaskInput struct { - // REQUIRED; 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 + // REQUIRED; Azure Active Directory Application the DMS (classic) instance will use to connect to the target instance of Azure + // SQL Database Managed Instance and the Azure Storage Account AzureApp *AzureActiveDirectoryApp // REQUIRED; Databases to migrate @@ -5960,6 +7321,9 @@ type SchemaMigrationSetting struct { // Resource Identifier of a file resource containing the uploaded schema file FileID *string + // Name of the file resource containing the uploaded schema file + FileName *string + // Option on how to migrate the schema SchemaOption *SchemaMigrationOption } @@ -5994,16 +7358,14 @@ type ServerProperties struct { ServerVersion *string } -// Service - A Database Migration Service resource +// Service - An Azure Database Migration Service (classic) resource type Service struct { - // REQUIRED; Resource location. - Location *string - // HTTP strong entity tag value. Ignored if submitted Etag *string // The resource kind. Only 'vm' (the default) is supported. - Kind *string + Kind *string + Location *string // Custom service properties Properties *ServiceProperties @@ -6011,19 +7373,19 @@ type Service struct { // Service SKU SKU *ServiceSKU - // Resource tags. + // Dictionary of Tags map[string]*string - // READ-ONLY; Resource ID. + // READ-ONLY ID *string - // READ-ONLY; Resource name. + // READ-ONLY Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData + // READ-ONLY + SystemData *SystemDataAutoGenerated - // READ-ONLY; Resource type. + // READ-ONLY Type *string } @@ -6036,7 +7398,7 @@ type ServiceList struct { Value []*Service } -// ServiceOperation - Description of an action supported by the Database Migration Service +// ServiceOperation - Description of an action supported by the Azure Database Migration Service (classic) type ServiceOperation struct { // Localized display text Display *ServiceOperationDisplay @@ -6069,10 +7431,13 @@ type ServiceOperationList struct { Value []*ServiceOperation } -// ServiceProperties - Properties of the Database Migration Service instance +// ServiceProperties - Properties of the Azure Database Migration Service (classic) instance type ServiceProperties struct { - // REQUIRED; The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined - VirtualSubnetID *string + // The time delay before the service is auto-stopped when idle. + AutoStopDelay *string + + // Whether service resources should be deleted when stopped. (Turned on by default) + DeleteResourcesOnStop *bool // The public key of the service, used to encrypt secrets sent to the service PublicKey *string @@ -6080,6 +7445,9 @@ type ServiceProperties struct { // The ID of the Microsoft.Network/networkInterfaces resource which the service have VirtualNicID *string + // The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + VirtualSubnetID *string + // READ-ONLY; The resource's provisioning state ProvisioningState *ServiceProvisioningState } @@ -6115,6 +7483,9 @@ type ServiceSKUList struct { // ServiceStatusResponse - Service health status type ServiceStatusResponse struct { + // Agent Configuration + AgentConfiguration any + // The DMS instance agent version AgentVersion *string @@ -6129,6 +7500,18 @@ type ServiceStatusResponse struct { VMSize *string } +// SourceLocation - Source Location details of backups. +type SourceLocation struct { + // Source Azure Blob. + AzureBlob *AzureBlob + + // Source File share. + FileShare *SQLFileShare + + // READ-ONLY; Backup storage Type. + FileStorageType *string +} + // SsisMigrationInfo - SSIS migration info with SSIS store type, overwrite policy. type SsisMigrationInfo struct { // The overwrite option for the SSIS environment migration @@ -6137,7 +7520,7 @@ type SsisMigrationInfo struct { // The overwrite option for the SSIS project migration ProjectOverwriteOption *SsisMigrationOverwriteOption - // The SSIS store type of source, only SSIS catalog is supported now in DMS + // The SSIS store type of source, only SSIS catalog is supported now in DMS (classic) SsisStoreType *SsisStoreType } @@ -6186,6 +7569,28 @@ type SystemData struct { LastModifiedByType *CreatedByType } +type SystemDataAutoGenerated struct { + CreatedAt *time.Time + CreatedBy *string + + // The type of identity that created the resource. + CreatedByType *CreatedByType + LastModifiedAt *time.Time + LastModifiedBy *string + + // The type of identity that created the resource. + LastModifiedByType *CreatedByType +} + +// TargetLocation - Target Location details for optional copy of backups +type TargetLocation struct { + // Storage Account Key. + AccountKey *string + + // Resource Id of the storage account copying backups. + StorageAccountResourceID *string +} + // TaskList - OData page of tasks type TaskList struct { // URL to load the next page of tasks @@ -6195,24 +7600,44 @@ type TaskList struct { Value []*ProjectTask } -// TrackedResource - ARM tracked top level resource. +// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' +// and a 'location' type TrackedResource struct { - // REQUIRED; Resource location. + // REQUIRED; The geo-location where the resource lives Location *string // Resource tags. Tags map[string]*string - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; Resource type. + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +type TrackedResourceAutoGenerated struct { + Location *string + + // Dictionary of + Tags map[string]*string + + // READ-ONLY + ID *string + + // READ-ONLY + Name *string + + // READ-ONLY + SystemData *SystemDataAutoGenerated + + // READ-ONLY Type *string } @@ -6234,7 +7659,7 @@ type UploadOCIDriverTaskOutput struct { // UploadOCIDriverTaskProperties - Properties for the task that uploads an OCI driver. type UploadOCIDriverTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -6270,7 +7695,7 @@ func (u *UploadOCIDriverTaskProperties) GetProjectTaskProperties() *ProjectTaskP // Azure SQL DB sync migrations type ValidateMigrationInputSQLServerSQLDbSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -6305,8 +7730,8 @@ func (v *ValidateMigrationInputSQLServerSQLDbSyncTaskProperties) GetProjectTaskP // ValidateMigrationInputSQLServerSQLMISyncTaskInput - Input for task that migrates SQL Server databases to Azure SQL Database // Managed Instance online scenario. type ValidateMigrationInputSQLServerSQLMISyncTaskInput struct { - // REQUIRED; 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 + // REQUIRED; Azure Active Directory Application the DMS (classic) instance will use to connect to the target instance of Azure + // SQL Database Managed Instance and the Azure Storage Account AzureApp *AzureActiveDirectoryApp // REQUIRED; Databases to migrate @@ -6342,7 +7767,7 @@ type ValidateMigrationInputSQLServerSQLMISyncTaskOutput struct { // Azure SQL Database Managed Instance sync scenario type ValidateMigrationInputSQLServerSQLMISyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -6431,7 +7856,7 @@ type ValidateMigrationInputSQLServerSQLMITaskOutput struct { // SQL Database Managed Instance type ValidateMigrationInputSQLServerSQLMITaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -6466,7 +7891,7 @@ func (v *ValidateMigrationInputSQLServerSQLMITaskProperties) GetProjectTaskPrope // ValidateMongoDbTaskProperties - Properties for the task that validates a migration between MongoDB data sources type ValidateMongoDbTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string @@ -6502,7 +7927,7 @@ func (v *ValidateMongoDbTaskProperties) GetProjectTaskProperties() *ProjectTaskP // Azure Database for PostgreSQL for online migrations type ValidateOracleAzureDbForPostgreSQLSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string + TaskType *TaskType // Key value pairs of client data to attach meta data information to task ClientData map[string]*string diff --git a/sdk/resourcemanager/datamigration/armdatamigration/models_serde.go b/sdk/resourcemanager/datamigration/armdatamigration/models_serde.go index 7bd877b5b2d5..40339080c62f 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/models_serde.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/models_serde.go @@ -46,6 +46,37 @@ func (a *APIError) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AuthenticationKeys. +func (a AuthenticationKeys) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authKey1", a.AuthKey1) + populate(objectMap, "authKey2", a.AuthKey2) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthenticationKeys. +func (a *AuthenticationKeys) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authKey1": + err = unpopulate(val, "AuthKey1", &a.AuthKey1) + delete(rawMsg, key) + case "authKey2": + err = unpopulate(val, "AuthKey2", &a.AuthKey2) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AvailableServiceSKU. func (a AvailableServiceSKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -164,6 +195,7 @@ func (a AzureActiveDirectoryApp) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "appKey", a.AppKey) populate(objectMap, "applicationId", a.ApplicationID) + populate(objectMap, "ignoreAzurePermissions", a.IgnoreAzurePermissions) populate(objectMap, "tenantId", a.TenantID) return json.Marshal(objectMap) } @@ -183,6 +215,9 @@ func (a *AzureActiveDirectoryApp) UnmarshalJSON(data []byte) error { case "applicationId": err = unpopulate(val, "ApplicationID", &a.ApplicationID) delete(rawMsg, key) + case "ignoreAzurePermissions": + err = unpopulate(val, "IgnoreAzurePermissions", &a.IgnoreAzurePermissions) + delete(rawMsg, key) case "tenantId": err = unpopulate(val, "TenantID", &a.TenantID) delete(rawMsg, key) @@ -194,6 +229,72 @@ func (a *AzureActiveDirectoryApp) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AzureBlob. +func (a AzureBlob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountKey", a.AccountKey) + populate(objectMap, "blobContainerName", a.BlobContainerName) + populate(objectMap, "storageAccountResourceId", a.StorageAccountResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlob. +func (a *AzureBlob) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accountKey": + err = unpopulate(val, "AccountKey", &a.AccountKey) + delete(rawMsg, key) + case "blobContainerName": + err = unpopulate(val, "BlobContainerName", &a.BlobContainerName) + delete(rawMsg, key) + case "storageAccountResourceId": + err = unpopulate(val, "StorageAccountResourceID", &a.StorageAccountResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupConfiguration. +func (b BackupConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceLocation", b.SourceLocation) + populate(objectMap, "targetLocation", b.TargetLocation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupConfiguration. +func (b *BackupConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sourceLocation": + err = unpopulate(val, "SourceLocation", &b.SourceLocation) + delete(rawMsg, key) + case "targetLocation": + err = unpopulate(val, "TargetLocation", &b.TargetLocation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type BackupFileInfo. func (b BackupFileInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -386,7 +487,7 @@ func (c CheckOCIDriverTaskProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "input", c.Input) populate(objectMap, "output", c.Output) populate(objectMap, "state", c.State) - objectMap["taskType"] = "Service.Check.OCI" + objectMap["taskType"] = TaskTypeServiceCheckOCI return json.Marshal(objectMap) } @@ -472,7 +573,7 @@ func (c ConnectToMongoDbTaskProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "input", c.Input) populate(objectMap, "output", c.Output) populate(objectMap, "state", c.State) - objectMap["taskType"] = "Connect.MongoDb" + objectMap["taskType"] = TaskTypeConnectMongoDb return json.Marshal(objectMap) } @@ -562,7 +663,7 @@ func (c ConnectToSourceMySQLTaskProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "input", c.Input) populate(objectMap, "output", c.Output) populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToSource.MySql" + objectMap["taskType"] = TaskTypeConnectToSourceMySQL return json.Marshal(objectMap) } @@ -722,7 +823,7 @@ func (c ConnectToSourceOracleSyncTaskProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "input", c.Input) populate(objectMap, "output", c.Output) populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToSource.Oracle.Sync" + objectMap["taskType"] = TaskTypeConnectToSourceOracleSync return json.Marshal(objectMap) } @@ -843,7 +944,7 @@ func (c ConnectToSourcePostgreSQLSyncTaskProperties) MarshalJSON() ([]byte, erro populate(objectMap, "input", c.Input) populate(objectMap, "output", c.Output) populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToSource.PostgreSql.Sync" + objectMap["taskType"] = TaskTypeConnectToSourcePostgreSQLSync return json.Marshal(objectMap) } @@ -894,7 +995,7 @@ func (c ConnectToSourceSQLServerSyncTaskProperties) MarshalJSON() ([]byte, error populate(objectMap, "input", c.Input) populate(objectMap, "output", c.Output) populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToSource.SqlServer.Sync" + objectMap["taskType"] = TaskTypeConnectToSourceSQLServerSync return json.Marshal(objectMap) } @@ -944,6 +1045,7 @@ func (c ConnectToSourceSQLServerTaskInput) MarshalJSON() ([]byte, error) { populate(objectMap, "collectDatabases", c.CollectDatabases) populate(objectMap, "collectLogins", c.CollectLogins) populate(objectMap, "collectTdeCertificateInfo", c.CollectTdeCertificateInfo) + populate(objectMap, "encryptedKeyForSecureFields", c.EncryptedKeyForSecureFields) populate(objectMap, "sourceConnectionInfo", c.SourceConnectionInfo) populate(objectMap, "validateSsisCatalogOnly", c.ValidateSsisCatalogOnly) return json.Marshal(objectMap) @@ -973,6 +1075,9 @@ func (c *ConnectToSourceSQLServerTaskInput) UnmarshalJSON(data []byte) error { case "collectTdeCertificateInfo": err = unpopulate(val, "CollectTdeCertificateInfo", &c.CollectTdeCertificateInfo) delete(rawMsg, key) + case "encryptedKeyForSecureFields": + err = unpopulate(val, "EncryptedKeyForSecureFields", &c.EncryptedKeyForSecureFields) + delete(rawMsg, key) case "sourceConnectionInfo": err = unpopulate(val, "SourceConnectionInfo", &c.SourceConnectionInfo) delete(rawMsg, key) @@ -1247,7 +1352,8 @@ func (c ConnectToSourceSQLServerTaskProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "input", c.Input) populate(objectMap, "output", c.Output) populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToSource.SqlServer" + populate(objectMap, "taskId", c.TaskID) + objectMap["taskType"] = TaskTypeConnectToSourceSQLServer return json.Marshal(objectMap) } @@ -1278,6 +1384,9 @@ func (c *ConnectToSourceSQLServerTaskProperties) UnmarshalJSON(data []byte) erro case "state": err = unpopulate(val, "State", &c.State) delete(rawMsg, key) + case "taskId": + err = unpopulate(val, "TaskID", &c.TaskID) + delete(rawMsg, key) case "taskType": err = unpopulate(val, "TaskType", &c.TaskType) delete(rawMsg, key) @@ -1376,7 +1485,7 @@ func (c ConnectToTargetAzureDbForMySQLTaskProperties) MarshalJSON() ([]byte, err populate(objectMap, "input", c.Input) populate(objectMap, "output", c.Output) populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToTarget.AzureDbForMySql" + objectMap["taskType"] = TaskTypeConnectToTargetAzureDbForMySQL return json.Marshal(objectMap) } @@ -1501,7 +1610,7 @@ func (c ConnectToTargetAzureDbForPostgreSQLSyncTaskProperties) MarshalJSON() ([] populate(objectMap, "input", c.Input) populate(objectMap, "output", c.Output) populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + objectMap["taskType"] = TaskTypeConnectToTargetAzureDbForPostgreSQLSync return json.Marshal(objectMap) } @@ -1653,7 +1762,7 @@ func (c ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskProperties) MarshalJSON populate(objectMap, "input", c.Input) populate(objectMap, "output", c.Output) populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync" + objectMap["taskType"] = TaskTypeConnectToTargetOracleAzureDbForPostgreSQLSync return json.Marshal(objectMap) } @@ -1735,7 +1844,7 @@ func (c ConnectToTargetSQLDbSyncTaskProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "input", c.Input) populate(objectMap, "output", c.Output) populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToTarget.SqlDb.Sync" + objectMap["taskType"] = TaskTypeConnectToTargetSQLDbSync return json.Marshal(objectMap) } @@ -1780,6 +1889,7 @@ func (c *ConnectToTargetSQLDbSyncTaskProperties) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type ConnectToTargetSQLDbTaskInput. func (c ConnectToTargetSQLDbTaskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "queryObjectCounts", c.QueryObjectCounts) populate(objectMap, "targetConnectionInfo", c.TargetConnectionInfo) return json.Marshal(objectMap) } @@ -1793,6 +1903,9 @@ func (c *ConnectToTargetSQLDbTaskInput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "queryObjectCounts": + err = unpopulate(val, "QueryObjectCounts", &c.QueryObjectCounts) + delete(rawMsg, key) case "targetConnectionInfo": err = unpopulate(val, "TargetConnectionInfo", &c.TargetConnectionInfo) delete(rawMsg, key) @@ -1848,11 +1961,12 @@ func (c ConnectToTargetSQLDbTaskProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "clientData", c.ClientData) populate(objectMap, "commands", c.Commands) + populate(objectMap, "createdOn", c.CreatedOn) populate(objectMap, "errors", c.Errors) populate(objectMap, "input", c.Input) populate(objectMap, "output", c.Output) populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToTarget.SqlDb" + objectMap["taskType"] = TaskTypeConnectToTargetSQLDb return json.Marshal(objectMap) } @@ -1871,6 +1985,9 @@ func (c *ConnectToTargetSQLDbTaskProperties) UnmarshalJSON(data []byte) error { case "commands": c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) delete(rawMsg, key) + case "createdOn": + err = unpopulate(val, "CreatedOn", &c.CreatedOn) + delete(rawMsg, key) case "errors": err = unpopulate(val, "Errors", &c.Errors) delete(rawMsg, key) @@ -1969,7 +2086,7 @@ func (c ConnectToTargetSQLMISyncTaskProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "input", c.Input) populate(objectMap, "output", c.Output) populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + objectMap["taskType"] = TaskTypeConnectToTargetAzureSQLDbMISyncLRS return json.Marshal(objectMap) } @@ -2106,7 +2223,7 @@ func (c ConnectToTargetSQLMITaskProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "input", c.Input) populate(objectMap, "output", c.Output) populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToTarget.AzureSqlDbMI" + objectMap["taskType"] = TaskTypeConnectToTargetAzureSQLDbMI return json.Marshal(objectMap) } @@ -2183,6 +2300,73 @@ func (c *ConnectionInfo) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CopyProgressDetails. +func (c CopyProgressDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "copyDuration", c.CopyDuration) + populateDateTimeRFC3339(objectMap, "copyStart", c.CopyStart) + populate(objectMap, "copyThroughput", c.CopyThroughput) + populate(objectMap, "dataRead", c.DataRead) + populate(objectMap, "dataWritten", c.DataWritten) + populate(objectMap, "parallelCopyType", c.ParallelCopyType) + populate(objectMap, "rowsCopied", c.RowsCopied) + populate(objectMap, "rowsRead", c.RowsRead) + populate(objectMap, "status", c.Status) + populate(objectMap, "tableName", c.TableName) + populate(objectMap, "usedParallelCopies", c.UsedParallelCopies) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CopyProgressDetails. +func (c *CopyProgressDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "copyDuration": + err = unpopulate(val, "CopyDuration", &c.CopyDuration) + delete(rawMsg, key) + case "copyStart": + err = unpopulateDateTimeRFC3339(val, "CopyStart", &c.CopyStart) + delete(rawMsg, key) + case "copyThroughput": + err = unpopulate(val, "CopyThroughput", &c.CopyThroughput) + delete(rawMsg, key) + case "dataRead": + err = unpopulate(val, "DataRead", &c.DataRead) + delete(rawMsg, key) + case "dataWritten": + err = unpopulate(val, "DataWritten", &c.DataWritten) + delete(rawMsg, key) + case "parallelCopyType": + err = unpopulate(val, "ParallelCopyType", &c.ParallelCopyType) + delete(rawMsg, key) + case "rowsCopied": + err = unpopulate(val, "RowsCopied", &c.RowsCopied) + delete(rawMsg, key) + case "rowsRead": + err = unpopulate(val, "RowsRead", &c.RowsRead) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &c.Status) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &c.TableName) + delete(rawMsg, key) + case "usedParallelCopies": + err = unpopulate(val, "UsedParallelCopies", &c.UsedParallelCopies) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DataIntegrityValidationResult. func (d DataIntegrityValidationResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2540,18 +2724,19 @@ func (d *DatabaseInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseObjectName. -func (d DatabaseObjectName) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigration. +func (d DatabaseMigration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseName", d.DatabaseName) - populate(objectMap, "objectName", d.ObjectName) - populate(objectMap, "objectType", d.ObjectType) - populate(objectMap, "schemaName", d.SchemaName) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseObjectName. -func (d *DatabaseObjectName) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigration. +func (d *DatabaseMigration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -2559,17 +2744,20 @@ func (d *DatabaseObjectName) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &d.DatabaseName) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "objectName": - err = unpopulate(val, "ObjectName", &d.ObjectName) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &d.ObjectType) + case "properties": + d.Properties, err = unmarshalDatabaseMigrationPropertiesClassification(val) delete(rawMsg, key) - case "schemaName": - err = unpopulate(val, "SchemaName", &d.SchemaName) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { @@ -2579,24 +2767,19 @@ func (d *DatabaseObjectName) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseSummaryResult. -func (d DatabaseSummaryResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationBase. +func (d DatabaseMigrationBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endedOn", d.EndedOn) - populate(objectMap, "errorPrefix", d.ErrorPrefix) - populate(objectMap, "itemsCompletedCount", d.ItemsCompletedCount) - populate(objectMap, "itemsCount", d.ItemsCount) + populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) - populate(objectMap, "resultPrefix", d.ResultPrefix) - populate(objectMap, "sizeMB", d.SizeMB) - populateDateTimeRFC3339(objectMap, "startedOn", d.StartedOn) - populate(objectMap, "state", d.State) - populate(objectMap, "statusMessage", d.StatusMessage) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSummaryResult. -func (d *DatabaseSummaryResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationBase. +func (d *DatabaseMigrationBase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -2604,35 +2787,20 @@ func (d *DatabaseSummaryResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &d.EndedOn) - delete(rawMsg, key) - case "errorPrefix": - err = unpopulate(val, "ErrorPrefix", &d.ErrorPrefix) - delete(rawMsg, key) - case "itemsCompletedCount": - err = unpopulate(val, "ItemsCompletedCount", &d.ItemsCompletedCount) - delete(rawMsg, key) - case "itemsCount": - err = unpopulate(val, "ItemsCount", &d.ItemsCount) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "resultPrefix": - err = unpopulate(val, "ResultPrefix", &d.ResultPrefix) - delete(rawMsg, key) - case "sizeMB": - err = unpopulate(val, "SizeMB", &d.SizeMB) - delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) + case "properties": + d.Properties, err = unmarshalDatabaseMigrationBasePropertiesClassification(val) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &d.State) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) - case "statusMessage": - err = unpopulate(val, "StatusMessage", &d.StatusMessage) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { @@ -2642,16 +2810,16 @@ func (d *DatabaseSummaryResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseTable. -func (d DatabaseTable) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationBaseListResult. +func (d DatabaseMigrationBaseListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "hasRows", d.HasRows) - populate(objectMap, "name", d.Name) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseTable. -func (d *DatabaseTable) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationBaseListResult. +func (d *DatabaseMigrationBaseListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -2659,11 +2827,11 @@ func (d *DatabaseTable) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "hasRows": - err = unpopulate(val, "HasRows", &d.HasRows) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { @@ -2673,1267 +2841,3329 @@ func (d *DatabaseTable) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Error. -func (e Error) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationBaseProperties. +func (d DatabaseMigrationBaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "message", e.Message) - populate(objectMap, "type", e.Type) + populateDateTimeRFC3339(objectMap, "endedOn", d.EndedOn) + objectMap["kind"] = d.Kind + populate(objectMap, "migrationFailureError", d.MigrationFailureError) + populate(objectMap, "migrationOperationId", d.MigrationOperationID) + populate(objectMap, "migrationService", d.MigrationService) + populate(objectMap, "migrationStatus", d.MigrationStatus) + populate(objectMap, "provisioningError", d.ProvisioningError) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "scope", d.Scope) + populateDateTimeRFC3339(objectMap, "startedOn", d.StartedOn) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Error. -func (e *Error) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationBaseProperties. +func (d *DatabaseMigrationBaseProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "message": - err = unpopulate(val, "Message", &e.Message) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &d.EndedOn) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "migrationFailureError": + err = unpopulate(val, "MigrationFailureError", &d.MigrationFailureError) + delete(rawMsg, key) + case "migrationOperationId": + err = unpopulate(val, "MigrationOperationID", &d.MigrationOperationID) + delete(rawMsg, key) + case "migrationService": + err = unpopulate(val, "MigrationService", &d.MigrationService) + delete(rawMsg, key) + case "migrationStatus": + err = unpopulate(val, "MigrationStatus", &d.MigrationStatus) + delete(rawMsg, key) + case "provisioningError": + err = unpopulate(val, "ProvisioningError", &d.ProvisioningError) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &d.Scope) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExecutionStatistics. -func (e ExecutionStatistics) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationCosmosDbMongo. +func (d DatabaseMigrationCosmosDbMongo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cpuTimeMs", e.CPUTimeMs) - populate(objectMap, "elapsedTimeMs", e.ElapsedTimeMs) - populate(objectMap, "executionCount", e.ExecutionCount) - populate(objectMap, "hasErrors", e.HasErrors) - populate(objectMap, "sqlErrors", e.SQLErrors) - populate(objectMap, "waitStats", e.WaitStats) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExecutionStatistics. -func (e *ExecutionStatistics) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationCosmosDbMongo. +func (d *DatabaseMigrationCosmosDbMongo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "cpuTimeMs": - err = unpopulate(val, "CPUTimeMs", &e.CPUTimeMs) - delete(rawMsg, key) - case "elapsedTimeMs": - err = unpopulate(val, "ElapsedTimeMs", &e.ElapsedTimeMs) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "executionCount": - err = unpopulate(val, "ExecutionCount", &e.ExecutionCount) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "hasErrors": - err = unpopulate(val, "HasErrors", &e.HasErrors) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) - case "sqlErrors": - err = unpopulate(val, "SQLErrors", &e.SQLErrors) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) - case "waitStats": - err = unpopulate(val, "WaitStats", &e.WaitStats) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FileList. -func (f FileList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationCosmosDbMongoListResult. +func (d DatabaseMigrationCosmosDbMongoListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", f.NextLink) - populate(objectMap, "value", f.Value) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FileList. -func (f *FileList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationCosmosDbMongoListResult. +func (d *DatabaseMigrationCosmosDbMongoListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &f.NextLink) + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &f.Value) + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FileShare. -func (f FileShare) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationListResult. +func (d DatabaseMigrationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "password", f.Password) - populate(objectMap, "path", f.Path) - populate(objectMap, "userName", f.UserName) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FileShare. -func (f *FileShare) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationListResult. +func (d *DatabaseMigrationListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "password": - err = unpopulate(val, "Password", &f.Password) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &f.Path) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &f.UserName) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FileStorageInfo. -func (f FileStorageInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationProperties. +func (d DatabaseMigrationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "headers", f.Headers) - populate(objectMap, "uri", f.URI) + populateDateTimeRFC3339(objectMap, "endedOn", d.EndedOn) + objectMap["kind"] = "DatabaseMigrationProperties" + populate(objectMap, "migrationFailureError", d.MigrationFailureError) + populate(objectMap, "migrationOperationId", d.MigrationOperationID) + populate(objectMap, "migrationService", d.MigrationService) + populate(objectMap, "migrationStatus", d.MigrationStatus) + populate(objectMap, "provisioningError", d.ProvisioningError) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "scope", d.Scope) + populate(objectMap, "sourceDatabaseName", d.SourceDatabaseName) + populate(objectMap, "sourceSqlConnection", d.SourceSQLConnection) + populate(objectMap, "sourceServerName", d.SourceServerName) + populateDateTimeRFC3339(objectMap, "startedOn", d.StartedOn) + populate(objectMap, "targetDatabaseCollation", d.TargetDatabaseCollation) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FileStorageInfo. -func (f *FileStorageInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationProperties. +func (d *DatabaseMigrationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "headers": - err = unpopulate(val, "Headers", &f.Headers) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &d.EndedOn) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &f.URI) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "migrationFailureError": + err = unpopulate(val, "MigrationFailureError", &d.MigrationFailureError) + delete(rawMsg, key) + case "migrationOperationId": + err = unpopulate(val, "MigrationOperationID", &d.MigrationOperationID) + delete(rawMsg, key) + case "migrationService": + err = unpopulate(val, "MigrationService", &d.MigrationService) + delete(rawMsg, key) + case "migrationStatus": + err = unpopulate(val, "MigrationStatus", &d.MigrationStatus) + delete(rawMsg, key) + case "provisioningError": + err = unpopulate(val, "ProvisioningError", &d.ProvisioningError) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &d.Scope) + delete(rawMsg, key) + case "sourceDatabaseName": + err = unpopulate(val, "SourceDatabaseName", &d.SourceDatabaseName) + delete(rawMsg, key) + case "sourceSqlConnection": + err = unpopulate(val, "SourceSQLConnection", &d.SourceSQLConnection) + delete(rawMsg, key) + case "sourceServerName": + err = unpopulate(val, "SourceServerName", &d.SourceServerName) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) + delete(rawMsg, key) + case "targetDatabaseCollation": + err = unpopulate(val, "TargetDatabaseCollation", &d.TargetDatabaseCollation) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetProjectDetailsNonSQLTaskInput. -func (g GetProjectDetailsNonSQLTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationPropertiesCosmosDbMongo. +func (d DatabaseMigrationPropertiesCosmosDbMongo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "projectLocation", g.ProjectLocation) - populate(objectMap, "projectName", g.ProjectName) + populate(objectMap, "collectionList", d.CollectionList) + populateDateTimeRFC3339(objectMap, "endedOn", d.EndedOn) + objectMap["kind"] = ResourceTypeMongoToCosmosDbMongo + populate(objectMap, "migrationFailureError", d.MigrationFailureError) + populate(objectMap, "migrationOperationId", d.MigrationOperationID) + populate(objectMap, "migrationService", d.MigrationService) + populate(objectMap, "migrationStatus", d.MigrationStatus) + populate(objectMap, "provisioningError", d.ProvisioningError) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "scope", d.Scope) + populate(objectMap, "sourceMongoConnection", d.SourceMongoConnection) + populateDateTimeRFC3339(objectMap, "startedOn", d.StartedOn) + populate(objectMap, "targetMongoConnection", d.TargetMongoConnection) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetProjectDetailsNonSQLTaskInput. -func (g *GetProjectDetailsNonSQLTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationPropertiesCosmosDbMongo. +func (d *DatabaseMigrationPropertiesCosmosDbMongo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "projectLocation": - err = unpopulate(val, "ProjectLocation", &g.ProjectLocation) + case "collectionList": + err = unpopulate(val, "CollectionList", &d.CollectionList) delete(rawMsg, key) - case "projectName": - err = unpopulate(val, "ProjectName", &g.ProjectName) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &d.EndedOn) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "migrationFailureError": + err = unpopulate(val, "MigrationFailureError", &d.MigrationFailureError) + delete(rawMsg, key) + case "migrationOperationId": + err = unpopulate(val, "MigrationOperationID", &d.MigrationOperationID) + delete(rawMsg, key) + case "migrationService": + err = unpopulate(val, "MigrationService", &d.MigrationService) + delete(rawMsg, key) + case "migrationStatus": + err = unpopulate(val, "MigrationStatus", &d.MigrationStatus) + delete(rawMsg, key) + case "provisioningError": + err = unpopulate(val, "ProvisioningError", &d.ProvisioningError) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &d.Scope) + delete(rawMsg, key) + case "sourceMongoConnection": + err = unpopulate(val, "SourceMongoConnection", &d.SourceMongoConnection) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) + delete(rawMsg, key) + case "targetMongoConnection": + err = unpopulate(val, "TargetMongoConnection", &d.TargetMongoConnection) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetTdeCertificatesSQLTaskInput. -func (g GetTdeCertificatesSQLTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationPropertiesSQLDb. +func (d DatabaseMigrationPropertiesSQLDb) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "backupFileShare", g.BackupFileShare) - populate(objectMap, "connectionInfo", g.ConnectionInfo) - populate(objectMap, "selectedCertificates", g.SelectedCertificates) + populateDateTimeRFC3339(objectMap, "endedOn", d.EndedOn) + objectMap["kind"] = ResourceTypeSQLDb + populate(objectMap, "migrationFailureError", d.MigrationFailureError) + populate(objectMap, "migrationOperationId", d.MigrationOperationID) + populate(objectMap, "migrationService", d.MigrationService) + populate(objectMap, "migrationStatus", d.MigrationStatus) + populate(objectMap, "migrationStatusDetails", d.MigrationStatusDetails) + populate(objectMap, "offlineConfiguration", d.OfflineConfiguration) + populate(objectMap, "provisioningError", d.ProvisioningError) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "scope", d.Scope) + populate(objectMap, "sourceDatabaseName", d.SourceDatabaseName) + populate(objectMap, "sourceSqlConnection", d.SourceSQLConnection) + populate(objectMap, "sourceServerName", d.SourceServerName) + populateDateTimeRFC3339(objectMap, "startedOn", d.StartedOn) + populate(objectMap, "tableList", d.TableList) + populate(objectMap, "targetDatabaseCollation", d.TargetDatabaseCollation) + populate(objectMap, "targetSqlConnection", d.TargetSQLConnection) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetTdeCertificatesSQLTaskInput. -func (g *GetTdeCertificatesSQLTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationPropertiesSQLDb. +func (d *DatabaseMigrationPropertiesSQLDb) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "backupFileShare": - err = unpopulate(val, "BackupFileShare", &g.BackupFileShare) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &d.EndedOn) delete(rawMsg, key) - case "connectionInfo": - err = unpopulate(val, "ConnectionInfo", &g.ConnectionInfo) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) delete(rawMsg, key) - case "selectedCertificates": - err = unpopulate(val, "SelectedCertificates", &g.SelectedCertificates) + case "migrationFailureError": + err = unpopulate(val, "MigrationFailureError", &d.MigrationFailureError) + delete(rawMsg, key) + case "migrationOperationId": + err = unpopulate(val, "MigrationOperationID", &d.MigrationOperationID) + delete(rawMsg, key) + case "migrationService": + err = unpopulate(val, "MigrationService", &d.MigrationService) + delete(rawMsg, key) + case "migrationStatus": + err = unpopulate(val, "MigrationStatus", &d.MigrationStatus) + delete(rawMsg, key) + case "migrationStatusDetails": + err = unpopulate(val, "MigrationStatusDetails", &d.MigrationStatusDetails) + delete(rawMsg, key) + case "offlineConfiguration": + err = unpopulate(val, "OfflineConfiguration", &d.OfflineConfiguration) + delete(rawMsg, key) + case "provisioningError": + err = unpopulate(val, "ProvisioningError", &d.ProvisioningError) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &d.Scope) + delete(rawMsg, key) + case "sourceDatabaseName": + err = unpopulate(val, "SourceDatabaseName", &d.SourceDatabaseName) + delete(rawMsg, key) + case "sourceSqlConnection": + err = unpopulate(val, "SourceSQLConnection", &d.SourceSQLConnection) + delete(rawMsg, key) + case "sourceServerName": + err = unpopulate(val, "SourceServerName", &d.SourceServerName) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) + delete(rawMsg, key) + case "tableList": + err = unpopulate(val, "TableList", &d.TableList) + delete(rawMsg, key) + case "targetDatabaseCollation": + err = unpopulate(val, "TargetDatabaseCollation", &d.TargetDatabaseCollation) + delete(rawMsg, key) + case "targetSqlConnection": + err = unpopulate(val, "TargetSQLConnection", &d.TargetSQLConnection) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetTdeCertificatesSQLTaskOutput. -func (g GetTdeCertificatesSQLTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationPropertiesSQLMi. +func (d DatabaseMigrationPropertiesSQLMi) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "base64EncodedCertificates", g.Base64EncodedCertificates) - populate(objectMap, "validationErrors", g.ValidationErrors) + populate(objectMap, "backupConfiguration", d.BackupConfiguration) + populateDateTimeRFC3339(objectMap, "endedOn", d.EndedOn) + objectMap["kind"] = ResourceTypeSQLMi + populate(objectMap, "migrationFailureError", d.MigrationFailureError) + populate(objectMap, "migrationOperationId", d.MigrationOperationID) + populate(objectMap, "migrationService", d.MigrationService) + populate(objectMap, "migrationStatus", d.MigrationStatus) + populate(objectMap, "migrationStatusDetails", d.MigrationStatusDetails) + populate(objectMap, "offlineConfiguration", d.OfflineConfiguration) + populate(objectMap, "provisioningError", d.ProvisioningError) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "scope", d.Scope) + populate(objectMap, "sourceDatabaseName", d.SourceDatabaseName) + populate(objectMap, "sourceSqlConnection", d.SourceSQLConnection) + populate(objectMap, "sourceServerName", d.SourceServerName) + populateDateTimeRFC3339(objectMap, "startedOn", d.StartedOn) + populate(objectMap, "targetDatabaseCollation", d.TargetDatabaseCollation) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetTdeCertificatesSQLTaskOutput. -func (g *GetTdeCertificatesSQLTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationPropertiesSQLMi. +func (d *DatabaseMigrationPropertiesSQLMi) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "base64EncodedCertificates": - err = unpopulate(val, "Base64EncodedCertificates", &g.Base64EncodedCertificates) + case "backupConfiguration": + err = unpopulate(val, "BackupConfiguration", &d.BackupConfiguration) delete(rawMsg, key) - case "validationErrors": - err = unpopulate(val, "ValidationErrors", &g.ValidationErrors) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &d.EndedOn) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "migrationFailureError": + err = unpopulate(val, "MigrationFailureError", &d.MigrationFailureError) + delete(rawMsg, key) + case "migrationOperationId": + err = unpopulate(val, "MigrationOperationID", &d.MigrationOperationID) + delete(rawMsg, key) + case "migrationService": + err = unpopulate(val, "MigrationService", &d.MigrationService) + delete(rawMsg, key) + case "migrationStatus": + err = unpopulate(val, "MigrationStatus", &d.MigrationStatus) + delete(rawMsg, key) + case "migrationStatusDetails": + err = unpopulate(val, "MigrationStatusDetails", &d.MigrationStatusDetails) + delete(rawMsg, key) + case "offlineConfiguration": + err = unpopulate(val, "OfflineConfiguration", &d.OfflineConfiguration) + delete(rawMsg, key) + case "provisioningError": + err = unpopulate(val, "ProvisioningError", &d.ProvisioningError) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &d.Scope) + delete(rawMsg, key) + case "sourceDatabaseName": + err = unpopulate(val, "SourceDatabaseName", &d.SourceDatabaseName) + delete(rawMsg, key) + case "sourceSqlConnection": + err = unpopulate(val, "SourceSQLConnection", &d.SourceSQLConnection) + delete(rawMsg, key) + case "sourceServerName": + err = unpopulate(val, "SourceServerName", &d.SourceServerName) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) + delete(rawMsg, key) + case "targetDatabaseCollation": + err = unpopulate(val, "TargetDatabaseCollation", &d.TargetDatabaseCollation) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetTdeCertificatesSQLTaskProperties. -func (g GetTdeCertificatesSQLTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationPropertiesSQLVM. +func (d DatabaseMigrationPropertiesSQLVM) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", g.ClientData) - populate(objectMap, "commands", g.Commands) - populate(objectMap, "errors", g.Errors) - populate(objectMap, "input", g.Input) - populate(objectMap, "output", g.Output) - populate(objectMap, "state", g.State) - objectMap["taskType"] = "GetTDECertificates.Sql" + populate(objectMap, "backupConfiguration", d.BackupConfiguration) + populateDateTimeRFC3339(objectMap, "endedOn", d.EndedOn) + objectMap["kind"] = ResourceTypeSQLVM + populate(objectMap, "migrationFailureError", d.MigrationFailureError) + populate(objectMap, "migrationOperationId", d.MigrationOperationID) + populate(objectMap, "migrationService", d.MigrationService) + populate(objectMap, "migrationStatus", d.MigrationStatus) + populate(objectMap, "migrationStatusDetails", d.MigrationStatusDetails) + populate(objectMap, "offlineConfiguration", d.OfflineConfiguration) + populate(objectMap, "provisioningError", d.ProvisioningError) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "scope", d.Scope) + populate(objectMap, "sourceDatabaseName", d.SourceDatabaseName) + populate(objectMap, "sourceSqlConnection", d.SourceSQLConnection) + populate(objectMap, "sourceServerName", d.SourceServerName) + populateDateTimeRFC3339(objectMap, "startedOn", d.StartedOn) + populate(objectMap, "targetDatabaseCollation", d.TargetDatabaseCollation) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetTdeCertificatesSQLTaskProperties. -func (g *GetTdeCertificatesSQLTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationPropertiesSQLVM. +func (d *DatabaseMigrationPropertiesSQLVM) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &g.ClientData) + case "backupConfiguration": + err = unpopulate(val, "BackupConfiguration", &d.BackupConfiguration) delete(rawMsg, key) - case "commands": - g.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &d.EndedOn) delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &g.Errors) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &g.Input) + case "migrationFailureError": + err = unpopulate(val, "MigrationFailureError", &d.MigrationFailureError) delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &g.Output) + case "migrationOperationId": + err = unpopulate(val, "MigrationOperationID", &d.MigrationOperationID) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &g.State) + case "migrationService": + err = unpopulate(val, "MigrationService", &d.MigrationService) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &g.TaskType) + case "migrationStatus": + err = unpopulate(val, "MigrationStatus", &d.MigrationStatus) + delete(rawMsg, key) + case "migrationStatusDetails": + err = unpopulate(val, "MigrationStatusDetails", &d.MigrationStatusDetails) + delete(rawMsg, key) + case "offlineConfiguration": + err = unpopulate(val, "OfflineConfiguration", &d.OfflineConfiguration) + delete(rawMsg, key) + case "provisioningError": + err = unpopulate(val, "ProvisioningError", &d.ProvisioningError) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &d.Scope) + delete(rawMsg, key) + case "sourceDatabaseName": + err = unpopulate(val, "SourceDatabaseName", &d.SourceDatabaseName) + delete(rawMsg, key) + case "sourceSqlConnection": + err = unpopulate(val, "SourceSQLConnection", &d.SourceSQLConnection) + delete(rawMsg, key) + case "sourceServerName": + err = unpopulate(val, "SourceServerName", &d.SourceServerName) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) + delete(rawMsg, key) + case "targetDatabaseCollation": + err = unpopulate(val, "TargetDatabaseCollation", &d.TargetDatabaseCollation) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesMySQLTaskInput. -func (g GetUserTablesMySQLTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationSQLDb. +func (d DatabaseMigrationSQLDb) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "connectionInfo", g.ConnectionInfo) - populate(objectMap, "selectedDatabases", g.SelectedDatabases) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesMySQLTaskInput. -func (g *GetUserTablesMySQLTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationSQLDb. +func (d *DatabaseMigrationSQLDb) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "connectionInfo": - err = unpopulate(val, "ConnectionInfo", &g.ConnectionInfo) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "selectedDatabases": - err = unpopulate(val, "SelectedDatabases", &g.SelectedDatabases) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesMySQLTaskOutput. -func (g GetUserTablesMySQLTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationSQLMi. +func (d DatabaseMigrationSQLMi) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databasesToTables", g.DatabasesToTables) - populate(objectMap, "id", g.ID) - populate(objectMap, "validationErrors", g.ValidationErrors) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesMySQLTaskOutput. -func (g *GetUserTablesMySQLTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationSQLMi. +func (d *DatabaseMigrationSQLMi) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "databasesToTables": - err = unpopulate(val, "DatabasesToTables", &g.DatabasesToTables) - delete(rawMsg, key) case "id": - err = unpopulate(val, "ID", &g.ID) + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "validationErrors": - err = unpopulate(val, "ValidationErrors", &g.ValidationErrors) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesMySQLTaskProperties. -func (g GetUserTablesMySQLTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationSQLVM. +func (d DatabaseMigrationSQLVM) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", g.ClientData) - populate(objectMap, "commands", g.Commands) - populate(objectMap, "errors", g.Errors) - populate(objectMap, "input", g.Input) - populate(objectMap, "output", g.Output) - populate(objectMap, "state", g.State) - objectMap["taskType"] = "GetUserTablesMySql" + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesMySQLTaskProperties. -func (g *GetUserTablesMySQLTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationSQLVM. +func (d *DatabaseMigrationSQLVM) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &g.ClientData) - delete(rawMsg, key) - case "commands": - g.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &g.Errors) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &g.Input) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &g.Output) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &g.State) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &g.TaskType) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesOracleTaskInput. -func (g GetUserTablesOracleTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseObjectName. +func (d DatabaseObjectName) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "connectionInfo", g.ConnectionInfo) - populate(objectMap, "selectedSchemas", g.SelectedSchemas) + populate(objectMap, "databaseName", d.DatabaseName) + populate(objectMap, "objectName", d.ObjectName) + populate(objectMap, "objectType", d.ObjectType) + populate(objectMap, "schemaName", d.SchemaName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesOracleTaskInput. -func (g *GetUserTablesOracleTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseObjectName. +func (d *DatabaseObjectName) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "connectionInfo": - err = unpopulate(val, "ConnectionInfo", &g.ConnectionInfo) + case "databaseName": + err = unpopulate(val, "DatabaseName", &d.DatabaseName) delete(rawMsg, key) - case "selectedSchemas": - err = unpopulate(val, "SelectedSchemas", &g.SelectedSchemas) + case "objectName": + err = unpopulate(val, "ObjectName", &d.ObjectName) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &d.ObjectType) + delete(rawMsg, key) + case "schemaName": + err = unpopulate(val, "SchemaName", &d.SchemaName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesOracleTaskOutput. -func (g GetUserTablesOracleTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSummaryResult. +func (d DatabaseSummaryResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "schemaName", g.SchemaName) - populate(objectMap, "tables", g.Tables) - populate(objectMap, "validationErrors", g.ValidationErrors) + populateDateTimeRFC3339(objectMap, "endedOn", d.EndedOn) + populate(objectMap, "errorPrefix", d.ErrorPrefix) + populate(objectMap, "itemsCompletedCount", d.ItemsCompletedCount) + populate(objectMap, "itemsCount", d.ItemsCount) + populate(objectMap, "name", d.Name) + populate(objectMap, "resultPrefix", d.ResultPrefix) + populate(objectMap, "sizeMB", d.SizeMB) + populateDateTimeRFC3339(objectMap, "startedOn", d.StartedOn) + populate(objectMap, "state", d.State) + populate(objectMap, "statusMessage", d.StatusMessage) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesOracleTaskOutput. -func (g *GetUserTablesOracleTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSummaryResult. +func (d *DatabaseSummaryResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "schemaName": - err = unpopulate(val, "SchemaName", &g.SchemaName) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &d.EndedOn) delete(rawMsg, key) - case "tables": - err = unpopulate(val, "Tables", &g.Tables) + case "errorPrefix": + err = unpopulate(val, "ErrorPrefix", &d.ErrorPrefix) delete(rawMsg, key) - case "validationErrors": - err = unpopulate(val, "ValidationErrors", &g.ValidationErrors) + case "itemsCompletedCount": + err = unpopulate(val, "ItemsCompletedCount", &d.ItemsCompletedCount) + delete(rawMsg, key) + case "itemsCount": + err = unpopulate(val, "ItemsCount", &d.ItemsCount) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "resultPrefix": + err = unpopulate(val, "ResultPrefix", &d.ResultPrefix) + delete(rawMsg, key) + case "sizeMB": + err = unpopulate(val, "SizeMB", &d.SizeMB) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &d.State) + delete(rawMsg, key) + case "statusMessage": + err = unpopulate(val, "StatusMessage", &d.StatusMessage) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesOracleTaskProperties. -func (g GetUserTablesOracleTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseTable. +func (d DatabaseTable) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", g.ClientData) - populate(objectMap, "commands", g.Commands) - populate(objectMap, "errors", g.Errors) - populate(objectMap, "input", g.Input) - populate(objectMap, "output", g.Output) - populate(objectMap, "state", g.State) - objectMap["taskType"] = "GetUserTablesOracle" + populate(objectMap, "hasRows", d.HasRows) + populate(objectMap, "name", d.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesOracleTaskProperties. -func (g *GetUserTablesOracleTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseTable. +func (d *DatabaseTable) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &g.ClientData) - delete(rawMsg, key) - case "commands": - g.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &g.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &g.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &g.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &g.State) + case "hasRows": + err = unpopulate(val, "HasRows", &d.HasRows) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &g.TaskType) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesPostgreSQLTaskInput. -func (g GetUserTablesPostgreSQLTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeleteNode. +func (d DeleteNode) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "connectionInfo", g.ConnectionInfo) - populate(objectMap, "selectedDatabases", g.SelectedDatabases) + populate(objectMap, "integrationRuntimeName", d.IntegrationRuntimeName) + populate(objectMap, "nodeName", d.NodeName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesPostgreSQLTaskInput. -func (g *GetUserTablesPostgreSQLTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeleteNode. +func (d *DeleteNode) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "connectionInfo": - err = unpopulate(val, "ConnectionInfo", &g.ConnectionInfo) + case "integrationRuntimeName": + err = unpopulate(val, "IntegrationRuntimeName", &d.IntegrationRuntimeName) delete(rawMsg, key) - case "selectedDatabases": - err = unpopulate(val, "SelectedDatabases", &g.SelectedDatabases) + case "nodeName": + err = unpopulate(val, "NodeName", &d.NodeName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesPostgreSQLTaskOutput. -func (g GetUserTablesPostgreSQLTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Error. +func (e Error) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseName", g.DatabaseName) - populate(objectMap, "tables", g.Tables) - populate(objectMap, "validationErrors", g.ValidationErrors) + populate(objectMap, "message", e.Message) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesPostgreSQLTaskOutput. -func (g *GetUserTablesPostgreSQLTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Error. +func (e *Error) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &g.DatabaseName) - delete(rawMsg, key) - case "tables": - err = unpopulate(val, "Tables", &g.Tables) + case "message": + err = unpopulate(val, "Message", &e.Message) delete(rawMsg, key) - case "validationErrors": - err = unpopulate(val, "ValidationErrors", &g.ValidationErrors) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesPostgreSQLTaskProperties. -func (g GetUserTablesPostgreSQLTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", g.ClientData) - populate(objectMap, "commands", g.Commands) - populate(objectMap, "errors", g.Errors) - populate(objectMap, "input", g.Input) - populate(objectMap, "output", g.Output) - populate(objectMap, "state", g.State) - objectMap["taskType"] = "GetUserTablesPostgreSql" + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesPostgreSQLTaskProperties. -func (g *GetUserTablesPostgreSQLTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &g.ClientData) + case "info": + err = unpopulate(val, "Info", &e.Info) delete(rawMsg, key) - case "commands": - g.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &g.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &g.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &g.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &g.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &g.TaskType) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLSyncTaskInput. -func (g GetUserTablesSQLSyncTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "selectedSourceDatabases", g.SelectedSourceDatabases) - populate(objectMap, "selectedTargetDatabases", g.SelectedTargetDatabases) - populate(objectMap, "sourceConnectionInfo", g.SourceConnectionInfo) - populate(objectMap, "targetConnectionInfo", g.TargetConnectionInfo) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesSQLSyncTaskInput. -func (g *GetUserTablesSQLSyncTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "selectedSourceDatabases": - err = unpopulate(val, "SelectedSourceDatabases", &g.SelectedSourceDatabases) + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) delete(rawMsg, key) - case "selectedTargetDatabases": - err = unpopulate(val, "SelectedTargetDatabases", &g.SelectedTargetDatabases) + case "code": + err = unpopulate(val, "Code", &e.Code) delete(rawMsg, key) - case "sourceConnectionInfo": - err = unpopulate(val, "SourceConnectionInfo", &g.SourceConnectionInfo) + case "details": + err = unpopulate(val, "Details", &e.Details) delete(rawMsg, key) - case "targetConnectionInfo": - err = unpopulate(val, "TargetConnectionInfo", &g.TargetConnectionInfo) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLSyncTaskOutput. -func (g GetUserTablesSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorInfo. +func (e ErrorInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databasesToSourceTables", g.DatabasesToSourceTables) - populate(objectMap, "databasesToTargetTables", g.DatabasesToTargetTables) - populate(objectMap, "tableValidationErrors", g.TableValidationErrors) - populate(objectMap, "validationErrors", g.ValidationErrors) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesSQLSyncTaskOutput. -func (g *GetUserTablesSQLSyncTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorInfo. +func (e *ErrorInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "databasesToSourceTables": - err = unpopulate(val, "DatabasesToSourceTables", &g.DatabasesToSourceTables) - delete(rawMsg, key) - case "databasesToTargetTables": - err = unpopulate(val, "DatabasesToTargetTables", &g.DatabasesToTargetTables) - delete(rawMsg, key) - case "tableValidationErrors": - err = unpopulate(val, "TableValidationErrors", &g.TableValidationErrors) + case "code": + err = unpopulate(val, "Code", &e.Code) delete(rawMsg, key) - case "validationErrors": - err = unpopulate(val, "ValidationErrors", &g.ValidationErrors) + case "message": + err = unpopulate(val, "Message", &e.Message) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLSyncTaskProperties. -func (g GetUserTablesSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", g.ClientData) - populate(objectMap, "commands", g.Commands) - populate(objectMap, "errors", g.Errors) - populate(objectMap, "input", g.Input) - populate(objectMap, "output", g.Output) - populate(objectMap, "state", g.State) - objectMap["taskType"] = "GetUserTables.AzureSqlDb.Sync" + populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesSQLSyncTaskProperties. -func (g *GetUserTablesSQLSyncTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &g.ClientData) - delete(rawMsg, key) - case "commands": - g.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &g.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &g.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &g.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &g.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &g.TaskType) + case "error": + err = unpopulate(val, "Error", &e.Error) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLTaskInput. -func (g GetUserTablesSQLTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExecutionStatistics. +func (e ExecutionStatistics) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "connectionInfo", g.ConnectionInfo) - populate(objectMap, "selectedDatabases", g.SelectedDatabases) + populate(objectMap, "cpuTimeMs", e.CPUTimeMs) + populate(objectMap, "elapsedTimeMs", e.ElapsedTimeMs) + populate(objectMap, "executionCount", e.ExecutionCount) + populate(objectMap, "hasErrors", e.HasErrors) + populate(objectMap, "sqlErrors", e.SQLErrors) + populate(objectMap, "waitStats", e.WaitStats) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesSQLTaskInput. -func (g *GetUserTablesSQLTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExecutionStatistics. +func (e *ExecutionStatistics) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "connectionInfo": - err = unpopulate(val, "ConnectionInfo", &g.ConnectionInfo) + case "cpuTimeMs": + err = unpopulate(val, "CPUTimeMs", &e.CPUTimeMs) delete(rawMsg, key) - case "selectedDatabases": - err = unpopulate(val, "SelectedDatabases", &g.SelectedDatabases) + case "elapsedTimeMs": + err = unpopulate(val, "ElapsedTimeMs", &e.ElapsedTimeMs) + delete(rawMsg, key) + case "executionCount": + err = unpopulate(val, "ExecutionCount", &e.ExecutionCount) + delete(rawMsg, key) + case "hasErrors": + err = unpopulate(val, "HasErrors", &e.HasErrors) + delete(rawMsg, key) + case "sqlErrors": + err = unpopulate(val, "SQLErrors", &e.SQLErrors) + delete(rawMsg, key) + case "waitStats": + err = unpopulate(val, "WaitStats", &e.WaitStats) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLTaskOutput. -func (g GetUserTablesSQLTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FileList. +func (f FileList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databasesToTables", g.DatabasesToTables) - populate(objectMap, "id", g.ID) - populate(objectMap, "validationErrors", g.ValidationErrors) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesSQLTaskOutput. -func (g *GetUserTablesSQLTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FileList. +func (f *FileList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "databasesToTables": - err = unpopulate(val, "DatabasesToTables", &g.DatabasesToTables) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &g.ID) + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) delete(rawMsg, key) - case "validationErrors": - err = unpopulate(val, "ValidationErrors", &g.ValidationErrors) + case "value": + err = unpopulate(val, "Value", &f.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLTaskProperties. -func (g GetUserTablesSQLTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FileShare. +func (f FileShare) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", g.ClientData) - populate(objectMap, "commands", g.Commands) - populate(objectMap, "errors", g.Errors) - populate(objectMap, "input", g.Input) - populate(objectMap, "output", g.Output) - populate(objectMap, "state", g.State) - objectMap["taskType"] = "GetUserTables.Sql" + populate(objectMap, "password", f.Password) + populate(objectMap, "path", f.Path) + populate(objectMap, "userName", f.UserName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesSQLTaskProperties. -func (g *GetUserTablesSQLTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FileShare. +func (f *FileShare) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &g.ClientData) - delete(rawMsg, key) - case "commands": - g.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &g.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &g.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &g.Output) + case "password": + err = unpopulate(val, "Password", &f.Password) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &g.State) + case "path": + err = unpopulate(val, "Path", &f.Path) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &g.TaskType) + case "userName": + err = unpopulate(val, "UserName", &f.UserName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstallOCIDriverTaskInput. -func (i InstallOCIDriverTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FileStorageInfo. +func (f FileStorageInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "driverPackageName", i.DriverPackageName) + populate(objectMap, "headers", f.Headers) + populate(objectMap, "uri", f.URI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InstallOCIDriverTaskInput. -func (i *InstallOCIDriverTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FileStorageInfo. +func (f *FileStorageInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "driverPackageName": - err = unpopulate(val, "DriverPackageName", &i.DriverPackageName) + case "headers": + err = unpopulate(val, "Headers", &f.Headers) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &f.URI) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstallOCIDriverTaskOutput. -func (i InstallOCIDriverTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GetProjectDetailsNonSQLTaskInput. +func (g GetProjectDetailsNonSQLTaskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "validationErrors", i.ValidationErrors) + populate(objectMap, "projectLocation", g.ProjectLocation) + populate(objectMap, "projectName", g.ProjectName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InstallOCIDriverTaskOutput. -func (i *InstallOCIDriverTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GetProjectDetailsNonSQLTaskInput. +func (g *GetProjectDetailsNonSQLTaskInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "validationErrors": - err = unpopulate(val, "ValidationErrors", &i.ValidationErrors) + case "projectLocation": + err = unpopulate(val, "ProjectLocation", &g.ProjectLocation) + delete(rawMsg, key) + case "projectName": + err = unpopulate(val, "ProjectName", &g.ProjectName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstallOCIDriverTaskProperties. -func (i InstallOCIDriverTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GetTdeCertificatesSQLTaskInput. +func (g GetTdeCertificatesSQLTaskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", i.ClientData) - populate(objectMap, "commands", i.Commands) - populate(objectMap, "errors", i.Errors) - populate(objectMap, "input", i.Input) - populate(objectMap, "output", i.Output) - populate(objectMap, "state", i.State) - objectMap["taskType"] = "Service.Install.OCI" + populate(objectMap, "backupFileShare", g.BackupFileShare) + populate(objectMap, "connectionInfo", g.ConnectionInfo) + populate(objectMap, "selectedCertificates", g.SelectedCertificates) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InstallOCIDriverTaskProperties. -func (i *InstallOCIDriverTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GetTdeCertificatesSQLTaskInput. +func (g *GetTdeCertificatesSQLTaskInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &i.ClientData) - delete(rawMsg, key) - case "commands": - i.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &i.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &i.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &i.Output) + case "backupFileShare": + err = unpopulate(val, "BackupFileShare", &g.BackupFileShare) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &i.State) + case "connectionInfo": + err = unpopulate(val, "ConnectionInfo", &g.ConnectionInfo) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &i.TaskType) + case "selectedCertificates": + err = unpopulate(val, "SelectedCertificates", &g.SelectedCertificates) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MiSQLConnectionInfo. -func (m MiSQLConnectionInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GetTdeCertificatesSQLTaskOutput. +func (g GetTdeCertificatesSQLTaskOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "managedInstanceResourceId", m.ManagedInstanceResourceID) - populate(objectMap, "password", m.Password) - objectMap["type"] = "MiSqlConnectionInfo" - populate(objectMap, "userName", m.UserName) + populate(objectMap, "base64EncodedCertificates", g.Base64EncodedCertificates) + populate(objectMap, "validationErrors", g.ValidationErrors) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MiSQLConnectionInfo. -func (m *MiSQLConnectionInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GetTdeCertificatesSQLTaskOutput. +func (g *GetTdeCertificatesSQLTaskOutput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "managedInstanceResourceId": - err = unpopulate(val, "ManagedInstanceResourceID", &m.ManagedInstanceResourceID) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &m.Password) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "base64EncodedCertificates": + err = unpopulate(val, "Base64EncodedCertificates", &g.Base64EncodedCertificates) delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &m.UserName) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &g.ValidationErrors) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMISyncCompleteCommandInput. -func (m MigrateMISyncCompleteCommandInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GetTdeCertificatesSQLTaskProperties. +func (g GetTdeCertificatesSQLTaskProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sourceDatabaseName", m.SourceDatabaseName) + populate(objectMap, "clientData", g.ClientData) + populate(objectMap, "commands", g.Commands) + populate(objectMap, "errors", g.Errors) + populate(objectMap, "input", g.Input) + populate(objectMap, "output", g.Output) + populate(objectMap, "state", g.State) + objectMap["taskType"] = TaskTypeGetTDECertificatesSQL return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMISyncCompleteCommandInput. -func (m *MigrateMISyncCompleteCommandInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GetTdeCertificatesSQLTaskProperties. +func (g *GetTdeCertificatesSQLTaskProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "sourceDatabaseName": - err = unpopulate(val, "SourceDatabaseName", &m.SourceDatabaseName) + case "clientData": + err = unpopulate(val, "ClientData", &g.ClientData) + delete(rawMsg, key) + case "commands": + g.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &g.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &g.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &g.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &g.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &g.TaskType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMISyncCompleteCommandOutput. -func (m MigrateMISyncCompleteCommandOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesMySQLTaskInput. +func (g GetUserTablesMySQLTaskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "errors", m.Errors) + populate(objectMap, "connectionInfo", g.ConnectionInfo) + populate(objectMap, "selectedDatabases", g.SelectedDatabases) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMISyncCompleteCommandOutput. -func (m *MigrateMISyncCompleteCommandOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesMySQLTaskInput. +func (g *GetUserTablesMySQLTaskInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "errors": - err = unpopulate(val, "Errors", &m.Errors) + case "connectionInfo": + err = unpopulate(val, "ConnectionInfo", &g.ConnectionInfo) + delete(rawMsg, key) + case "selectedDatabases": + err = unpopulate(val, "SelectedDatabases", &g.SelectedDatabases) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMISyncCompleteCommandProperties. -func (m MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesMySQLTaskOutput. +func (g GetUserTablesMySQLTaskOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" - populate(objectMap, "errors", m.Errors) - populate(objectMap, "input", m.Input) - populate(objectMap, "output", m.Output) - populate(objectMap, "state", m.State) + populate(objectMap, "databasesToTables", g.DatabasesToTables) + populate(objectMap, "id", g.ID) + populate(objectMap, "validationErrors", g.ValidationErrors) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMISyncCompleteCommandProperties. -func (m *MigrateMISyncCompleteCommandProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesMySQLTaskOutput. +func (g *GetUserTablesMySQLTaskOutput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "commandType": - err = unpopulate(val, "CommandType", &m.CommandType) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &m.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &m.Input) + case "databasesToTables": + err = unpopulate(val, "DatabasesToTables", &g.DatabasesToTables) delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &m.Output) + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &g.ValidationErrors) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMongoDbTaskProperties. -func (m MigrateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesMySQLTaskProperties. +func (g GetUserTablesMySQLTaskProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", m.ClientData) - populate(objectMap, "commands", m.Commands) - populate(objectMap, "errors", m.Errors) - populate(objectMap, "input", m.Input) - populate(objectMap, "output", m.Output) - populate(objectMap, "state", m.State) - objectMap["taskType"] = "Migrate.MongoDb" + populate(objectMap, "clientData", g.ClientData) + populate(objectMap, "commands", g.Commands) + populate(objectMap, "errors", g.Errors) + populate(objectMap, "input", g.Input) + populate(objectMap, "output", g.Output) + populate(objectMap, "state", g.State) + objectMap["taskType"] = TaskTypeGetUserTablesMySQL return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMongoDbTaskProperties. -func (m *MigrateMongoDbTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesMySQLTaskProperties. +func (g *GetUserTablesMySQLTaskProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { case "clientData": - err = unpopulate(val, "ClientData", &m.ClientData) + err = unpopulate(val, "ClientData", &g.ClientData) delete(rawMsg, key) case "commands": - m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + g.Commands, err = unmarshalCommandPropertiesClassificationArray(val) delete(rawMsg, key) case "errors": - err = unpopulate(val, "Errors", &m.Errors) + err = unpopulate(val, "Errors", &g.Errors) delete(rawMsg, key) case "input": - err = unpopulate(val, "Input", &m.Input) + err = unpopulate(val, "Input", &g.Input) delete(rawMsg, key) case "output": - m.Output, err = unmarshalMongoDbProgressClassificationArray(val) + err = unpopulate(val, "Output", &g.Output) delete(rawMsg, key) case "state": - err = unpopulate(val, "State", &m.State) + err = unpopulate(val, "State", &g.State) delete(rawMsg, key) case "taskType": - err = unpopulate(val, "TaskType", &m.TaskType) + err = unpopulate(val, "TaskType", &g.TaskType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineDatabaseInput. -func (m MigrateMySQLAzureDbForMySQLOfflineDatabaseInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesOracleTaskInput. +func (g GetUserTablesOracleTaskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", m.Name) - populate(objectMap, "tableMap", m.TableMap) - populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) + populate(objectMap, "connectionInfo", g.ConnectionInfo) + populate(objectMap, "selectedSchemas", g.SelectedSchemas) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineDatabaseInput. -func (m *MigrateMySQLAzureDbForMySQLOfflineDatabaseInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesOracleTaskInput. +func (g *GetUserTablesOracleTaskInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "tableMap": - err = unpopulate(val, "TableMap", &m.TableMap) + case "connectionInfo": + err = unpopulate(val, "ConnectionInfo", &g.ConnectionInfo) delete(rawMsg, key) - case "targetDatabaseName": - err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) + case "selectedSchemas": + err = unpopulate(val, "SelectedSchemas", &g.SelectedSchemas) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskInput. -func (m MigrateMySQLAzureDbForMySQLOfflineTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesOracleTaskOutput. +func (g GetUserTablesOracleTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "schemaName", g.SchemaName) + populate(objectMap, "tables", g.Tables) + populate(objectMap, "validationErrors", g.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesOracleTaskOutput. +func (g *GetUserTablesOracleTaskOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "schemaName": + err = unpopulate(val, "SchemaName", &g.SchemaName) + delete(rawMsg, key) + case "tables": + err = unpopulate(val, "Tables", &g.Tables) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &g.ValidationErrors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesOracleTaskProperties. +func (g GetUserTablesOracleTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", g.ClientData) + populate(objectMap, "commands", g.Commands) + populate(objectMap, "errors", g.Errors) + populate(objectMap, "input", g.Input) + populate(objectMap, "output", g.Output) + populate(objectMap, "state", g.State) + objectMap["taskType"] = TaskTypeGetUserTablesOracle + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesOracleTaskProperties. +func (g *GetUserTablesOracleTaskProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &g.ClientData) + delete(rawMsg, key) + case "commands": + g.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &g.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &g.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &g.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &g.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &g.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesPostgreSQLTaskInput. +func (g GetUserTablesPostgreSQLTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionInfo", g.ConnectionInfo) + populate(objectMap, "selectedDatabases", g.SelectedDatabases) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesPostgreSQLTaskInput. +func (g *GetUserTablesPostgreSQLTaskInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connectionInfo": + err = unpopulate(val, "ConnectionInfo", &g.ConnectionInfo) + delete(rawMsg, key) + case "selectedDatabases": + err = unpopulate(val, "SelectedDatabases", &g.SelectedDatabases) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesPostgreSQLTaskOutput. +func (g GetUserTablesPostgreSQLTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseName", g.DatabaseName) + populate(objectMap, "tables", g.Tables) + populate(objectMap, "validationErrors", g.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesPostgreSQLTaskOutput. +func (g *GetUserTablesPostgreSQLTaskOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &g.DatabaseName) + delete(rawMsg, key) + case "tables": + err = unpopulate(val, "Tables", &g.Tables) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &g.ValidationErrors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesPostgreSQLTaskProperties. +func (g GetUserTablesPostgreSQLTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", g.ClientData) + populate(objectMap, "commands", g.Commands) + populate(objectMap, "errors", g.Errors) + populate(objectMap, "input", g.Input) + populate(objectMap, "output", g.Output) + populate(objectMap, "state", g.State) + objectMap["taskType"] = TaskTypeGetUserTablesPostgreSQL + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesPostgreSQLTaskProperties. +func (g *GetUserTablesPostgreSQLTaskProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &g.ClientData) + delete(rawMsg, key) + case "commands": + g.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &g.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &g.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &g.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &g.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &g.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLSyncTaskInput. +func (g GetUserTablesSQLSyncTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "selectedSourceDatabases", g.SelectedSourceDatabases) + populate(objectMap, "selectedTargetDatabases", g.SelectedTargetDatabases) + populate(objectMap, "sourceConnectionInfo", g.SourceConnectionInfo) + populate(objectMap, "targetConnectionInfo", g.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesSQLSyncTaskInput. +func (g *GetUserTablesSQLSyncTaskInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "selectedSourceDatabases": + err = unpopulate(val, "SelectedSourceDatabases", &g.SelectedSourceDatabases) + delete(rawMsg, key) + case "selectedTargetDatabases": + err = unpopulate(val, "SelectedTargetDatabases", &g.SelectedTargetDatabases) + delete(rawMsg, key) + case "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &g.SourceConnectionInfo) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &g.TargetConnectionInfo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLSyncTaskOutput. +func (g GetUserTablesSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databasesToSourceTables", g.DatabasesToSourceTables) + populate(objectMap, "databasesToTargetTables", g.DatabasesToTargetTables) + populate(objectMap, "tableValidationErrors", g.TableValidationErrors) + populate(objectMap, "validationErrors", g.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesSQLSyncTaskOutput. +func (g *GetUserTablesSQLSyncTaskOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databasesToSourceTables": + err = unpopulate(val, "DatabasesToSourceTables", &g.DatabasesToSourceTables) + delete(rawMsg, key) + case "databasesToTargetTables": + err = unpopulate(val, "DatabasesToTargetTables", &g.DatabasesToTargetTables) + delete(rawMsg, key) + case "tableValidationErrors": + err = unpopulate(val, "TableValidationErrors", &g.TableValidationErrors) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &g.ValidationErrors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLSyncTaskProperties. +func (g GetUserTablesSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", g.ClientData) + populate(objectMap, "commands", g.Commands) + populate(objectMap, "errors", g.Errors) + populate(objectMap, "input", g.Input) + populate(objectMap, "output", g.Output) + populate(objectMap, "state", g.State) + objectMap["taskType"] = TaskTypeGetUserTablesAzureSQLDbSync + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesSQLSyncTaskProperties. +func (g *GetUserTablesSQLSyncTaskProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &g.ClientData) + delete(rawMsg, key) + case "commands": + g.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &g.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &g.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &g.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &g.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &g.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLTaskInput. +func (g GetUserTablesSQLTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionInfo", g.ConnectionInfo) + populate(objectMap, "encryptedKeyForSecureFields", g.EncryptedKeyForSecureFields) + populate(objectMap, "selectedDatabases", g.SelectedDatabases) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesSQLTaskInput. +func (g *GetUserTablesSQLTaskInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connectionInfo": + err = unpopulate(val, "ConnectionInfo", &g.ConnectionInfo) + delete(rawMsg, key) + case "encryptedKeyForSecureFields": + err = unpopulate(val, "EncryptedKeyForSecureFields", &g.EncryptedKeyForSecureFields) + delete(rawMsg, key) + case "selectedDatabases": + err = unpopulate(val, "SelectedDatabases", &g.SelectedDatabases) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLTaskOutput. +func (g GetUserTablesSQLTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databasesToTables", g.DatabasesToTables) + populate(objectMap, "id", g.ID) + populate(objectMap, "validationErrors", g.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesSQLTaskOutput. +func (g *GetUserTablesSQLTaskOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databasesToTables": + err = unpopulate(val, "DatabasesToTables", &g.DatabasesToTables) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &g.ValidationErrors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLTaskProperties. +func (g GetUserTablesSQLTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", g.ClientData) + populate(objectMap, "commands", g.Commands) + populate(objectMap, "errors", g.Errors) + populate(objectMap, "input", g.Input) + populate(objectMap, "output", g.Output) + populate(objectMap, "state", g.State) + populate(objectMap, "taskId", g.TaskID) + objectMap["taskType"] = TaskTypeGetUserTablesSQL + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetUserTablesSQLTaskProperties. +func (g *GetUserTablesSQLTaskProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &g.ClientData) + delete(rawMsg, key) + case "commands": + g.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &g.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &g.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &g.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &g.State) + delete(rawMsg, key) + case "taskId": + err = unpopulate(val, "TaskID", &g.TaskID) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &g.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstallOCIDriverTaskInput. +func (i InstallOCIDriverTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "driverPackageName", i.DriverPackageName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstallOCIDriverTaskInput. +func (i *InstallOCIDriverTaskInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "driverPackageName": + err = unpopulate(val, "DriverPackageName", &i.DriverPackageName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstallOCIDriverTaskOutput. +func (i InstallOCIDriverTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "validationErrors", i.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstallOCIDriverTaskOutput. +func (i *InstallOCIDriverTaskOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &i.ValidationErrors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstallOCIDriverTaskProperties. +func (i InstallOCIDriverTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", i.ClientData) + populate(objectMap, "commands", i.Commands) + populate(objectMap, "errors", i.Errors) + populate(objectMap, "input", i.Input) + populate(objectMap, "output", i.Output) + populate(objectMap, "state", i.State) + objectMap["taskType"] = TaskTypeServiceInstallOCI + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstallOCIDriverTaskProperties. +func (i *InstallOCIDriverTaskProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &i.ClientData) + delete(rawMsg, key) + case "commands": + i.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &i.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &i.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &i.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &i.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &i.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeMonitoringData. +func (i IntegrationRuntimeMonitoringData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", i.Name) + populate(objectMap, "nodes", i.Nodes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IntegrationRuntimeMonitoringData. +func (i *IntegrationRuntimeMonitoringData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "nodes": + err = unpopulate(val, "Nodes", &i.Nodes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MiSQLConnectionInfo. +func (m MiSQLConnectionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "managedInstanceResourceId", m.ManagedInstanceResourceID) + populate(objectMap, "password", m.Password) + objectMap["type"] = "MiSqlConnectionInfo" + populate(objectMap, "userName", m.UserName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MiSQLConnectionInfo. +func (m *MiSQLConnectionInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "managedInstanceResourceId": + err = unpopulate(val, "ManagedInstanceResourceID", &m.ManagedInstanceResourceID) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &m.Password) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &m.UserName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMISyncCompleteCommandInput. +func (m MigrateMISyncCompleteCommandInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceDatabaseName", m.SourceDatabaseName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMISyncCompleteCommandInput. +func (m *MigrateMISyncCompleteCommandInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sourceDatabaseName": + err = unpopulate(val, "SourceDatabaseName", &m.SourceDatabaseName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMISyncCompleteCommandOutput. +func (m MigrateMISyncCompleteCommandOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errors", m.Errors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMISyncCompleteCommandOutput. +func (m *MigrateMISyncCompleteCommandOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errors": + err = unpopulate(val, "Errors", &m.Errors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMISyncCompleteCommandProperties. +func (m MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["commandType"] = CommandTypeMigrateSQLServerAzureDbSQLMiComplete + populate(objectMap, "errors", m.Errors) + populate(objectMap, "input", m.Input) + populate(objectMap, "output", m.Output) + populate(objectMap, "state", m.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMISyncCompleteCommandProperties. +func (m *MigrateMISyncCompleteCommandProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "commandType": + err = unpopulate(val, "CommandType", &m.CommandType) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &m.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &m.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMongoDbTaskProperties. +func (m MigrateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", m.ClientData) + populate(objectMap, "commands", m.Commands) + populate(objectMap, "errors", m.Errors) + populate(objectMap, "input", m.Input) + populate(objectMap, "output", m.Output) + populate(objectMap, "state", m.State) + objectMap["taskType"] = TaskTypeMigrateMongoDb + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMongoDbTaskProperties. +func (m *MigrateMongoDbTaskProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &m.ClientData) + delete(rawMsg, key) + case "commands": + m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &m.Input) + delete(rawMsg, key) + case "output": + m.Output, err = unmarshalMongoDbProgressClassificationArray(val) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &m.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineDatabaseInput. +func (m MigrateMySQLAzureDbForMySQLOfflineDatabaseInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", m.Name) + populate(objectMap, "tableMap", m.TableMap) + populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineDatabaseInput. +func (m *MigrateMySQLAzureDbForMySQLOfflineDatabaseInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "tableMap": + err = unpopulate(val, "TableMap", &m.TableMap) + delete(rawMsg, key) + case "targetDatabaseName": + err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskInput. +func (m MigrateMySQLAzureDbForMySQLOfflineTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "encryptedKeyForSecureFields", m.EncryptedKeyForSecureFields) populate(objectMap, "makeSourceServerReadOnly", m.MakeSourceServerReadOnly) populate(objectMap, "optionalAgentSettings", m.OptionalAgentSettings) populate(objectMap, "selectedDatabases", m.SelectedDatabases) populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskInput. +func (m *MigrateMySQLAzureDbForMySQLOfflineTaskInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "encryptedKeyForSecureFields": + err = unpopulate(val, "EncryptedKeyForSecureFields", &m.EncryptedKeyForSecureFields) + delete(rawMsg, key) + case "makeSourceServerReadOnly": + err = unpopulate(val, "MakeSourceServerReadOnly", &m.MakeSourceServerReadOnly) + delete(rawMsg, key) + case "optionalAgentSettings": + err = unpopulate(val, "OptionalAgentSettings", &m.OptionalAgentSettings) + delete(rawMsg, key) + case "selectedDatabases": + err = unpopulate(val, "SelectedDatabases", &m.SelectedDatabases) + delete(rawMsg, key) + case "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutput. +func (m MigrateMySQLAzureDbForMySQLOfflineTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + objectMap["resultType"] = m.ResultType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutput. +func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputDatabaseLevel. +func (m MigrateMySQLAzureDbForMySQLOfflineTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseName", m.DatabaseName) + populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "errorCount", m.ErrorCount) + populate(objectMap, "errorPrefix", m.ErrorPrefix) + populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) + populate(objectMap, "id", m.ID) + populateDateTimeRFC3339(objectMap, "lastStorageUpdate", m.LastStorageUpdate) + populate(objectMap, "message", m.Message) + populate(objectMap, "numberOfObjects", m.NumberOfObjects) + populate(objectMap, "numberOfObjectsCompleted", m.NumberOfObjectsCompleted) + populate(objectMap, "objectSummary", m.ObjectSummary) + populate(objectMap, "resultPrefix", m.ResultPrefix) + objectMap["resultType"] = "DatabaseLevelOutput" + populate(objectMap, "stage", m.Stage) + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "state", m.State) + populate(objectMap, "statusMessage", m.StatusMessage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputDatabaseLevel. +func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) + delete(rawMsg, key) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) + delete(rawMsg, key) + case "errorCount": + err = unpopulate(val, "ErrorCount", &m.ErrorCount) + delete(rawMsg, key) + case "errorPrefix": + err = unpopulate(val, "ErrorPrefix", &m.ErrorPrefix) + delete(rawMsg, key) + case "exceptionsAndWarnings": + err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "lastStorageUpdate": + err = unpopulateDateTimeRFC3339(val, "LastStorageUpdate", &m.LastStorageUpdate) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &m.Message) + delete(rawMsg, key) + case "numberOfObjects": + err = unpopulate(val, "NumberOfObjects", &m.NumberOfObjects) + delete(rawMsg, key) + case "numberOfObjectsCompleted": + err = unpopulate(val, "NumberOfObjectsCompleted", &m.NumberOfObjectsCompleted) + delete(rawMsg, key) + case "objectSummary": + err = unpopulate(val, "ObjectSummary", &m.ObjectSummary) + delete(rawMsg, key) + case "resultPrefix": + err = unpopulate(val, "ResultPrefix", &m.ResultPrefix) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &m.Stage) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "statusMessage": + err = unpopulate(val, "StatusMessage", &m.StatusMessage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputError. +func (m MigrateMySQLAzureDbForMySQLOfflineTaskOutputError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", m.Error) + populate(objectMap, "id", m.ID) + objectMap["resultType"] = "ErrorOutput" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputError. +func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &m.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputMigrationLevel. +func (m MigrateMySQLAzureDbForMySQLOfflineTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseSummary", m.DatabaseSummary) + populate(objectMap, "databases", m.Databases) + populate(objectMap, "durationInSeconds", m.DurationInSeconds) + populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) + populate(objectMap, "id", m.ID) + populateDateTimeRFC3339(objectMap, "lastStorageUpdate", m.LastStorageUpdate) + populate(objectMap, "message", m.Message) + populate(objectMap, "migrationReportResult", m.MigrationReportResult) + objectMap["resultType"] = "MigrationLevelOutput" + populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) + populate(objectMap, "sourceServerVersion", m.SourceServerVersion) + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "status", m.Status) + populate(objectMap, "statusMessage", m.StatusMessage) + populate(objectMap, "targetServerBrandVersion", m.TargetServerBrandVersion) + populate(objectMap, "targetServerVersion", m.TargetServerVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputMigrationLevel. +func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseSummary": + err = unpopulate(val, "DatabaseSummary", &m.DatabaseSummary) + delete(rawMsg, key) + case "databases": + err = unpopulate(val, "Databases", &m.Databases) + delete(rawMsg, key) + case "durationInSeconds": + err = unpopulate(val, "DurationInSeconds", &m.DurationInSeconds) + delete(rawMsg, key) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) + delete(rawMsg, key) + case "exceptionsAndWarnings": + err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "lastStorageUpdate": + err = unpopulateDateTimeRFC3339(val, "LastStorageUpdate", &m.LastStorageUpdate) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &m.Message) + delete(rawMsg, key) + case "migrationReportResult": + err = unpopulate(val, "MigrationReportResult", &m.MigrationReportResult) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + case "sourceServerBrandVersion": + err = unpopulate(val, "SourceServerBrandVersion", &m.SourceServerBrandVersion) + delete(rawMsg, key) + case "sourceServerVersion": + err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "statusMessage": + err = unpopulate(val, "StatusMessage", &m.StatusMessage) + delete(rawMsg, key) + case "targetServerBrandVersion": + err = unpopulate(val, "TargetServerBrandVersion", &m.TargetServerBrandVersion) + delete(rawMsg, key) + case "targetServerVersion": + err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputTableLevel. +func (m MigrateMySQLAzureDbForMySQLOfflineTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "errorPrefix", m.ErrorPrefix) + populate(objectMap, "id", m.ID) + populate(objectMap, "itemsCompletedCount", m.ItemsCompletedCount) + populate(objectMap, "itemsCount", m.ItemsCount) + populateDateTimeRFC3339(objectMap, "lastStorageUpdate", m.LastStorageUpdate) + populate(objectMap, "objectName", m.ObjectName) + populate(objectMap, "resultPrefix", m.ResultPrefix) + objectMap["resultType"] = "TableLevelOutput" + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "state", m.State) + populate(objectMap, "statusMessage", m.StatusMessage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputTableLevel. +func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputTableLevel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) + delete(rawMsg, key) + case "errorPrefix": + err = unpopulate(val, "ErrorPrefix", &m.ErrorPrefix) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "itemsCompletedCount": + err = unpopulate(val, "ItemsCompletedCount", &m.ItemsCompletedCount) + delete(rawMsg, key) + case "itemsCount": + err = unpopulate(val, "ItemsCount", &m.ItemsCount) + delete(rawMsg, key) + case "lastStorageUpdate": + err = unpopulateDateTimeRFC3339(val, "LastStorageUpdate", &m.LastStorageUpdate) + delete(rawMsg, key) + case "objectName": + err = unpopulate(val, "ObjectName", &m.ObjectName) + delete(rawMsg, key) + case "resultPrefix": + err = unpopulate(val, "ResultPrefix", &m.ResultPrefix) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "statusMessage": + err = unpopulate(val, "StatusMessage", &m.StatusMessage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskProperties. +func (m MigrateMySQLAzureDbForMySQLOfflineTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", m.ClientData) + populate(objectMap, "commands", m.Commands) + populate(objectMap, "errors", m.Errors) + populate(objectMap, "input", m.Input) + populate(objectMap, "isCloneable", m.IsCloneable) + populate(objectMap, "output", m.Output) + populate(objectMap, "state", m.State) + populate(objectMap, "taskId", m.TaskID) + objectMap["taskType"] = TaskTypeMigrateMySQLAzureDbForMySQL + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskProperties. +func (m *MigrateMySQLAzureDbForMySQLOfflineTaskProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &m.ClientData) + delete(rawMsg, key) + case "commands": + m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &m.Input) + delete(rawMsg, key) + case "isCloneable": + err = unpopulate(val, "IsCloneable", &m.IsCloneable) + delete(rawMsg, key) + case "output": + m.Output, err = unmarshalMigrateMySQLAzureDbForMySQLOfflineTaskOutputClassificationArray(val) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "taskId": + err = unpopulate(val, "TaskID", &m.TaskID) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &m.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncDatabaseInput. +func (m MigrateMySQLAzureDbForMySQLSyncDatabaseInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "migrationSetting", m.MigrationSetting) + populate(objectMap, "name", m.Name) + populate(objectMap, "sourceSetting", m.SourceSetting) + populate(objectMap, "tableMap", m.TableMap) + populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) + populate(objectMap, "targetSetting", m.TargetSetting) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncDatabaseInput. +func (m *MigrateMySQLAzureDbForMySQLSyncDatabaseInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "migrationSetting": + err = unpopulate(val, "MigrationSetting", &m.MigrationSetting) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "sourceSetting": + err = unpopulate(val, "SourceSetting", &m.SourceSetting) + delete(rawMsg, key) + case "tableMap": + err = unpopulate(val, "TableMap", &m.TableMap) + delete(rawMsg, key) + case "targetDatabaseName": + err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) + delete(rawMsg, key) + case "targetSetting": + err = unpopulate(val, "TargetSetting", &m.TargetSetting) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskInput. +func (m MigrateMySQLAzureDbForMySQLSyncTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "selectedDatabases", m.SelectedDatabases) + populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) + populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskInput. +func (m *MigrateMySQLAzureDbForMySQLSyncTaskInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "selectedDatabases": + err = unpopulate(val, "SelectedDatabases", &m.SelectedDatabases) + delete(rawMsg, key) + case "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutput. +func (m MigrateMySQLAzureDbForMySQLSyncTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + objectMap["resultType"] = m.ResultType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutput. +func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseError. +func (m MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorMessage", m.ErrorMessage) + populate(objectMap, "events", m.Events) + populate(objectMap, "id", m.ID) + objectMap["resultType"] = "DatabaseLevelErrorOutput" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseError. +func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &m.ErrorMessage) + delete(rawMsg, key) + case "events": + err = unpopulate(val, "Events", &m.Events) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseLevel. +func (m MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appliedChanges", m.AppliedChanges) + populate(objectMap, "cdcDeleteCounter", m.CdcDeleteCounter) + populate(objectMap, "cdcInsertCounter", m.CdcInsertCounter) + populate(objectMap, "cdcUpdateCounter", m.CdcUpdateCounter) + populate(objectMap, "databaseName", m.DatabaseName) + populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "fullLoadCompletedTables", m.FullLoadCompletedTables) + populate(objectMap, "fullLoadErroredTables", m.FullLoadErroredTables) + populate(objectMap, "fullLoadLoadingTables", m.FullLoadLoadingTables) + populate(objectMap, "fullLoadQueuedTables", m.FullLoadQueuedTables) + populate(objectMap, "id", m.ID) + populate(objectMap, "incomingChanges", m.IncomingChanges) + populate(objectMap, "initializationCompleted", m.InitializationCompleted) + populate(objectMap, "latency", m.Latency) + populate(objectMap, "migrationState", m.MigrationState) + objectMap["resultType"] = "DatabaseLevelOutput" + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseLevel. +func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "appliedChanges": + err = unpopulate(val, "AppliedChanges", &m.AppliedChanges) + delete(rawMsg, key) + case "cdcDeleteCounter": + err = unpopulate(val, "CdcDeleteCounter", &m.CdcDeleteCounter) + delete(rawMsg, key) + case "cdcInsertCounter": + err = unpopulate(val, "CdcInsertCounter", &m.CdcInsertCounter) + delete(rawMsg, key) + case "cdcUpdateCounter": + err = unpopulate(val, "CdcUpdateCounter", &m.CdcUpdateCounter) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) + delete(rawMsg, key) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) + delete(rawMsg, key) + case "fullLoadCompletedTables": + err = unpopulate(val, "FullLoadCompletedTables", &m.FullLoadCompletedTables) + delete(rawMsg, key) + case "fullLoadErroredTables": + err = unpopulate(val, "FullLoadErroredTables", &m.FullLoadErroredTables) + delete(rawMsg, key) + case "fullLoadLoadingTables": + err = unpopulate(val, "FullLoadLoadingTables", &m.FullLoadLoadingTables) + delete(rawMsg, key) + case "fullLoadQueuedTables": + err = unpopulate(val, "FullLoadQueuedTables", &m.FullLoadQueuedTables) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "incomingChanges": + err = unpopulate(val, "IncomingChanges", &m.IncomingChanges) + delete(rawMsg, key) + case "initializationCompleted": + err = unpopulate(val, "InitializationCompleted", &m.InitializationCompleted) + delete(rawMsg, key) + case "latency": + err = unpopulate(val, "Latency", &m.Latency) + delete(rawMsg, key) + case "migrationState": + err = unpopulate(val, "MigrationState", &m.MigrationState) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputError. +func (m MigrateMySQLAzureDbForMySQLSyncTaskOutputError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", m.Error) + populate(objectMap, "id", m.ID) + objectMap["resultType"] = "ErrorOutput" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputError. +func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &m.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputMigrationLevel. +func (m MigrateMySQLAzureDbForMySQLSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "id", m.ID) + objectMap["resultType"] = "MigrationLevelOutput" + populate(objectMap, "sourceServer", m.SourceServer) + populate(objectMap, "sourceServerVersion", m.SourceServerVersion) + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "targetServer", m.TargetServer) + populate(objectMap, "targetServerVersion", m.TargetServerVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputMigrationLevel. +func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + case "sourceServer": + err = unpopulate(val, "SourceServer", &m.SourceServer) + delete(rawMsg, key) + case "sourceServerVersion": + err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) + case "targetServer": + err = unpopulate(val, "TargetServer", &m.TargetServer) + delete(rawMsg, key) + case "targetServerVersion": + err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputTableLevel. +func (m MigrateMySQLAzureDbForMySQLSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cdcDeleteCounter", m.CdcDeleteCounter) + populate(objectMap, "cdcInsertCounter", m.CdcInsertCounter) + populate(objectMap, "cdcUpdateCounter", m.CdcUpdateCounter) + populate(objectMap, "dataErrorsCounter", m.DataErrorsCounter) + populate(objectMap, "databaseName", m.DatabaseName) + populateDateTimeRFC3339(objectMap, "fullLoadEndedOn", m.FullLoadEndedOn) + populateDateTimeRFC3339(objectMap, "fullLoadEstFinishTime", m.FullLoadEstFinishTime) + populateDateTimeRFC3339(objectMap, "fullLoadStartedOn", m.FullLoadStartedOn) + populate(objectMap, "fullLoadTotalRows", m.FullLoadTotalRows) + populate(objectMap, "id", m.ID) + populateDateTimeRFC3339(objectMap, "lastModifiedTime", m.LastModifiedTime) + objectMap["resultType"] = "TableLevelOutput" + populate(objectMap, "state", m.State) + populate(objectMap, "tableName", m.TableName) + populate(objectMap, "totalChangesApplied", m.TotalChangesApplied) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputTableLevel. +func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputTableLevel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cdcDeleteCounter": + err = unpopulate(val, "CdcDeleteCounter", &m.CdcDeleteCounter) + delete(rawMsg, key) + case "cdcInsertCounter": + err = unpopulate(val, "CdcInsertCounter", &m.CdcInsertCounter) + delete(rawMsg, key) + case "cdcUpdateCounter": + err = unpopulate(val, "CdcUpdateCounter", &m.CdcUpdateCounter) + delete(rawMsg, key) + case "dataErrorsCounter": + err = unpopulate(val, "DataErrorsCounter", &m.DataErrorsCounter) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) + delete(rawMsg, key) + case "fullLoadEndedOn": + err = unpopulateDateTimeRFC3339(val, "FullLoadEndedOn", &m.FullLoadEndedOn) + delete(rawMsg, key) + case "fullLoadEstFinishTime": + err = unpopulateDateTimeRFC3339(val, "FullLoadEstFinishTime", &m.FullLoadEstFinishTime) + delete(rawMsg, key) + case "fullLoadStartedOn": + err = unpopulateDateTimeRFC3339(val, "FullLoadStartedOn", &m.FullLoadStartedOn) + delete(rawMsg, key) + case "fullLoadTotalRows": + err = unpopulate(val, "FullLoadTotalRows", &m.FullLoadTotalRows) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &m.LastModifiedTime) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &m.TableName) + delete(rawMsg, key) + case "totalChangesApplied": + err = unpopulate(val, "TotalChangesApplied", &m.TotalChangesApplied) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskProperties. +func (m MigrateMySQLAzureDbForMySQLSyncTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", m.ClientData) + populate(objectMap, "commands", m.Commands) + populate(objectMap, "errors", m.Errors) + populate(objectMap, "input", m.Input) + populate(objectMap, "output", m.Output) + populate(objectMap, "state", m.State) + objectMap["taskType"] = TaskTypeMigrateMySQLAzureDbForMySQLSync + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskProperties. +func (m *MigrateMySQLAzureDbForMySQLSyncTaskProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &m.ClientData) + delete(rawMsg, key) + case "commands": + m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &m.Input) + delete(rawMsg, key) + case "output": + m.Output, err = unmarshalMigrateMySQLAzureDbForMySQLSyncTaskOutputClassificationArray(val) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &m.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbForPostgreSQLSyncTaskProperties. +func (m MigrateOracleAzureDbForPostgreSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", m.ClientData) + populate(objectMap, "commands", m.Commands) + populate(objectMap, "errors", m.Errors) + populate(objectMap, "input", m.Input) + populate(objectMap, "output", m.Output) + populate(objectMap, "state", m.State) + objectMap["taskType"] = TaskTypeMigrateOracleAzureDbForPostgreSQLSync + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbForPostgreSQLSyncTaskProperties. +func (m *MigrateOracleAzureDbForPostgreSQLSyncTaskProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &m.ClientData) + delete(rawMsg, key) + case "commands": + m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &m.Input) + delete(rawMsg, key) + case "output": + m.Output, err = unmarshalMigrateOracleAzureDbPostgreSQLSyncTaskOutputClassificationArray(val) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &m.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncDatabaseInput. +func (m MigrateOracleAzureDbPostgreSQLSyncDatabaseInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "caseManipulation", m.CaseManipulation) + populate(objectMap, "migrationSetting", m.MigrationSetting) + populate(objectMap, "name", m.Name) + populate(objectMap, "schemaName", m.SchemaName) + populate(objectMap, "sourceSetting", m.SourceSetting) + populate(objectMap, "tableMap", m.TableMap) + populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) + populate(objectMap, "targetSetting", m.TargetSetting) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncDatabaseInput. +func (m *MigrateOracleAzureDbPostgreSQLSyncDatabaseInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "caseManipulation": + err = unpopulate(val, "CaseManipulation", &m.CaseManipulation) + delete(rawMsg, key) + case "migrationSetting": + err = unpopulate(val, "MigrationSetting", &m.MigrationSetting) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "schemaName": + err = unpopulate(val, "SchemaName", &m.SchemaName) + delete(rawMsg, key) + case "sourceSetting": + err = unpopulate(val, "SourceSetting", &m.SourceSetting) + delete(rawMsg, key) + case "tableMap": + err = unpopulate(val, "TableMap", &m.TableMap) + delete(rawMsg, key) + case "targetDatabaseName": + err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) + delete(rawMsg, key) + case "targetSetting": + err = unpopulate(val, "TargetSetting", &m.TargetSetting) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskInput. +func (m MigrateOracleAzureDbPostgreSQLSyncTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "selectedDatabases", m.SelectedDatabases) + populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskInput. -func (m *MigrateMySQLAzureDbForMySQLOfflineTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskInput. +func (m *MigrateOracleAzureDbPostgreSQLSyncTaskInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -3941,21 +6171,12 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskInput) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "makeSourceServerReadOnly": - err = unpopulate(val, "MakeSourceServerReadOnly", &m.MakeSourceServerReadOnly) - delete(rawMsg, key) - case "optionalAgentSettings": - err = unpopulate(val, "OptionalAgentSettings", &m.OptionalAgentSettings) - delete(rawMsg, key) case "selectedDatabases": err = unpopulate(val, "SelectedDatabases", &m.SelectedDatabases) delete(rawMsg, key) case "sourceConnectionInfo": err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) - delete(rawMsg, key) case "targetConnectionInfo": err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) delete(rawMsg, key) @@ -3967,16 +6188,16 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskInput) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutput. -func (m MigrateMySQLAzureDbForMySQLOfflineTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutput. +func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", m.ID) objectMap["resultType"] = m.ResultType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutput. -func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutput. +func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -3998,31 +6219,70 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutput) UnmarshalJSON(data []byte return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputDatabaseLevel. -func (m MigrateMySQLAzureDbForMySQLOfflineTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseError. +func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorMessage", m.ErrorMessage) + populate(objectMap, "events", m.Events) + populate(objectMap, "id", m.ID) + objectMap["resultType"] = "DatabaseLevelErrorOutput" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseError. +func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &m.ErrorMessage) + delete(rawMsg, key) + case "events": + err = unpopulate(val, "Events", &m.Events) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseLevel. +func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "appliedChanges", m.AppliedChanges) + populate(objectMap, "cdcDeleteCounter", m.CdcDeleteCounter) + populate(objectMap, "cdcInsertCounter", m.CdcInsertCounter) + populate(objectMap, "cdcUpdateCounter", m.CdcUpdateCounter) populate(objectMap, "databaseName", m.DatabaseName) populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "errorCount", m.ErrorCount) - populate(objectMap, "errorPrefix", m.ErrorPrefix) - populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) + populate(objectMap, "fullLoadCompletedTables", m.FullLoadCompletedTables) + populate(objectMap, "fullLoadErroredTables", m.FullLoadErroredTables) + populate(objectMap, "fullLoadLoadingTables", m.FullLoadLoadingTables) + populate(objectMap, "fullLoadQueuedTables", m.FullLoadQueuedTables) populate(objectMap, "id", m.ID) - populateDateTimeRFC3339(objectMap, "lastStorageUpdate", m.LastStorageUpdate) - populate(objectMap, "message", m.Message) - populate(objectMap, "numberOfObjects", m.NumberOfObjects) - populate(objectMap, "numberOfObjectsCompleted", m.NumberOfObjectsCompleted) - populate(objectMap, "objectSummary", m.ObjectSummary) - populate(objectMap, "resultPrefix", m.ResultPrefix) + populate(objectMap, "incomingChanges", m.IncomingChanges) + populate(objectMap, "initializationCompleted", m.InitializationCompleted) + populate(objectMap, "latency", m.Latency) + populate(objectMap, "migrationState", m.MigrationState) objectMap["resultType"] = "DatabaseLevelOutput" - populate(objectMap, "stage", m.Stage) populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "state", m.State) - populate(objectMap, "statusMessage", m.StatusMessage) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputDatabaseLevel. -func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseLevel. +func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4030,57 +6290,57 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputDatabaseLevel) UnmarshalJSO for key, val := range rawMsg { var err error switch key { + case "appliedChanges": + err = unpopulate(val, "AppliedChanges", &m.AppliedChanges) + delete(rawMsg, key) + case "cdcDeleteCounter": + err = unpopulate(val, "CdcDeleteCounter", &m.CdcDeleteCounter) + delete(rawMsg, key) + case "cdcInsertCounter": + err = unpopulate(val, "CdcInsertCounter", &m.CdcInsertCounter) + delete(rawMsg, key) + case "cdcUpdateCounter": + err = unpopulate(val, "CdcUpdateCounter", &m.CdcUpdateCounter) + delete(rawMsg, key) case "databaseName": err = unpopulate(val, "DatabaseName", &m.DatabaseName) delete(rawMsg, key) case "endedOn": err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) - case "errorCount": - err = unpopulate(val, "ErrorCount", &m.ErrorCount) + case "fullLoadCompletedTables": + err = unpopulate(val, "FullLoadCompletedTables", &m.FullLoadCompletedTables) delete(rawMsg, key) - case "errorPrefix": - err = unpopulate(val, "ErrorPrefix", &m.ErrorPrefix) + case "fullLoadErroredTables": + err = unpopulate(val, "FullLoadErroredTables", &m.FullLoadErroredTables) delete(rawMsg, key) - case "exceptionsAndWarnings": - err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) + case "fullLoadLoadingTables": + err = unpopulate(val, "FullLoadLoadingTables", &m.FullLoadLoadingTables) + delete(rawMsg, key) + case "fullLoadQueuedTables": + err = unpopulate(val, "FullLoadQueuedTables", &m.FullLoadQueuedTables) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "lastStorageUpdate": - err = unpopulateDateTimeRFC3339(val, "LastStorageUpdate", &m.LastStorageUpdate) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &m.Message) - delete(rawMsg, key) - case "numberOfObjects": - err = unpopulate(val, "NumberOfObjects", &m.NumberOfObjects) + case "incomingChanges": + err = unpopulate(val, "IncomingChanges", &m.IncomingChanges) delete(rawMsg, key) - case "numberOfObjectsCompleted": - err = unpopulate(val, "NumberOfObjectsCompleted", &m.NumberOfObjectsCompleted) + case "initializationCompleted": + err = unpopulate(val, "InitializationCompleted", &m.InitializationCompleted) delete(rawMsg, key) - case "objectSummary": - err = unpopulate(val, "ObjectSummary", &m.ObjectSummary) + case "latency": + err = unpopulate(val, "Latency", &m.Latency) delete(rawMsg, key) - case "resultPrefix": - err = unpopulate(val, "ResultPrefix", &m.ResultPrefix) + case "migrationState": + err = unpopulate(val, "MigrationState", &m.MigrationState) delete(rawMsg, key) case "resultType": err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) - case "stage": - err = unpopulate(val, "Stage", &m.Stage) - delete(rawMsg, key) case "startedOn": err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) - delete(rawMsg, key) - case "statusMessage": - err = unpopulate(val, "StatusMessage", &m.StatusMessage) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4089,8 +6349,8 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputDatabaseLevel) UnmarshalJSO return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputError. -func (m MigrateMySQLAzureDbForMySQLOfflineTaskOutputError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputError. +func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "error", m.Error) populate(objectMap, "id", m.ID) @@ -4098,8 +6358,8 @@ func (m MigrateMySQLAzureDbForMySQLOfflineTaskOutputError) MarshalJSON() ([]byte return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputError. -func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputError. +func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4124,31 +6384,22 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputError) UnmarshalJSON(data [ return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputMigrationLevel. -func (m MigrateMySQLAzureDbForMySQLOfflineTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel. +func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseSummary", m.DatabaseSummary) - populate(objectMap, "databases", m.Databases) - populate(objectMap, "durationInSeconds", m.DurationInSeconds) populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) populate(objectMap, "id", m.ID) - populateDateTimeRFC3339(objectMap, "lastStorageUpdate", m.LastStorageUpdate) - populate(objectMap, "message", m.Message) - populate(objectMap, "migrationReportResult", m.MigrationReportResult) objectMap["resultType"] = "MigrationLevelOutput" - populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) + populate(objectMap, "sourceServer", m.SourceServer) populate(objectMap, "sourceServerVersion", m.SourceServerVersion) populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "status", m.Status) - populate(objectMap, "statusMessage", m.StatusMessage) - populate(objectMap, "targetServerBrandVersion", m.TargetServerBrandVersion) + populate(objectMap, "targetServer", m.TargetServer) populate(objectMap, "targetServerVersion", m.TargetServerVersion) return json.Marshal(objectMap) } - -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputMigrationLevel. -func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel. +func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4156,38 +6407,17 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputMigrationLevel) UnmarshalJS for key, val := range rawMsg { var err error switch key { - case "databaseSummary": - err = unpopulate(val, "DatabaseSummary", &m.DatabaseSummary) - delete(rawMsg, key) - case "databases": - err = unpopulate(val, "Databases", &m.Databases) - delete(rawMsg, key) - case "durationInSeconds": - err = unpopulate(val, "DurationInSeconds", &m.DurationInSeconds) - delete(rawMsg, key) case "endedOn": err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) - case "exceptionsAndWarnings": - err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) - delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "lastStorageUpdate": - err = unpopulateDateTimeRFC3339(val, "LastStorageUpdate", &m.LastStorageUpdate) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &m.Message) - delete(rawMsg, key) - case "migrationReportResult": - err = unpopulate(val, "MigrationReportResult", &m.MigrationReportResult) - delete(rawMsg, key) case "resultType": err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) - case "sourceServerBrandVersion": - err = unpopulate(val, "SourceServerBrandVersion", &m.SourceServerBrandVersion) + case "sourceServer": + err = unpopulate(val, "SourceServer", &m.SourceServer) delete(rawMsg, key) case "sourceServerVersion": err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) @@ -4195,14 +6425,8 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputMigrationLevel) UnmarshalJS case "startedOn": err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) - case "statusMessage": - err = unpopulate(val, "StatusMessage", &m.StatusMessage) - delete(rawMsg, key) - case "targetServerBrandVersion": - err = unpopulate(val, "TargetServerBrandVersion", &m.TargetServerBrandVersion) + case "targetServer": + err = unpopulate(val, "TargetServer", &m.TargetServer) delete(rawMsg, key) case "targetServerVersion": err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) @@ -4215,26 +6439,29 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputMigrationLevel) UnmarshalJS return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputTableLevel. -func (m MigrateMySQLAzureDbForMySQLOfflineTaskOutputTableLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel. +func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "errorPrefix", m.ErrorPrefix) + populate(objectMap, "cdcDeleteCounter", m.CdcDeleteCounter) + populate(objectMap, "cdcInsertCounter", m.CdcInsertCounter) + populate(objectMap, "cdcUpdateCounter", m.CdcUpdateCounter) + populate(objectMap, "dataErrorsCounter", m.DataErrorsCounter) + populate(objectMap, "databaseName", m.DatabaseName) + populateDateTimeRFC3339(objectMap, "fullLoadEndedOn", m.FullLoadEndedOn) + populateDateTimeRFC3339(objectMap, "fullLoadEstFinishTime", m.FullLoadEstFinishTime) + populateDateTimeRFC3339(objectMap, "fullLoadStartedOn", m.FullLoadStartedOn) + populate(objectMap, "fullLoadTotalRows", m.FullLoadTotalRows) populate(objectMap, "id", m.ID) - populate(objectMap, "itemsCompletedCount", m.ItemsCompletedCount) - populate(objectMap, "itemsCount", m.ItemsCount) - populateDateTimeRFC3339(objectMap, "lastStorageUpdate", m.LastStorageUpdate) - populate(objectMap, "objectName", m.ObjectName) - populate(objectMap, "resultPrefix", m.ResultPrefix) + populateDateTimeRFC3339(objectMap, "lastModifiedTime", m.LastModifiedTime) objectMap["resultType"] = "TableLevelOutput" - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) populate(objectMap, "state", m.State) - populate(objectMap, "statusMessage", m.StatusMessage) + populate(objectMap, "tableName", m.TableName) + populate(objectMap, "totalChangesApplied", m.TotalChangesApplied) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskOutputTableLevel. -func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputTableLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel. +func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4242,41 +6469,50 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputTableLevel) UnmarshalJSON(d for key, val := range rawMsg { var err error switch key { - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) + case "cdcDeleteCounter": + err = unpopulate(val, "CdcDeleteCounter", &m.CdcDeleteCounter) delete(rawMsg, key) - case "errorPrefix": - err = unpopulate(val, "ErrorPrefix", &m.ErrorPrefix) + case "cdcInsertCounter": + err = unpopulate(val, "CdcInsertCounter", &m.CdcInsertCounter) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) + case "cdcUpdateCounter": + err = unpopulate(val, "CdcUpdateCounter", &m.CdcUpdateCounter) delete(rawMsg, key) - case "itemsCompletedCount": - err = unpopulate(val, "ItemsCompletedCount", &m.ItemsCompletedCount) + case "dataErrorsCounter": + err = unpopulate(val, "DataErrorsCounter", &m.DataErrorsCounter) delete(rawMsg, key) - case "itemsCount": - err = unpopulate(val, "ItemsCount", &m.ItemsCount) + case "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) delete(rawMsg, key) - case "lastStorageUpdate": - err = unpopulateDateTimeRFC3339(val, "LastStorageUpdate", &m.LastStorageUpdate) + case "fullLoadEndedOn": + err = unpopulateDateTimeRFC3339(val, "FullLoadEndedOn", &m.FullLoadEndedOn) delete(rawMsg, key) - case "objectName": - err = unpopulate(val, "ObjectName", &m.ObjectName) + case "fullLoadEstFinishTime": + err = unpopulateDateTimeRFC3339(val, "FullLoadEstFinishTime", &m.FullLoadEstFinishTime) delete(rawMsg, key) - case "resultPrefix": - err = unpopulate(val, "ResultPrefix", &m.ResultPrefix) + case "fullLoadStartedOn": + err = unpopulateDateTimeRFC3339(val, "FullLoadStartedOn", &m.FullLoadStartedOn) + delete(rawMsg, key) + case "fullLoadTotalRows": + err = unpopulate(val, "FullLoadTotalRows", &m.FullLoadTotalRows) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &m.LastModifiedTime) delete(rawMsg, key) case "resultType": err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) - delete(rawMsg, key) case "state": err = unpopulate(val, "State", &m.State) delete(rawMsg, key) - case "statusMessage": - err = unpopulate(val, "StatusMessage", &m.StatusMessage) + case "tableName": + err = unpopulate(val, "TableName", &m.TableName) + delete(rawMsg, key) + case "totalChangesApplied": + err = unpopulate(val, "TotalChangesApplied", &m.TotalChangesApplied) delete(rawMsg, key) } if err != nil { @@ -4286,21 +6522,21 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputTableLevel) UnmarshalJSON(d return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskProperties. -func (m MigrateMySQLAzureDbForMySQLOfflineTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput. +func (m MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", m.ClientData) - populate(objectMap, "commands", m.Commands) - populate(objectMap, "errors", m.Errors) - populate(objectMap, "input", m.Input) - populate(objectMap, "output", m.Output) - populate(objectMap, "state", m.State) - objectMap["taskType"] = "Migrate.MySql.AzureDbForMySql" + populate(objectMap, "id", m.ID) + populate(objectMap, "migrationSetting", m.MigrationSetting) + populate(objectMap, "name", m.Name) + populate(objectMap, "selectedTables", m.SelectedTables) + populate(objectMap, "sourceSetting", m.SourceSetting) + populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) + populate(objectMap, "targetSetting", m.TargetSetting) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskProperties. -func (m *MigrateMySQLAzureDbForMySQLOfflineTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput. +func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4308,26 +6544,26 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskProperties) UnmarshalJSON(data [] for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &m.ClientData) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "commands": - m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + case "migrationSetting": + err = unpopulate(val, "MigrationSetting", &m.MigrationSetting) delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &m.Errors) + case "name": + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &m.Input) + case "selectedTables": + err = unpopulate(val, "SelectedTables", &m.SelectedTables) delete(rawMsg, key) - case "output": - m.Output, err = unmarshalMigrateMySQLAzureDbForMySQLOfflineTaskOutputClassificationArray(val) + case "sourceSetting": + err = unpopulate(val, "SourceSetting", &m.SourceSetting) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "targetDatabaseName": + err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &m.TaskType) + case "targetSetting": + err = unpopulate(val, "TargetSetting", &m.TargetSetting) delete(rawMsg, key) } if err != nil { @@ -4337,20 +6573,15 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskProperties) UnmarshalJSON(data [] return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncDatabaseInput. -func (m MigrateMySQLAzureDbForMySQLSyncDatabaseInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseTableInput. +func (m MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseTableInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "migrationSetting", m.MigrationSetting) populate(objectMap, "name", m.Name) - populate(objectMap, "sourceSetting", m.SourceSetting) - populate(objectMap, "tableMap", m.TableMap) - populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) - populate(objectMap, "targetSetting", m.TargetSetting) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncDatabaseInput. -func (m *MigrateMySQLAzureDbForMySQLSyncDatabaseInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseTableInput. +func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseTableInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4358,24 +6589,9 @@ func (m *MigrateMySQLAzureDbForMySQLSyncDatabaseInput) UnmarshalJSON(data []byte for key, val := range rawMsg { var err error switch key { - case "migrationSetting": - err = unpopulate(val, "MigrationSetting", &m.MigrationSetting) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "sourceSetting": - err = unpopulate(val, "SourceSetting", &m.SourceSetting) - delete(rawMsg, key) - case "tableMap": - err = unpopulate(val, "TableMap", &m.TableMap) - delete(rawMsg, key) - case "targetDatabaseName": - err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) - delete(rawMsg, key) - case "targetSetting": - err = unpopulate(val, "TargetSetting", &m.TargetSetting) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4384,17 +6600,19 @@ func (m *MigrateMySQLAzureDbForMySQLSyncDatabaseInput) UnmarshalJSON(data []byte return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskInput. -func (m MigrateMySQLAzureDbForMySQLSyncTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput. +func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "encryptedKeyForSecureFields", m.EncryptedKeyForSecureFields) populate(objectMap, "selectedDatabases", m.SelectedDatabases) populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskInput. -func (m *MigrateMySQLAzureDbForMySQLSyncTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput. +func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4402,12 +6620,18 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskInput) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { + case "encryptedKeyForSecureFields": + err = unpopulate(val, "EncryptedKeyForSecureFields", &m.EncryptedKeyForSecureFields) + delete(rawMsg, key) case "selectedDatabases": err = unpopulate(val, "SelectedDatabases", &m.SelectedDatabases) delete(rawMsg, key) case "sourceConnectionInfo": err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) case "targetConnectionInfo": err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) delete(rawMsg, key) @@ -4419,16 +6643,16 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskInput) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutput. -func (m MigrateMySQLAzureDbForMySQLSyncTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutput. +func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", m.ID) objectMap["resultType"] = m.ResultType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutput. -func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutput. +func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4450,8 +6674,8 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutput) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseError. -func (m MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseError. +func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "errorMessage", m.ErrorMessage) populate(objectMap, "events", m.Events) @@ -4460,8 +6684,8 @@ func (m MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseError) MarshalJSON() ([ return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseError. -func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseError. +func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4489,8 +6713,8 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseError) UnmarshalJSON(d return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseLevel. -func (m MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseLevel. +func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "appliedChanges", m.AppliedChanges) populate(objectMap, "cdcDeleteCounter", m.CdcDeleteCounter) @@ -4512,8 +6736,8 @@ func (m MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseLevel) MarshalJSON() ([ return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseLevel. -func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseLevel. +func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4580,17 +6804,18 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseLevel) UnmarshalJSON(d return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputError. -func (m MigrateMySQLAzureDbForMySQLSyncTaskOutputError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError. +func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "error", m.Error) + populate(objectMap, "events", m.Events) populate(objectMap, "id", m.ID) objectMap["resultType"] = "ErrorOutput" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputError. -func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError. +func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4601,6 +6826,9 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputError) UnmarshalJSON(data []by case "error": err = unpopulate(val, "Error", &m.Error) delete(rawMsg, key) + case "events": + err = unpopulate(val, "Events", &m.Events) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) @@ -4615,22 +6843,26 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputError) UnmarshalJSON(data []by return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputMigrationLevel. -func (m MigrateMySQLAzureDbForMySQLSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel. +func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "databaseCount", m.DatabaseCount) populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) populate(objectMap, "id", m.ID) objectMap["resultType"] = "MigrationLevelOutput" populate(objectMap, "sourceServer", m.SourceServer) + populate(objectMap, "sourceServerType", m.SourceServerType) populate(objectMap, "sourceServerVersion", m.SourceServerVersion) populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "state", m.State) populate(objectMap, "targetServer", m.TargetServer) + populate(objectMap, "targetServerType", m.TargetServerType) populate(objectMap, "targetServerVersion", m.TargetServerVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputMigrationLevel. -func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel. +func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4638,6 +6870,9 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputMigrationLevel) UnmarshalJSON( for key, val := range rawMsg { var err error switch key { + case "databaseCount": + err = unpopulate(val, "DatabaseCount", &m.DatabaseCount) + delete(rawMsg, key) case "endedOn": err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) @@ -4650,15 +6885,24 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputMigrationLevel) UnmarshalJSON( case "sourceServer": err = unpopulate(val, "SourceServer", &m.SourceServer) delete(rawMsg, key) + case "sourceServerType": + err = unpopulate(val, "SourceServerType", &m.SourceServerType) + delete(rawMsg, key) case "sourceServerVersion": err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) delete(rawMsg, key) case "startedOn": err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) case "targetServer": err = unpopulate(val, "TargetServer", &m.TargetServer) delete(rawMsg, key) + case "targetServerType": + err = unpopulate(val, "TargetServerType", &m.TargetServerType) + delete(rawMsg, key) case "targetServerVersion": err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) delete(rawMsg, key) @@ -4670,8 +6914,8 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputMigrationLevel) UnmarshalJSON( return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputTableLevel. -func (m MigrateMySQLAzureDbForMySQLSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputTableLevel. +func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cdcDeleteCounter", m.CdcDeleteCounter) populate(objectMap, "cdcInsertCounter", m.CdcInsertCounter) @@ -4691,8 +6935,8 @@ func (m MigrateMySQLAzureDbForMySQLSyncTaskOutputTableLevel) MarshalJSON() ([]by return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputTableLevel. -func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputTableLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputTableLevel. +func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputTableLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4753,21 +6997,24 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputTableLevel) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskProperties. -func (m MigrateMySQLAzureDbForMySQLSyncTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties. +func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "clientData", m.ClientData) populate(objectMap, "commands", m.Commands) + populate(objectMap, "createdOn", m.CreatedOn) populate(objectMap, "errors", m.Errors) populate(objectMap, "input", m.Input) + populate(objectMap, "isCloneable", m.IsCloneable) populate(objectMap, "output", m.Output) populate(objectMap, "state", m.State) - objectMap["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + populate(objectMap, "taskId", m.TaskID) + objectMap["taskType"] = TaskTypeMigratePostgreSQLAzureDbForPostgreSQLSyncV2 return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskProperties. -func (m *MigrateMySQLAzureDbForMySQLSyncTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties. +func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4781,18 +7028,27 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskProperties) UnmarshalJSON(data []byt case "commands": m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) delete(rawMsg, key) + case "createdOn": + err = unpopulate(val, "CreatedOn", &m.CreatedOn) + delete(rawMsg, key) case "errors": err = unpopulate(val, "Errors", &m.Errors) delete(rawMsg, key) case "input": err = unpopulate(val, "Input", &m.Input) delete(rawMsg, key) + case "isCloneable": + err = unpopulate(val, "IsCloneable", &m.IsCloneable) + delete(rawMsg, key) case "output": - m.Output, err = unmarshalMigrateMySQLAzureDbForMySQLSyncTaskOutputClassificationArray(val) + m.Output, err = unmarshalMigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputClassificationArray(val) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &m.State) delete(rawMsg, key) + case "taskId": + err = unpopulate(val, "TaskID", &m.TaskID) + delete(rawMsg, key) case "taskType": err = unpopulate(val, "TaskType", &m.TaskType) delete(rawMsg, key) @@ -4804,21 +7060,18 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskProperties) UnmarshalJSON(data []byt return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbForPostgreSQLSyncTaskProperties. -func (m MigrateOracleAzureDbForPostgreSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerDatabaseInput. +func (m MigrateSQLServerDatabaseInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", m.ClientData) - populate(objectMap, "commands", m.Commands) - populate(objectMap, "errors", m.Errors) - populate(objectMap, "input", m.Input) - populate(objectMap, "output", m.Output) - populate(objectMap, "state", m.State) - objectMap["taskType"] = "Migrate.Oracle.AzureDbForPostgreSql.Sync" + populate(objectMap, "backupAndRestoreFolder", m.BackupAndRestoreFolder) + populate(objectMap, "databaseFiles", m.DatabaseFiles) + populate(objectMap, "name", m.Name) + populate(objectMap, "restoreDatabaseName", m.RestoreDatabaseName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbForPostgreSQLSyncTaskProperties. -func (m *MigrateOracleAzureDbForPostgreSQLSyncTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerDatabaseInput. +func (m *MigrateSQLServerDatabaseInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4826,26 +7079,64 @@ func (m *MigrateOracleAzureDbForPostgreSQLSyncTaskProperties) UnmarshalJSON(data for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &m.ClientData) + case "backupAndRestoreFolder": + err = unpopulate(val, "BackupAndRestoreFolder", &m.BackupAndRestoreFolder) delete(rawMsg, key) - case "commands": - m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + case "databaseFiles": + err = unpopulate(val, "DatabaseFiles", &m.DatabaseFiles) delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &m.Errors) + case "name": + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &m.Input) + case "restoreDatabaseName": + err = unpopulate(val, "RestoreDatabaseName", &m.RestoreDatabaseName) delete(rawMsg, key) - case "output": - m.Output, err = unmarshalMigrateOracleAzureDbPostgreSQLSyncTaskOutputClassificationArray(val) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbDatabaseInput. +func (m MigrateSQLServerSQLDbDatabaseInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "makeSourceDbReadOnly", m.MakeSourceDbReadOnly) + populate(objectMap, "name", m.Name) + populateAny(objectMap, "schemaSetting", m.SchemaSetting) + populate(objectMap, "tableMap", m.TableMap) + populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbDatabaseInput. +func (m *MigrateSQLServerSQLDbDatabaseInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "makeSourceDbReadOnly": + err = unpopulate(val, "MakeSourceDbReadOnly", &m.MakeSourceDbReadOnly) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &m.TaskType) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "schemaSetting": + err = unpopulate(val, "SchemaSetting", &m.SchemaSetting) + delete(rawMsg, key) + case "tableMap": + err = unpopulate(val, "TableMap", &m.TableMap) + delete(rawMsg, key) + case "targetDatabaseName": + err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) delete(rawMsg, key) } if err != nil { @@ -4855,10 +7146,10 @@ func (m *MigrateOracleAzureDbForPostgreSQLSyncTaskProperties) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncDatabaseInput. -func (m MigrateOracleAzureDbPostgreSQLSyncDatabaseInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncDatabaseInput. +func (m MigrateSQLServerSQLDbSyncDatabaseInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "caseManipulation", m.CaseManipulation) + populate(objectMap, "id", m.ID) populate(objectMap, "migrationSetting", m.MigrationSetting) populate(objectMap, "name", m.Name) populate(objectMap, "schemaName", m.SchemaName) @@ -4869,8 +7160,8 @@ func (m MigrateOracleAzureDbPostgreSQLSyncDatabaseInput) MarshalJSON() ([]byte, return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncDatabaseInput. -func (m *MigrateOracleAzureDbPostgreSQLSyncDatabaseInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncDatabaseInput. +func (m *MigrateSQLServerSQLDbSyncDatabaseInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4878,8 +7169,8 @@ func (m *MigrateOracleAzureDbPostgreSQLSyncDatabaseInput) UnmarshalJSON(data []b for key, val := range rawMsg { var err error switch key { - case "caseManipulation": - err = unpopulate(val, "CaseManipulation", &m.CaseManipulation) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) case "migrationSetting": err = unpopulate(val, "MigrationSetting", &m.MigrationSetting) @@ -4910,17 +7201,18 @@ func (m *MigrateOracleAzureDbPostgreSQLSyncDatabaseInput) UnmarshalJSON(data []b return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskInput. -func (m MigrateOracleAzureDbPostgreSQLSyncTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskInput. +func (m MigrateSQLServerSQLDbSyncTaskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "selectedDatabases", m.SelectedDatabases) populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) + populate(objectMap, "validationOptions", m.ValidationOptions) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskInput. -func (m *MigrateOracleAzureDbPostgreSQLSyncTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskInput. +func (m *MigrateSQLServerSQLDbSyncTaskInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4937,6 +7229,9 @@ func (m *MigrateOracleAzureDbPostgreSQLSyncTaskInput) UnmarshalJSON(data []byte) case "targetConnectionInfo": err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) delete(rawMsg, key) + case "validationOptions": + err = unpopulate(val, "ValidationOptions", &m.ValidationOptions) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4945,16 +7240,16 @@ func (m *MigrateOracleAzureDbPostgreSQLSyncTaskInput) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutput. -func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskOutput. +func (m MigrateSQLServerSQLDbSyncTaskOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", m.ID) objectMap["resultType"] = m.ResultType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutput. -func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskOutput. +func (m *MigrateSQLServerSQLDbSyncTaskOutput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -4976,8 +7271,8 @@ func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutput) UnmarshalJSON(data []byte return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseError. -func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputDatabaseError. +func (m MigrateSQLServerSQLDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "errorMessage", m.ErrorMessage) populate(objectMap, "events", m.Events) @@ -4986,8 +7281,8 @@ func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseError) MarshalJSON() return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseError. -func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputDatabaseError. +func (m *MigrateSQLServerSQLDbSyncTaskOutputDatabaseError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5015,8 +7310,8 @@ func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseError) UnmarshalJSO return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseLevel. -func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputDatabaseLevel. +func (m MigrateSQLServerSQLDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "appliedChanges", m.AppliedChanges) populate(objectMap, "cdcDeleteCounter", m.CdcDeleteCounter) @@ -5038,8 +7333,8 @@ func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseLevel) MarshalJSON() return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseLevel. -func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputDatabaseLevel. +func (m *MigrateSQLServerSQLDbSyncTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5106,8 +7401,8 @@ func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseLevel) UnmarshalJSO return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputError. -func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputError. +func (m MigrateSQLServerSQLDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "error", m.Error) populate(objectMap, "id", m.ID) @@ -5115,8 +7410,8 @@ func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputError) MarshalJSON() ([]byte return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputError. -func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputError. +func (m *MigrateSQLServerSQLDbSyncTaskOutputError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5141,9 +7436,10 @@ func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputError) UnmarshalJSON(data [ return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel. -func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputMigrationLevel. +func (m MigrateSQLServerSQLDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "databaseCount", m.DatabaseCount) populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) populate(objectMap, "id", m.ID) objectMap["resultType"] = "MigrationLevelOutput" @@ -5155,8 +7451,8 @@ func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel) MarshalJSON( return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel. -func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputMigrationLevel. +func (m *MigrateSQLServerSQLDbSyncTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5164,6 +7460,9 @@ func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel) UnmarshalJS for key, val := range rawMsg { var err error switch key { + case "databaseCount": + err = unpopulate(val, "DatabaseCount", &m.DatabaseCount) + delete(rawMsg, key) case "endedOn": err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) @@ -5196,8 +7495,8 @@ func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel) UnmarshalJS return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel. -func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputTableLevel. +func (m MigrateSQLServerSQLDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cdcDeleteCounter", m.CdcDeleteCounter) populate(objectMap, "cdcInsertCounter", m.CdcInsertCounter) @@ -5217,8 +7516,8 @@ func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel) MarshalJSON() ([ return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel. -func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputTableLevel. +func (m *MigrateSQLServerSQLDbSyncTaskOutputTableLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5279,62 +7578,21 @@ func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel) UnmarshalJSON(d return nil } -// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "migrationSetting", m.MigrationSetting) - populate(objectMap, "name", m.Name) - populate(objectMap, "selectedTables", m.SelectedTables) - populate(objectMap, "sourceSetting", m.SourceSetting) - populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) - populate(objectMap, "targetSetting", m.TargetSetting) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput. -func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "migrationSetting": - err = unpopulate(val, "MigrationSetting", &m.MigrationSetting) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "selectedTables": - err = unpopulate(val, "SelectedTables", &m.SelectedTables) - delete(rawMsg, key) - case "sourceSetting": - err = unpopulate(val, "SourceSetting", &m.SourceSetting) - delete(rawMsg, key) - case "targetDatabaseName": - err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) - delete(rawMsg, key) - case "targetSetting": - err = unpopulate(val, "TargetSetting", &m.TargetSetting) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseTableInput. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseTableInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskProperties. +func (m MigrateSQLServerSQLDbSyncTaskProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", m.Name) + populate(objectMap, "clientData", m.ClientData) + populate(objectMap, "commands", m.Commands) + populate(objectMap, "errors", m.Errors) + populate(objectMap, "input", m.Input) + populate(objectMap, "output", m.Output) + populate(objectMap, "state", m.State) + objectMap["taskType"] = TaskTypeMigrateSQLServerAzureSQLDbSync return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseTableInput. -func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseTableInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskProperties. +func (m *MigrateSQLServerSQLDbSyncTaskProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5342,8 +7600,26 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseTableInput) UnmarshalJ for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &m.Name) + case "clientData": + err = unpopulate(val, "ClientData", &m.ClientData) + delete(rawMsg, key) + case "commands": + m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &m.Input) + delete(rawMsg, key) + case "output": + m.Output, err = unmarshalMigrateSQLServerSQLDbSyncTaskOutputClassificationArray(val) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &m.TaskType) delete(rawMsg, key) } if err != nil { @@ -5353,17 +7629,20 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseTableInput) UnmarshalJ return nil } -// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskInput. +func (m MigrateSQLServerSQLDbTaskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "encryptedKeyForSecureFields", m.EncryptedKeyForSecureFields) populate(objectMap, "selectedDatabases", m.SelectedDatabases) populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) + populate(objectMap, "startedOn", m.StartedOn) populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) + populate(objectMap, "validationOptions", m.ValidationOptions) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput. -func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskInput. +func (m *MigrateSQLServerSQLDbTaskInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5371,15 +7650,24 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput) UnmarshalJSON(data for key, val := range rawMsg { var err error switch key { + case "encryptedKeyForSecureFields": + err = unpopulate(val, "EncryptedKeyForSecureFields", &m.EncryptedKeyForSecureFields) + delete(rawMsg, key) case "selectedDatabases": err = unpopulate(val, "SelectedDatabases", &m.SelectedDatabases) delete(rawMsg, key) case "sourceConnectionInfo": err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) delete(rawMsg, key) + case "startedOn": + err = unpopulate(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) case "targetConnectionInfo": err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) delete(rawMsg, key) + case "validationOptions": + err = unpopulate(val, "ValidationOptions", &m.ValidationOptions) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5388,16 +7676,16 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutput. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutput. +func (m MigrateSQLServerSQLDbTaskOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", m.ID) objectMap["resultType"] = m.ResultType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutput. -func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskOutput. +func (m *MigrateSQLServerSQLDbTaskOutput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5419,18 +7707,30 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutput) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseError. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutputDatabaseLevel. +func (m MigrateSQLServerSQLDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "errorMessage", m.ErrorMessage) - populate(objectMap, "events", m.Events) + populate(objectMap, "databaseName", m.DatabaseName) + populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "errorCount", m.ErrorCount) + populate(objectMap, "errorPrefix", m.ErrorPrefix) + populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) populate(objectMap, "id", m.ID) - objectMap["resultType"] = "DatabaseLevelErrorOutput" + populate(objectMap, "message", m.Message) + populate(objectMap, "numberOfObjects", m.NumberOfObjects) + populate(objectMap, "numberOfObjectsCompleted", m.NumberOfObjectsCompleted) + populate(objectMap, "objectSummary", m.ObjectSummary) + populate(objectMap, "resultPrefix", m.ResultPrefix) + objectMap["resultType"] = "DatabaseLevelOutput" + populate(objectMap, "stage", m.Stage) + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "state", m.State) + populate(objectMap, "statusMessage", m.StatusMessage) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseError. -func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskOutputDatabaseLevel. +func (m *MigrateSQLServerSQLDbTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5438,18 +7738,54 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseError) Unmar for key, val := range rawMsg { var err error switch key { - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &m.ErrorMessage) + case "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) delete(rawMsg, key) - case "events": - err = unpopulate(val, "Events", &m.Events) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) + delete(rawMsg, key) + case "errorCount": + err = unpopulate(val, "ErrorCount", &m.ErrorCount) + delete(rawMsg, key) + case "errorPrefix": + err = unpopulate(val, "ErrorPrefix", &m.ErrorPrefix) + delete(rawMsg, key) + case "exceptionsAndWarnings": + err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &m.Message) + delete(rawMsg, key) + case "numberOfObjects": + err = unpopulate(val, "NumberOfObjects", &m.NumberOfObjects) + delete(rawMsg, key) + case "numberOfObjectsCompleted": + err = unpopulate(val, "NumberOfObjectsCompleted", &m.NumberOfObjectsCompleted) + delete(rawMsg, key) + case "objectSummary": + err = unpopulate(val, "ObjectSummary", &m.ObjectSummary) + delete(rawMsg, key) + case "resultPrefix": + err = unpopulate(val, "ResultPrefix", &m.ResultPrefix) + delete(rawMsg, key) case "resultType": err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &m.Stage) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "statusMessage": + err = unpopulate(val, "StatusMessage", &m.StatusMessage) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5458,31 +7794,25 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseError) Unmar return nil } -// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseLevel. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutputDatabaseLevelValidationResult. +func (m MigrateSQLServerSQLDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "appliedChanges", m.AppliedChanges) - populate(objectMap, "cdcDeleteCounter", m.CdcDeleteCounter) - populate(objectMap, "cdcInsertCounter", m.CdcInsertCounter) - populate(objectMap, "cdcUpdateCounter", m.CdcUpdateCounter) - populate(objectMap, "databaseName", m.DatabaseName) + populate(objectMap, "dataIntegrityValidationResult", m.DataIntegrityValidationResult) populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "fullLoadCompletedTables", m.FullLoadCompletedTables) - populate(objectMap, "fullLoadErroredTables", m.FullLoadErroredTables) - populate(objectMap, "fullLoadLoadingTables", m.FullLoadLoadingTables) - populate(objectMap, "fullLoadQueuedTables", m.FullLoadQueuedTables) populate(objectMap, "id", m.ID) - populate(objectMap, "incomingChanges", m.IncomingChanges) - populate(objectMap, "initializationCompleted", m.InitializationCompleted) - populate(objectMap, "latency", m.Latency) - populate(objectMap, "migrationState", m.MigrationState) - objectMap["resultType"] = "DatabaseLevelOutput" + populate(objectMap, "migrationId", m.MigrationID) + populate(objectMap, "queryAnalysisValidationResult", m.QueryAnalysisValidationResult) + objectMap["resultType"] = "MigrationDatabaseLevelValidationOutput" + populate(objectMap, "schemaValidationResult", m.SchemaValidationResult) + populate(objectMap, "sourceDatabaseName", m.SourceDatabaseName) populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "status", m.Status) + populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseLevel. -func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskOutputDatabaseLevelValidationResult. +func (m *MigrateSQLServerSQLDbTaskOutputDatabaseLevelValidationResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5490,57 +7820,39 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseLevel) Unmar for key, val := range rawMsg { var err error switch key { - case "appliedChanges": - err = unpopulate(val, "AppliedChanges", &m.AppliedChanges) - delete(rawMsg, key) - case "cdcDeleteCounter": - err = unpopulate(val, "CdcDeleteCounter", &m.CdcDeleteCounter) - delete(rawMsg, key) - case "cdcInsertCounter": - err = unpopulate(val, "CdcInsertCounter", &m.CdcInsertCounter) - delete(rawMsg, key) - case "cdcUpdateCounter": - err = unpopulate(val, "CdcUpdateCounter", &m.CdcUpdateCounter) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) + case "dataIntegrityValidationResult": + err = unpopulate(val, "DataIntegrityValidationResult", &m.DataIntegrityValidationResult) delete(rawMsg, key) case "endedOn": err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) - case "fullLoadCompletedTables": - err = unpopulate(val, "FullLoadCompletedTables", &m.FullLoadCompletedTables) - delete(rawMsg, key) - case "fullLoadErroredTables": - err = unpopulate(val, "FullLoadErroredTables", &m.FullLoadErroredTables) - delete(rawMsg, key) - case "fullLoadLoadingTables": - err = unpopulate(val, "FullLoadLoadingTables", &m.FullLoadLoadingTables) - delete(rawMsg, key) - case "fullLoadQueuedTables": - err = unpopulate(val, "FullLoadQueuedTables", &m.FullLoadQueuedTables) - delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "incomingChanges": - err = unpopulate(val, "IncomingChanges", &m.IncomingChanges) - delete(rawMsg, key) - case "initializationCompleted": - err = unpopulate(val, "InitializationCompleted", &m.InitializationCompleted) - delete(rawMsg, key) - case "latency": - err = unpopulate(val, "Latency", &m.Latency) + case "migrationId": + err = unpopulate(val, "MigrationID", &m.MigrationID) delete(rawMsg, key) - case "migrationState": - err = unpopulate(val, "MigrationState", &m.MigrationState) + case "queryAnalysisValidationResult": + err = unpopulate(val, "QueryAnalysisValidationResult", &m.QueryAnalysisValidationResult) delete(rawMsg, key) case "resultType": err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) + case "schemaValidationResult": + err = unpopulate(val, "SchemaValidationResult", &m.SchemaValidationResult) + delete(rawMsg, key) + case "sourceDatabaseName": + err = unpopulate(val, "SourceDatabaseName", &m.SourceDatabaseName) + delete(rawMsg, key) case "startedOn": err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "targetDatabaseName": + err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5549,8 +7861,8 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseLevel) Unmar return nil } -// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutputError. +func (m MigrateSQLServerSQLDbTaskOutputError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "error", m.Error) populate(objectMap, "id", m.ID) @@ -5558,8 +7870,8 @@ func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError) MarshalJSON() return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError. -func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskOutputError. +func (m *MigrateSQLServerSQLDbTaskOutputError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5584,25 +7896,116 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError) UnmarshalJSON return nil } -// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutputMigrationLevel. +func (m MigrateSQLServerSQLDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseSummary", m.DatabaseSummary) + populate(objectMap, "databases", m.Databases) + populate(objectMap, "durationInSeconds", m.DurationInSeconds) + populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) + populate(objectMap, "id", m.ID) + populate(objectMap, "message", m.Message) + populate(objectMap, "migrationReportResult", m.MigrationReportResult) + populate(objectMap, "migrationValidationResult", m.MigrationValidationResult) + objectMap["resultType"] = "MigrationLevelOutput" + populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) + populate(objectMap, "sourceServerVersion", m.SourceServerVersion) + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "status", m.Status) + populate(objectMap, "statusMessage", m.StatusMessage) + populate(objectMap, "targetServerBrandVersion", m.TargetServerBrandVersion) + populate(objectMap, "targetServerVersion", m.TargetServerVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskOutputMigrationLevel. +func (m *MigrateSQLServerSQLDbTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseSummary": + err = unpopulate(val, "DatabaseSummary", &m.DatabaseSummary) + delete(rawMsg, key) + case "databases": + err = unpopulate(val, "Databases", &m.Databases) + delete(rawMsg, key) + case "durationInSeconds": + err = unpopulate(val, "DurationInSeconds", &m.DurationInSeconds) + delete(rawMsg, key) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) + delete(rawMsg, key) + case "exceptionsAndWarnings": + err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &m.Message) + delete(rawMsg, key) + case "migrationReportResult": + err = unpopulate(val, "MigrationReportResult", &m.MigrationReportResult) + delete(rawMsg, key) + case "migrationValidationResult": + err = unpopulate(val, "MigrationValidationResult", &m.MigrationValidationResult) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + case "sourceServerBrandVersion": + err = unpopulate(val, "SourceServerBrandVersion", &m.SourceServerBrandVersion) + delete(rawMsg, key) + case "sourceServerVersion": + err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "statusMessage": + err = unpopulate(val, "StatusMessage", &m.StatusMessage) + delete(rawMsg, key) + case "targetServerBrandVersion": + err = unpopulate(val, "TargetServerBrandVersion", &m.TargetServerBrandVersion) + delete(rawMsg, key) + case "targetServerVersion": + err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutputTableLevel. +func (m MigrateSQLServerSQLDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "errorPrefix", m.ErrorPrefix) populate(objectMap, "id", m.ID) - objectMap["resultType"] = "MigrationLevelOutput" - populate(objectMap, "sourceServer", m.SourceServer) - populate(objectMap, "sourceServerType", m.SourceServerType) - populate(objectMap, "sourceServerVersion", m.SourceServerVersion) + populate(objectMap, "itemsCompletedCount", m.ItemsCompletedCount) + populate(objectMap, "itemsCount", m.ItemsCount) + populate(objectMap, "objectName", m.ObjectName) + populate(objectMap, "resultPrefix", m.ResultPrefix) + objectMap["resultType"] = "TableLevelOutput" populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) populate(objectMap, "state", m.State) - populate(objectMap, "targetServer", m.TargetServer) - populate(objectMap, "targetServerType", m.TargetServerType) - populate(objectMap, "targetServerVersion", m.TargetServerVersion) + populate(objectMap, "statusMessage", m.StatusMessage) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel. -func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskOutputTableLevel. +func (m *MigrateSQLServerSQLDbTaskOutputTableLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5613,20 +8016,26 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel) Unma case "endedOn": err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) + case "errorPrefix": + err = unpopulate(val, "ErrorPrefix", &m.ErrorPrefix) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "itemsCompletedCount": + err = unpopulate(val, "ItemsCompletedCount", &m.ItemsCompletedCount) delete(rawMsg, key) - case "sourceServer": - err = unpopulate(val, "SourceServer", &m.SourceServer) + case "itemsCount": + err = unpopulate(val, "ItemsCount", &m.ItemsCount) delete(rawMsg, key) - case "sourceServerType": - err = unpopulate(val, "SourceServerType", &m.SourceServerType) + case "objectName": + err = unpopulate(val, "ObjectName", &m.ObjectName) delete(rawMsg, key) - case "sourceServerVersion": - err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) + case "resultPrefix": + err = unpopulate(val, "ResultPrefix", &m.ResultPrefix) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) case "startedOn": err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) @@ -5634,14 +8043,8 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel) Unma case "state": err = unpopulate(val, "State", &m.State) delete(rawMsg, key) - case "targetServer": - err = unpopulate(val, "TargetServer", &m.TargetServer) - delete(rawMsg, key) - case "targetServerType": - err = unpopulate(val, "TargetServerType", &m.TargetServerType) - delete(rawMsg, key) - case "targetServerVersion": - err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) + case "statusMessage": + err = unpopulate(val, "StatusMessage", &m.StatusMessage) delete(rawMsg, key) } if err != nil { @@ -5651,29 +8054,19 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel) Unma return nil } -// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputTableLevel. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutputValidationResult. +func (m MigrateSQLServerSQLDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cdcDeleteCounter", m.CdcDeleteCounter) - populate(objectMap, "cdcInsertCounter", m.CdcInsertCounter) - populate(objectMap, "cdcUpdateCounter", m.CdcUpdateCounter) - populate(objectMap, "dataErrorsCounter", m.DataErrorsCounter) - populate(objectMap, "databaseName", m.DatabaseName) - populateDateTimeRFC3339(objectMap, "fullLoadEndedOn", m.FullLoadEndedOn) - populateDateTimeRFC3339(objectMap, "fullLoadEstFinishTime", m.FullLoadEstFinishTime) - populateDateTimeRFC3339(objectMap, "fullLoadStartedOn", m.FullLoadStartedOn) - populate(objectMap, "fullLoadTotalRows", m.FullLoadTotalRows) populate(objectMap, "id", m.ID) - populateDateTimeRFC3339(objectMap, "lastModifiedTime", m.LastModifiedTime) - objectMap["resultType"] = "TableLevelOutput" - populate(objectMap, "state", m.State) - populate(objectMap, "tableName", m.TableName) - populate(objectMap, "totalChangesApplied", m.TotalChangesApplied) + populate(objectMap, "migrationId", m.MigrationID) + objectMap["resultType"] = "MigrationValidationOutput" + populate(objectMap, "status", m.Status) + populate(objectMap, "summaryResults", m.SummaryResults) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputTableLevel. -func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputTableLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskOutputValidationResult. +func (m *MigrateSQLServerSQLDbTaskOutputValidationResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5681,50 +8074,20 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputTableLevel) Unmarsha for key, val := range rawMsg { var err error switch key { - case "cdcDeleteCounter": - err = unpopulate(val, "CdcDeleteCounter", &m.CdcDeleteCounter) - delete(rawMsg, key) - case "cdcInsertCounter": - err = unpopulate(val, "CdcInsertCounter", &m.CdcInsertCounter) - delete(rawMsg, key) - case "cdcUpdateCounter": - err = unpopulate(val, "CdcUpdateCounter", &m.CdcUpdateCounter) - delete(rawMsg, key) - case "dataErrorsCounter": - err = unpopulate(val, "DataErrorsCounter", &m.DataErrorsCounter) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) - delete(rawMsg, key) - case "fullLoadEndedOn": - err = unpopulateDateTimeRFC3339(val, "FullLoadEndedOn", &m.FullLoadEndedOn) - delete(rawMsg, key) - case "fullLoadEstFinishTime": - err = unpopulateDateTimeRFC3339(val, "FullLoadEstFinishTime", &m.FullLoadEstFinishTime) - delete(rawMsg, key) - case "fullLoadStartedOn": - err = unpopulateDateTimeRFC3339(val, "FullLoadStartedOn", &m.FullLoadStartedOn) - delete(rawMsg, key) - case "fullLoadTotalRows": - err = unpopulate(val, "FullLoadTotalRows", &m.FullLoadTotalRows) - delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &m.LastModifiedTime) + case "migrationId": + err = unpopulate(val, "MigrationID", &m.MigrationID) delete(rawMsg, key) case "resultType": err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) - delete(rawMsg, key) - case "tableName": - err = unpopulate(val, "TableName", &m.TableName) + case "status": + err = unpopulate(val, "Status", &m.Status) delete(rawMsg, key) - case "totalChangesApplied": - err = unpopulate(val, "TotalChangesApplied", &m.TotalChangesApplied) + case "summaryResults": + err = unpopulate(val, "SummaryResults", &m.SummaryResults) delete(rawMsg, key) } if err != nil { @@ -5734,21 +8097,24 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputTableLevel) Unmarsha return nil } -// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskProperties. +func (m MigrateSQLServerSQLDbTaskProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "clientData", m.ClientData) populate(objectMap, "commands", m.Commands) + populate(objectMap, "createdOn", m.CreatedOn) populate(objectMap, "errors", m.Errors) populate(objectMap, "input", m.Input) + populate(objectMap, "isCloneable", m.IsCloneable) populate(objectMap, "output", m.Output) populate(objectMap, "state", m.State) - objectMap["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2" + populate(objectMap, "taskId", m.TaskID) + objectMap["taskType"] = TaskTypeMigrateSQLServerSQLDb return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties. -func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskProperties. +func (m *MigrateSQLServerSQLDbTaskProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5762,18 +8128,27 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties) UnmarshalJSON( case "commands": m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) delete(rawMsg, key) + case "createdOn": + err = unpopulate(val, "CreatedOn", &m.CreatedOn) + delete(rawMsg, key) case "errors": err = unpopulate(val, "Errors", &m.Errors) delete(rawMsg, key) case "input": err = unpopulate(val, "Input", &m.Input) delete(rawMsg, key) + case "isCloneable": + err = unpopulate(val, "IsCloneable", &m.IsCloneable) + delete(rawMsg, key) case "output": - m.Output, err = unmarshalMigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputClassificationArray(val) + m.Output, err = unmarshalMigrateSQLServerSQLDbTaskOutputClassificationArray(val) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &m.State) delete(rawMsg, key) + case "taskId": + err = unpopulate(val, "TaskID", &m.TaskID) + delete(rawMsg, key) case "taskType": err = unpopulate(val, "TaskType", &m.TaskType) delete(rawMsg, key) @@ -5785,18 +8160,19 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties) UnmarshalJSON( return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerDatabaseInput. -func (m MigrateSQLServerDatabaseInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMIDatabaseInput. +func (m MigrateSQLServerSQLMIDatabaseInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "backupAndRestoreFolder", m.BackupAndRestoreFolder) - populate(objectMap, "databaseFiles", m.DatabaseFiles) + populate(objectMap, "backupFilePaths", m.BackupFilePaths) + populate(objectMap, "backupFileShare", m.BackupFileShare) + populate(objectMap, "id", m.ID) populate(objectMap, "name", m.Name) populate(objectMap, "restoreDatabaseName", m.RestoreDatabaseName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerDatabaseInput. -func (m *MigrateSQLServerDatabaseInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMIDatabaseInput. +func (m *MigrateSQLServerSQLMIDatabaseInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5804,11 +8180,14 @@ func (m *MigrateSQLServerDatabaseInput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "backupAndRestoreFolder": - err = unpopulate(val, "BackupAndRestoreFolder", &m.BackupAndRestoreFolder) + case "backupFilePaths": + err = unpopulate(val, "BackupFilePaths", &m.BackupFilePaths) delete(rawMsg, key) - case "databaseFiles": - err = unpopulate(val, "DatabaseFiles", &m.DatabaseFiles) + case "backupFileShare": + err = unpopulate(val, "BackupFileShare", &m.BackupFileShare) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &m.Name) @@ -5824,18 +8203,21 @@ func (m *MigrateSQLServerDatabaseInput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbDatabaseInput. -func (m MigrateSQLServerSQLDbDatabaseInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskInput. +func (m MigrateSQLServerSQLMISyncTaskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "makeSourceDbReadOnly", m.MakeSourceDbReadOnly) - populate(objectMap, "name", m.Name) - populate(objectMap, "tableMap", m.TableMap) - populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) + populate(objectMap, "azureApp", m.AzureApp) + populate(objectMap, "backupFileShare", m.BackupFileShare) + populate(objectMap, "numberOfParallelDatabaseMigrations", m.NumberOfParallelDatabaseMigrations) + populate(objectMap, "selectedDatabases", m.SelectedDatabases) + populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) + populate(objectMap, "storageResourceId", m.StorageResourceID) + populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbDatabaseInput. -func (m *MigrateSQLServerSQLDbDatabaseInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMISyncTaskInput. +func (m *MigrateSQLServerSQLMISyncTaskInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5843,17 +8225,26 @@ func (m *MigrateSQLServerSQLDbDatabaseInput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "makeSourceDbReadOnly": - err = unpopulate(val, "MakeSourceDbReadOnly", &m.MakeSourceDbReadOnly) + case "azureApp": + err = unpopulate(val, "AzureApp", &m.AzureApp) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "backupFileShare": + err = unpopulate(val, "BackupFileShare", &m.BackupFileShare) delete(rawMsg, key) - case "tableMap": - err = unpopulate(val, "TableMap", &m.TableMap) + case "numberOfParallelDatabaseMigrations": + err = unpopulate(val, "NumberOfParallelDatabaseMigrations", &m.NumberOfParallelDatabaseMigrations) delete(rawMsg, key) - case "targetDatabaseName": - err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) + case "selectedDatabases": + err = unpopulate(val, "SelectedDatabases", &m.SelectedDatabases) + delete(rawMsg, key) + case "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) + delete(rawMsg, key) + case "storageResourceId": + err = unpopulate(val, "StorageResourceID", &m.StorageResourceID) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) delete(rawMsg, key) } if err != nil { @@ -5863,22 +8254,16 @@ func (m *MigrateSQLServerSQLDbDatabaseInput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncDatabaseInput. -func (m MigrateSQLServerSQLDbSyncDatabaseInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskOutput. +func (m MigrateSQLServerSQLMISyncTaskOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", m.ID) - populate(objectMap, "migrationSetting", m.MigrationSetting) - populate(objectMap, "name", m.Name) - populate(objectMap, "schemaName", m.SchemaName) - populate(objectMap, "sourceSetting", m.SourceSetting) - populate(objectMap, "tableMap", m.TableMap) - populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) - populate(objectMap, "targetSetting", m.TargetSetting) + objectMap["resultType"] = m.ResultType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncDatabaseInput. -func (m *MigrateSQLServerSQLDbSyncDatabaseInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMISyncTaskOutput. +func (m *MigrateSQLServerSQLMISyncTaskOutput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5889,26 +8274,8 @@ func (m *MigrateSQLServerSQLDbSyncDatabaseInput) UnmarshalJSON(data []byte) erro case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "migrationSetting": - err = unpopulate(val, "MigrationSetting", &m.MigrationSetting) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "schemaName": - err = unpopulate(val, "SchemaName", &m.SchemaName) - delete(rawMsg, key) - case "sourceSetting": - err = unpopulate(val, "SourceSetting", &m.SourceSetting) - delete(rawMsg, key) - case "tableMap": - err = unpopulate(val, "TableMap", &m.TableMap) - delete(rawMsg, key) - case "targetDatabaseName": - err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) - delete(rawMsg, key) - case "targetSetting": - err = unpopulate(val, "TargetSetting", &m.TargetSetting) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) } if err != nil { @@ -5918,18 +8285,27 @@ func (m *MigrateSQLServerSQLDbSyncDatabaseInput) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskInput. -func (m MigrateSQLServerSQLDbSyncTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskOutputDatabaseLevel. +func (m MigrateSQLServerSQLMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "selectedDatabases", m.SelectedDatabases) - populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) - populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) - populate(objectMap, "validationOptions", m.ValidationOptions) + populate(objectMap, "activeBackupSets", m.ActiveBackupSets) + populate(objectMap, "containerName", m.ContainerName) + populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "errorPrefix", m.ErrorPrefix) + populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) + populate(objectMap, "fullBackupSetInfo", m.FullBackupSetInfo) + populate(objectMap, "id", m.ID) + populate(objectMap, "isFullBackupRestored", m.IsFullBackupRestored) + populate(objectMap, "lastRestoredBackupSetInfo", m.LastRestoredBackupSetInfo) + populate(objectMap, "migrationState", m.MigrationState) + objectMap["resultType"] = "DatabaseLevelOutput" + populate(objectMap, "sourceDatabaseName", m.SourceDatabaseName) + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskInput. -func (m *MigrateSQLServerSQLDbSyncTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMISyncTaskOutputDatabaseLevel. +func (m *MigrateSQLServerSQLMISyncTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5937,17 +8313,44 @@ func (m *MigrateSQLServerSQLDbSyncTaskInput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "selectedDatabases": - err = unpopulate(val, "SelectedDatabases", &m.SelectedDatabases) + case "activeBackupSets": + err = unpopulate(val, "ActiveBackupSets", &m.ActiveBackupSets) delete(rawMsg, key) - case "sourceConnectionInfo": - err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) + case "containerName": + err = unpopulate(val, "ContainerName", &m.ContainerName) delete(rawMsg, key) - case "targetConnectionInfo": - err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) - case "validationOptions": - err = unpopulate(val, "ValidationOptions", &m.ValidationOptions) + case "errorPrefix": + err = unpopulate(val, "ErrorPrefix", &m.ErrorPrefix) + delete(rawMsg, key) + case "exceptionsAndWarnings": + err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) + delete(rawMsg, key) + case "fullBackupSetInfo": + err = unpopulate(val, "FullBackupSetInfo", &m.FullBackupSetInfo) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "isFullBackupRestored": + err = unpopulate(val, "IsFullBackupRestored", &m.IsFullBackupRestored) + delete(rawMsg, key) + case "lastRestoredBackupSetInfo": + err = unpopulate(val, "LastRestoredBackupSetInfo", &m.LastRestoredBackupSetInfo) + delete(rawMsg, key) + case "migrationState": + err = unpopulate(val, "MigrationState", &m.MigrationState) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + case "sourceDatabaseName": + err = unpopulate(val, "SourceDatabaseName", &m.SourceDatabaseName) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) delete(rawMsg, key) } if err != nil { @@ -5957,16 +8360,17 @@ func (m *MigrateSQLServerSQLDbSyncTaskInput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskOutput. -func (m MigrateSQLServerSQLDbSyncTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskOutputError. +func (m MigrateSQLServerSQLMISyncTaskOutputError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "error", m.Error) populate(objectMap, "id", m.ID) - objectMap["resultType"] = m.ResultType + objectMap["resultType"] = "ErrorOutput" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskOutput. -func (m *MigrateSQLServerSQLDbSyncTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMISyncTaskOutputError. +func (m *MigrateSQLServerSQLMISyncTaskOutputError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -5974,6 +8378,9 @@ func (m *MigrateSQLServerSQLDbSyncTaskOutput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "error": + err = unpopulate(val, "Error", &m.Error) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) @@ -5988,18 +8395,27 @@ func (m *MigrateSQLServerSQLDbSyncTaskOutput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputDatabaseError. -func (m MigrateSQLServerSQLDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskOutputMigrationLevel. +func (m MigrateSQLServerSQLMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "errorMessage", m.ErrorMessage) - populate(objectMap, "events", m.Events) + populate(objectMap, "databaseCount", m.DatabaseCount) + populate(objectMap, "databaseErrorCount", m.DatabaseErrorCount) + populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) populate(objectMap, "id", m.ID) - objectMap["resultType"] = "DatabaseLevelErrorOutput" + objectMap["resultType"] = "MigrationLevelOutput" + populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) + populate(objectMap, "sourceServerName", m.SourceServerName) + populate(objectMap, "sourceServerVersion", m.SourceServerVersion) + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "state", m.State) + populate(objectMap, "targetServerBrandVersion", m.TargetServerBrandVersion) + populate(objectMap, "targetServerName", m.TargetServerName) + populate(objectMap, "targetServerVersion", m.TargetServerVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputDatabaseError. -func (m *MigrateSQLServerSQLDbSyncTaskOutputDatabaseError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMISyncTaskOutputMigrationLevel. +func (m *MigrateSQLServerSQLMISyncTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6007,11 +8423,14 @@ func (m *MigrateSQLServerSQLDbSyncTaskOutputDatabaseError) UnmarshalJSON(data [] for key, val := range rawMsg { var err error switch key { - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &m.ErrorMessage) + case "databaseCount": + err = unpopulate(val, "DatabaseCount", &m.DatabaseCount) delete(rawMsg, key) - case "events": - err = unpopulate(val, "Events", &m.Events) + case "databaseErrorCount": + err = unpopulate(val, "DatabaseErrorCount", &m.DatabaseErrorCount) + delete(rawMsg, key) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) @@ -6019,6 +8438,30 @@ func (m *MigrateSQLServerSQLDbSyncTaskOutputDatabaseError) UnmarshalJSON(data [] case "resultType": err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) + case "sourceServerBrandVersion": + err = unpopulate(val, "SourceServerBrandVersion", &m.SourceServerBrandVersion) + delete(rawMsg, key) + case "sourceServerName": + err = unpopulate(val, "SourceServerName", &m.SourceServerName) + delete(rawMsg, key) + case "sourceServerVersion": + err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "targetServerBrandVersion": + err = unpopulate(val, "TargetServerBrandVersion", &m.TargetServerBrandVersion) + delete(rawMsg, key) + case "targetServerName": + err = unpopulate(val, "TargetServerName", &m.TargetServerName) + delete(rawMsg, key) + case "targetServerVersion": + err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6027,31 +8470,22 @@ func (m *MigrateSQLServerSQLDbSyncTaskOutputDatabaseError) UnmarshalJSON(data [] return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputDatabaseLevel. -func (m MigrateSQLServerSQLDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskProperties. +func (m MigrateSQLServerSQLMISyncTaskProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "appliedChanges", m.AppliedChanges) - populate(objectMap, "cdcDeleteCounter", m.CdcDeleteCounter) - populate(objectMap, "cdcInsertCounter", m.CdcInsertCounter) - populate(objectMap, "cdcUpdateCounter", m.CdcUpdateCounter) - populate(objectMap, "databaseName", m.DatabaseName) - populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "fullLoadCompletedTables", m.FullLoadCompletedTables) - populate(objectMap, "fullLoadErroredTables", m.FullLoadErroredTables) - populate(objectMap, "fullLoadLoadingTables", m.FullLoadLoadingTables) - populate(objectMap, "fullLoadQueuedTables", m.FullLoadQueuedTables) - populate(objectMap, "id", m.ID) - populate(objectMap, "incomingChanges", m.IncomingChanges) - populate(objectMap, "initializationCompleted", m.InitializationCompleted) - populate(objectMap, "latency", m.Latency) - populate(objectMap, "migrationState", m.MigrationState) - objectMap["resultType"] = "DatabaseLevelOutput" - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "clientData", m.ClientData) + populate(objectMap, "commands", m.Commands) + populate(objectMap, "createdOn", m.CreatedOn) + populate(objectMap, "errors", m.Errors) + populate(objectMap, "input", m.Input) + populate(objectMap, "output", m.Output) + populate(objectMap, "state", m.State) + objectMap["taskType"] = TaskTypeMigrateSQLServerAzureSQLDbMISyncLRS return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputDatabaseLevel. -func (m *MigrateSQLServerSQLDbSyncTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMISyncTaskProperties. +func (m *MigrateSQLServerSQLMISyncTaskProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6059,56 +8493,96 @@ func (m *MigrateSQLServerSQLDbSyncTaskOutputDatabaseLevel) UnmarshalJSON(data [] for key, val := range rawMsg { var err error switch key { - case "appliedChanges": - err = unpopulate(val, "AppliedChanges", &m.AppliedChanges) + case "clientData": + err = unpopulate(val, "ClientData", &m.ClientData) delete(rawMsg, key) - case "cdcDeleteCounter": - err = unpopulate(val, "CdcDeleteCounter", &m.CdcDeleteCounter) + case "commands": + m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) delete(rawMsg, key) - case "cdcInsertCounter": - err = unpopulate(val, "CdcInsertCounter", &m.CdcInsertCounter) + case "createdOn": + err = unpopulate(val, "CreatedOn", &m.CreatedOn) delete(rawMsg, key) - case "cdcUpdateCounter": - err = unpopulate(val, "CdcUpdateCounter", &m.CdcUpdateCounter) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) + case "input": + err = unpopulate(val, "Input", &m.Input) delete(rawMsg, key) - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) + case "output": + m.Output, err = unmarshalMigrateSQLServerSQLMISyncTaskOutputClassificationArray(val) delete(rawMsg, key) - case "fullLoadCompletedTables": - err = unpopulate(val, "FullLoadCompletedTables", &m.FullLoadCompletedTables) + case "state": + err = unpopulate(val, "State", &m.State) delete(rawMsg, key) - case "fullLoadErroredTables": - err = unpopulate(val, "FullLoadErroredTables", &m.FullLoadErroredTables) + case "taskType": + err = unpopulate(val, "TaskType", &m.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskInput. +func (m MigrateSQLServerSQLMITaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aadDomainName", m.AADDomainName) + populate(objectMap, "backupBlobShare", m.BackupBlobShare) + populate(objectMap, "backupFileShare", m.BackupFileShare) + populate(objectMap, "backupMode", m.BackupMode) + populate(objectMap, "encryptedKeyForSecureFields", m.EncryptedKeyForSecureFields) + populate(objectMap, "selectedAgentJobs", m.SelectedAgentJobs) + populate(objectMap, "selectedDatabases", m.SelectedDatabases) + populate(objectMap, "selectedLogins", m.SelectedLogins) + populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) + populate(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskInput. +func (m *MigrateSQLServerSQLMITaskInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aadDomainName": + err = unpopulate(val, "AADDomainName", &m.AADDomainName) delete(rawMsg, key) - case "fullLoadLoadingTables": - err = unpopulate(val, "FullLoadLoadingTables", &m.FullLoadLoadingTables) + case "backupBlobShare": + err = unpopulate(val, "BackupBlobShare", &m.BackupBlobShare) delete(rawMsg, key) - case "fullLoadQueuedTables": - err = unpopulate(val, "FullLoadQueuedTables", &m.FullLoadQueuedTables) + case "backupFileShare": + err = unpopulate(val, "BackupFileShare", &m.BackupFileShare) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) + case "backupMode": + err = unpopulate(val, "BackupMode", &m.BackupMode) delete(rawMsg, key) - case "incomingChanges": - err = unpopulate(val, "IncomingChanges", &m.IncomingChanges) + case "encryptedKeyForSecureFields": + err = unpopulate(val, "EncryptedKeyForSecureFields", &m.EncryptedKeyForSecureFields) delete(rawMsg, key) - case "initializationCompleted": - err = unpopulate(val, "InitializationCompleted", &m.InitializationCompleted) + case "selectedAgentJobs": + err = unpopulate(val, "SelectedAgentJobs", &m.SelectedAgentJobs) delete(rawMsg, key) - case "latency": - err = unpopulate(val, "Latency", &m.Latency) + case "selectedDatabases": + err = unpopulate(val, "SelectedDatabases", &m.SelectedDatabases) delete(rawMsg, key) - case "migrationState": - err = unpopulate(val, "MigrationState", &m.MigrationState) + case "selectedLogins": + err = unpopulate(val, "SelectedLogins", &m.SelectedLogins) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) delete(rawMsg, key) case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + err = unpopulate(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) delete(rawMsg, key) } if err != nil { @@ -6118,17 +8592,16 @@ func (m *MigrateSQLServerSQLDbSyncTaskOutputDatabaseLevel) UnmarshalJSON(data [] return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputError. -func (m MigrateSQLServerSQLDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutput. +func (m MigrateSQLServerSQLMITaskOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", m.Error) populate(objectMap, "id", m.ID) - objectMap["resultType"] = "ErrorOutput" + objectMap["resultType"] = m.ResultType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputError. -func (m *MigrateSQLServerSQLDbSyncTaskOutputError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskOutput. +func (m *MigrateSQLServerSQLMITaskOutput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6136,9 +8609,6 @@ func (m *MigrateSQLServerSQLDbSyncTaskOutputError) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &m.Error) - delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) @@ -6153,23 +8623,23 @@ func (m *MigrateSQLServerSQLDbSyncTaskOutputError) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputMigrationLevel. -func (m MigrateSQLServerSQLDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputAgentJobLevel. +func (m MigrateSQLServerSQLMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseCount", m.DatabaseCount) populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) populate(objectMap, "id", m.ID) - objectMap["resultType"] = "MigrationLevelOutput" - populate(objectMap, "sourceServer", m.SourceServer) - populate(objectMap, "sourceServerVersion", m.SourceServerVersion) + populate(objectMap, "isEnabled", m.IsEnabled) + populate(objectMap, "message", m.Message) + populate(objectMap, "name", m.Name) + objectMap["resultType"] = "AgentJobLevelOutput" populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "targetServer", m.TargetServer) - populate(objectMap, "targetServerVersion", m.TargetServerVersion) + populate(objectMap, "state", m.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputMigrationLevel. -func (m *MigrateSQLServerSQLDbSyncTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskOutputAgentJobLevel. +func (m *MigrateSQLServerSQLMITaskOutputAgentJobLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6177,32 +8647,32 @@ func (m *MigrateSQLServerSQLDbSyncTaskOutputMigrationLevel) UnmarshalJSON(data [ for key, val := range rawMsg { var err error switch key { - case "databaseCount": - err = unpopulate(val, "DatabaseCount", &m.DatabaseCount) - delete(rawMsg, key) case "endedOn": err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) + case "exceptionsAndWarnings": + err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &m.IsEnabled) delete(rawMsg, key) - case "sourceServer": - err = unpopulate(val, "SourceServer", &m.SourceServer) + case "message": + err = unpopulate(val, "Message", &m.Message) delete(rawMsg, key) - case "sourceServerVersion": - err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) case "startedOn": err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) delete(rawMsg, key) - case "targetServer": - err = unpopulate(val, "TargetServer", &m.TargetServer) - delete(rawMsg, key) - case "targetServerVersion": - err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) + case "state": + err = unpopulate(val, "State", &m.State) delete(rawMsg, key) } if err != nil { @@ -6212,29 +8682,24 @@ func (m *MigrateSQLServerSQLDbSyncTaskOutputMigrationLevel) UnmarshalJSON(data [ return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputTableLevel. -func (m MigrateSQLServerSQLDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputDatabaseLevel. +func (m MigrateSQLServerSQLMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cdcDeleteCounter", m.CdcDeleteCounter) - populate(objectMap, "cdcInsertCounter", m.CdcInsertCounter) - populate(objectMap, "cdcUpdateCounter", m.CdcUpdateCounter) - populate(objectMap, "dataErrorsCounter", m.DataErrorsCounter) populate(objectMap, "databaseName", m.DatabaseName) - populateDateTimeRFC3339(objectMap, "fullLoadEndedOn", m.FullLoadEndedOn) - populateDateTimeRFC3339(objectMap, "fullLoadEstFinishTime", m.FullLoadEstFinishTime) - populateDateTimeRFC3339(objectMap, "fullLoadStartedOn", m.FullLoadStartedOn) - populate(objectMap, "fullLoadTotalRows", m.FullLoadTotalRows) + populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) populate(objectMap, "id", m.ID) - populateDateTimeRFC3339(objectMap, "lastModifiedTime", m.LastModifiedTime) - objectMap["resultType"] = "TableLevelOutput" + populate(objectMap, "message", m.Message) + objectMap["resultType"] = "DatabaseLevelOutput" + populate(objectMap, "sizeMB", m.SizeMB) + populate(objectMap, "stage", m.Stage) + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) populate(objectMap, "state", m.State) - populate(objectMap, "tableName", m.TableName) - populate(objectMap, "totalChangesApplied", m.TotalChangesApplied) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputTableLevel. -func (m *MigrateSQLServerSQLDbSyncTaskOutputTableLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskOutputDatabaseLevel. +func (m *MigrateSQLServerSQLMITaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6242,102 +8707,36 @@ func (m *MigrateSQLServerSQLDbSyncTaskOutputTableLevel) UnmarshalJSON(data []byt for key, val := range rawMsg { var err error switch key { - case "cdcDeleteCounter": - err = unpopulate(val, "CdcDeleteCounter", &m.CdcDeleteCounter) - delete(rawMsg, key) - case "cdcInsertCounter": - err = unpopulate(val, "CdcInsertCounter", &m.CdcInsertCounter) - delete(rawMsg, key) - case "cdcUpdateCounter": - err = unpopulate(val, "CdcUpdateCounter", &m.CdcUpdateCounter) - delete(rawMsg, key) - case "dataErrorsCounter": - err = unpopulate(val, "DataErrorsCounter", &m.DataErrorsCounter) - delete(rawMsg, key) case "databaseName": err = unpopulate(val, "DatabaseName", &m.DatabaseName) delete(rawMsg, key) - case "fullLoadEndedOn": - err = unpopulateDateTimeRFC3339(val, "FullLoadEndedOn", &m.FullLoadEndedOn) - delete(rawMsg, key) - case "fullLoadEstFinishTime": - err = unpopulateDateTimeRFC3339(val, "FullLoadEstFinishTime", &m.FullLoadEstFinishTime) - delete(rawMsg, key) - case "fullLoadStartedOn": - err = unpopulateDateTimeRFC3339(val, "FullLoadStartedOn", &m.FullLoadStartedOn) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) - case "fullLoadTotalRows": - err = unpopulate(val, "FullLoadTotalRows", &m.FullLoadTotalRows) + case "exceptionsAndWarnings": + err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &m.LastModifiedTime) + case "message": + err = unpopulate(val, "Message", &m.Message) delete(rawMsg, key) case "resultType": err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) - delete(rawMsg, key) - case "tableName": - err = unpopulate(val, "TableName", &m.TableName) - delete(rawMsg, key) - case "totalChangesApplied": - err = unpopulate(val, "TotalChangesApplied", &m.TotalChangesApplied) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskProperties. -func (m MigrateSQLServerSQLDbSyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "clientData", m.ClientData) - populate(objectMap, "commands", m.Commands) - populate(objectMap, "errors", m.Errors) - populate(objectMap, "input", m.Input) - populate(objectMap, "output", m.Output) - populate(objectMap, "state", m.State) - objectMap["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbSyncTaskProperties. -func (m *MigrateSQLServerSQLDbSyncTaskProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientData": - err = unpopulate(val, "ClientData", &m.ClientData) - delete(rawMsg, key) - case "commands": - m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &m.Errors) + case "sizeMB": + err = unpopulate(val, "SizeMB", &m.SizeMB) delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &m.Input) + case "stage": + err = unpopulate(val, "Stage", &m.Stage) delete(rawMsg, key) - case "output": - m.Output, err = unmarshalMigrateSQLServerSQLDbSyncTaskOutputClassificationArray(val) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &m.State) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &m.TaskType) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6346,18 +8745,17 @@ func (m *MigrateSQLServerSQLDbSyncTaskProperties) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskInput. -func (m MigrateSQLServerSQLDbTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputError. +func (m MigrateSQLServerSQLMITaskOutputError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "selectedDatabases", m.SelectedDatabases) - populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) - populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) - populate(objectMap, "validationOptions", m.ValidationOptions) + populate(objectMap, "error", m.Error) + populate(objectMap, "id", m.ID) + objectMap["resultType"] = "ErrorOutput" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskInput. -func (m *MigrateSQLServerSQLDbTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskOutputError. +func (m *MigrateSQLServerSQLMITaskOutputError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6365,17 +8763,14 @@ func (m *MigrateSQLServerSQLDbTaskInput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "selectedDatabases": - err = unpopulate(val, "SelectedDatabases", &m.SelectedDatabases) - delete(rawMsg, key) - case "sourceConnectionInfo": - err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) + case "error": + err = unpopulate(val, "Error", &m.Error) delete(rawMsg, key) - case "targetConnectionInfo": - err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "validationOptions": - err = unpopulate(val, "ValidationOptions", &m.ValidationOptions) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) } if err != nil { @@ -6385,16 +8780,23 @@ func (m *MigrateSQLServerSQLDbTaskInput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutput. -func (m MigrateSQLServerSQLDbTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputLoginLevel. +func (m MigrateSQLServerSQLMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) populate(objectMap, "id", m.ID) - objectMap["resultType"] = m.ResultType + populate(objectMap, "loginName", m.LoginName) + populate(objectMap, "message", m.Message) + objectMap["resultType"] = "LoginLevelOutput" + populate(objectMap, "stage", m.Stage) + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "state", m.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskOutput. -func (m *MigrateSQLServerSQLDbTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskOutputLoginLevel. +func (m *MigrateSQLServerSQLMITaskOutputLoginLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6402,12 +8804,33 @@ func (m *MigrateSQLServerSQLDbTaskOutput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) + delete(rawMsg, key) + case "exceptionsAndWarnings": + err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) + case "loginName": + err = unpopulate(val, "LoginName", &m.LoginName) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &m.Message) + delete(rawMsg, key) case "resultType": err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &m.Stage) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6416,30 +8839,31 @@ func (m *MigrateSQLServerSQLDbTaskOutput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutputDatabaseLevel. -func (m MigrateSQLServerSQLDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputMigrationLevel. +func (m MigrateSQLServerSQLMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseName", m.DatabaseName) + populate(objectMap, "agentJobs", m.AgentJobs) + populate(objectMap, "databases", m.Databases) populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "errorCount", m.ErrorCount) - populate(objectMap, "errorPrefix", m.ErrorPrefix) populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) populate(objectMap, "id", m.ID) + populate(objectMap, "logins", m.Logins) populate(objectMap, "message", m.Message) - populate(objectMap, "numberOfObjects", m.NumberOfObjects) - populate(objectMap, "numberOfObjectsCompleted", m.NumberOfObjectsCompleted) - populate(objectMap, "objectSummary", m.ObjectSummary) - populate(objectMap, "resultPrefix", m.ResultPrefix) - objectMap["resultType"] = "DatabaseLevelOutput" - populate(objectMap, "stage", m.Stage) + populate(objectMap, "orphanedUsersInfo", m.OrphanedUsersInfo) + objectMap["resultType"] = "MigrationLevelOutput" + populate(objectMap, "serverRoleResults", m.ServerRoleResults) + populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) + populate(objectMap, "sourceServerVersion", m.SourceServerVersion) populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) populate(objectMap, "state", m.State) - populate(objectMap, "statusMessage", m.StatusMessage) + populate(objectMap, "status", m.Status) + populate(objectMap, "targetServerBrandVersion", m.TargetServerBrandVersion) + populate(objectMap, "targetServerVersion", m.TargetServerVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskOutputDatabaseLevel. -func (m *MigrateSQLServerSQLDbTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskOutputMigrationLevel. +func (m *MigrateSQLServerSQLMITaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6447,44 +8871,41 @@ func (m *MigrateSQLServerSQLDbTaskOutputDatabaseLevel) UnmarshalJSON(data []byte for key, val := range rawMsg { var err error switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) + case "agentJobs": + err = unpopulate(val, "AgentJobs", &m.AgentJobs) + delete(rawMsg, key) + case "databases": + err = unpopulate(val, "Databases", &m.Databases) delete(rawMsg, key) case "endedOn": err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) - case "errorCount": - err = unpopulate(val, "ErrorCount", &m.ErrorCount) - delete(rawMsg, key) - case "errorPrefix": - err = unpopulate(val, "ErrorPrefix", &m.ErrorPrefix) - delete(rawMsg, key) case "exceptionsAndWarnings": err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) + case "logins": + err = unpopulate(val, "Logins", &m.Logins) + delete(rawMsg, key) case "message": err = unpopulate(val, "Message", &m.Message) delete(rawMsg, key) - case "numberOfObjects": - err = unpopulate(val, "NumberOfObjects", &m.NumberOfObjects) - delete(rawMsg, key) - case "numberOfObjectsCompleted": - err = unpopulate(val, "NumberOfObjectsCompleted", &m.NumberOfObjectsCompleted) - delete(rawMsg, key) - case "objectSummary": - err = unpopulate(val, "ObjectSummary", &m.ObjectSummary) - delete(rawMsg, key) - case "resultPrefix": - err = unpopulate(val, "ResultPrefix", &m.ResultPrefix) + case "orphanedUsersInfo": + err = unpopulate(val, "OrphanedUsersInfo", &m.OrphanedUsersInfo) delete(rawMsg, key) case "resultType": err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) - case "stage": - err = unpopulate(val, "Stage", &m.Stage) + case "serverRoleResults": + err = unpopulate(val, "ServerRoleResults", &m.ServerRoleResults) + delete(rawMsg, key) + case "sourceServerBrandVersion": + err = unpopulate(val, "SourceServerBrandVersion", &m.SourceServerBrandVersion) + delete(rawMsg, key) + case "sourceServerVersion": + err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) delete(rawMsg, key) case "startedOn": err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) @@ -6492,8 +8913,14 @@ func (m *MigrateSQLServerSQLDbTaskOutputDatabaseLevel) UnmarshalJSON(data []byte case "state": err = unpopulate(val, "State", &m.State) delete(rawMsg, key) - case "statusMessage": - err = unpopulate(val, "StatusMessage", &m.StatusMessage) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "targetServerBrandVersion": + err = unpopulate(val, "TargetServerBrandVersion", &m.TargetServerBrandVersion) + delete(rawMsg, key) + case "targetServerVersion": + err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) delete(rawMsg, key) } if err != nil { @@ -6503,25 +8930,25 @@ func (m *MigrateSQLServerSQLDbTaskOutputDatabaseLevel) UnmarshalJSON(data []byte return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutputDatabaseLevelValidationResult. -func (m MigrateSQLServerSQLDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskProperties. +func (m MigrateSQLServerSQLMITaskProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataIntegrityValidationResult", m.DataIntegrityValidationResult) - populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "id", m.ID) - populate(objectMap, "migrationId", m.MigrationID) - populate(objectMap, "queryAnalysisValidationResult", m.QueryAnalysisValidationResult) - objectMap["resultType"] = "MigrationDatabaseLevelValidationOutput" - populate(objectMap, "schemaValidationResult", m.SchemaValidationResult) - populate(objectMap, "sourceDatabaseName", m.SourceDatabaseName) - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "status", m.Status) - populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) + populate(objectMap, "clientData", m.ClientData) + populate(objectMap, "commands", m.Commands) + populate(objectMap, "createdOn", m.CreatedOn) + populate(objectMap, "errors", m.Errors) + populate(objectMap, "input", m.Input) + populate(objectMap, "isCloneable", m.IsCloneable) + populate(objectMap, "output", m.Output) + populate(objectMap, "parentTaskId", m.ParentTaskID) + populate(objectMap, "state", m.State) + populate(objectMap, "taskId", m.TaskID) + objectMap["taskType"] = TaskTypeMigrateSQLServerAzureSQLDbMI return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskOutputDatabaseLevelValidationResult. -func (m *MigrateSQLServerSQLDbTaskOutputDatabaseLevelValidationResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskProperties. +func (m *MigrateSQLServerSQLMITaskProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6529,38 +8956,38 @@ func (m *MigrateSQLServerSQLDbTaskOutputDatabaseLevelValidationResult) Unmarshal for key, val := range rawMsg { var err error switch key { - case "dataIntegrityValidationResult": - err = unpopulate(val, "DataIntegrityValidationResult", &m.DataIntegrityValidationResult) + case "clientData": + err = unpopulate(val, "ClientData", &m.ClientData) delete(rawMsg, key) - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) + case "commands": + m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) + case "createdOn": + err = unpopulate(val, "CreatedOn", &m.CreatedOn) delete(rawMsg, key) - case "migrationId": - err = unpopulate(val, "MigrationID", &m.MigrationID) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) delete(rawMsg, key) - case "queryAnalysisValidationResult": - err = unpopulate(val, "QueryAnalysisValidationResult", &m.QueryAnalysisValidationResult) + case "input": + err = unpopulate(val, "Input", &m.Input) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "isCloneable": + err = unpopulate(val, "IsCloneable", &m.IsCloneable) delete(rawMsg, key) - case "schemaValidationResult": - err = unpopulate(val, "SchemaValidationResult", &m.SchemaValidationResult) + case "output": + m.Output, err = unmarshalMigrateSQLServerSQLMITaskOutputClassificationArray(val) delete(rawMsg, key) - case "sourceDatabaseName": - err = unpopulate(val, "SourceDatabaseName", &m.SourceDatabaseName) + case "parentTaskId": + err = unpopulate(val, "ParentTaskID", &m.ParentTaskID) delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + case "state": + err = unpopulate(val, "State", &m.State) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "taskId": + err = unpopulate(val, "TaskID", &m.TaskID) delete(rawMsg, key) - case "targetDatabaseName": - err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) + case "taskType": + err = unpopulate(val, "TaskType", &m.TaskType) delete(rawMsg, key) } if err != nil { @@ -6570,17 +8997,18 @@ func (m *MigrateSQLServerSQLDbTaskOutputDatabaseLevelValidationResult) Unmarshal return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutputError. -func (m MigrateSQLServerSQLDbTaskOutputError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbDatabaseInput. +func (m MigrateSchemaSQLServerSQLDbDatabaseInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", m.Error) populate(objectMap, "id", m.ID) - objectMap["resultType"] = "ErrorOutput" + populate(objectMap, "name", m.Name) + populate(objectMap, "schemaSetting", m.SchemaSetting) + populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskOutputError. -func (m *MigrateSQLServerSQLDbTaskOutputError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLServerSQLDbDatabaseInput. +func (m *MigrateSchemaSQLServerSQLDbDatabaseInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6588,14 +9016,17 @@ func (m *MigrateSQLServerSQLDbTaskOutputError) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &m.Error) - delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "schemaSetting": + err = unpopulate(val, "SchemaSetting", &m.SchemaSetting) + delete(rawMsg, key) + case "targetDatabaseName": + err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) delete(rawMsg, key) } if err != nil { @@ -6605,31 +9036,59 @@ func (m *MigrateSQLServerSQLDbTaskOutputError) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutputMigrationLevel. -func (m MigrateSQLServerSQLDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbTaskInput. +func (m MigrateSchemaSQLServerSQLDbTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "encryptedKeyForSecureFields", m.EncryptedKeyForSecureFields) + populate(objectMap, "selectedDatabases", m.SelectedDatabases) + populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) + populate(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLServerSQLDbTaskInput. +func (m *MigrateSchemaSQLServerSQLDbTaskInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "encryptedKeyForSecureFields": + err = unpopulate(val, "EncryptedKeyForSecureFields", &m.EncryptedKeyForSecureFields) + delete(rawMsg, key) + case "selectedDatabases": + err = unpopulate(val, "SelectedDatabases", &m.SelectedDatabases) + delete(rawMsg, key) + case "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) + delete(rawMsg, key) + case "startedOn": + err = unpopulate(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutput. +func (m MigrateSchemaSQLServerSQLDbTaskOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseSummary", m.DatabaseSummary) - populate(objectMap, "databases", m.Databases) - populate(objectMap, "durationInSeconds", m.DurationInSeconds) - populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) populate(objectMap, "id", m.ID) - populate(objectMap, "message", m.Message) - populate(objectMap, "migrationReportResult", m.MigrationReportResult) - populate(objectMap, "migrationValidationResult", m.MigrationValidationResult) - objectMap["resultType"] = "MigrationLevelOutput" - populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) - populate(objectMap, "sourceServerVersion", m.SourceServerVersion) - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "status", m.Status) - populate(objectMap, "statusMessage", m.StatusMessage) - populate(objectMap, "targetServerBrandVersion", m.TargetServerBrandVersion) - populate(objectMap, "targetServerVersion", m.TargetServerVersion) + objectMap["resultType"] = m.ResultType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskOutputMigrationLevel. -func (m *MigrateSQLServerSQLDbTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutput. +func (m *MigrateSchemaSQLServerSQLDbTaskOutput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6637,57 +9096,12 @@ func (m *MigrateSQLServerSQLDbTaskOutputMigrationLevel) UnmarshalJSON(data []byt for key, val := range rawMsg { var err error switch key { - case "databaseSummary": - err = unpopulate(val, "DatabaseSummary", &m.DatabaseSummary) - delete(rawMsg, key) - case "databases": - err = unpopulate(val, "Databases", &m.Databases) - delete(rawMsg, key) - case "durationInSeconds": - err = unpopulate(val, "DurationInSeconds", &m.DurationInSeconds) - delete(rawMsg, key) - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) - delete(rawMsg, key) - case "exceptionsAndWarnings": - err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) - delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &m.Message) - delete(rawMsg, key) - case "migrationReportResult": - err = unpopulate(val, "MigrationReportResult", &m.MigrationReportResult) - delete(rawMsg, key) - case "migrationValidationResult": - err = unpopulate(val, "MigrationValidationResult", &m.MigrationValidationResult) - delete(rawMsg, key) case "resultType": err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) - case "sourceServerBrandVersion": - err = unpopulate(val, "SourceServerBrandVersion", &m.SourceServerBrandVersion) - delete(rawMsg, key) - case "sourceServerVersion": - err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) - delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) - case "statusMessage": - err = unpopulate(val, "StatusMessage", &m.StatusMessage) - delete(rawMsg, key) - case "targetServerBrandVersion": - err = unpopulate(val, "TargetServerBrandVersion", &m.TargetServerBrandVersion) - delete(rawMsg, key) - case "targetServerVersion": - err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6696,25 +9110,26 @@ func (m *MigrateSQLServerSQLDbTaskOutputMigrationLevel) UnmarshalJSON(data []byt return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutputTableLevel. -func (m MigrateSQLServerSQLDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutputDatabaseLevel. +func (m MigrateSchemaSQLServerSQLDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "databaseErrorResultPrefix", m.DatabaseErrorResultPrefix) + populate(objectMap, "databaseName", m.DatabaseName) populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "errorPrefix", m.ErrorPrefix) + populate(objectMap, "fileId", m.FileID) populate(objectMap, "id", m.ID) - populate(objectMap, "itemsCompletedCount", m.ItemsCompletedCount) - populate(objectMap, "itemsCount", m.ItemsCount) - populate(objectMap, "objectName", m.ObjectName) - populate(objectMap, "resultPrefix", m.ResultPrefix) - objectMap["resultType"] = "TableLevelOutput" + populate(objectMap, "numberOfFailedOperations", m.NumberOfFailedOperations) + populate(objectMap, "numberOfSuccessfulOperations", m.NumberOfSuccessfulOperations) + objectMap["resultType"] = "DatabaseLevelOutput" + populate(objectMap, "schemaErrorResultPrefix", m.SchemaErrorResultPrefix) + populate(objectMap, "stage", m.Stage) populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) populate(objectMap, "state", m.State) - populate(objectMap, "statusMessage", m.StatusMessage) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskOutputTableLevel. -func (m *MigrateSQLServerSQLDbTaskOutputTableLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutputDatabaseLevel. +func (m *MigrateSchemaSQLServerSQLDbTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6722,39 +9137,42 @@ func (m *MigrateSQLServerSQLDbTaskOutputTableLevel) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { + case "databaseErrorResultPrefix": + err = unpopulate(val, "DatabaseErrorResultPrefix", &m.DatabaseErrorResultPrefix) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) + delete(rawMsg, key) case "endedOn": err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) - case "errorPrefix": - err = unpopulate(val, "ErrorPrefix", &m.ErrorPrefix) + case "fileId": + err = unpopulate(val, "FileID", &m.FileID) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "itemsCompletedCount": - err = unpopulate(val, "ItemsCompletedCount", &m.ItemsCompletedCount) - delete(rawMsg, key) - case "itemsCount": - err = unpopulate(val, "ItemsCount", &m.ItemsCount) - delete(rawMsg, key) - case "objectName": - err = unpopulate(val, "ObjectName", &m.ObjectName) + case "numberOfFailedOperations": + err = unpopulate(val, "NumberOfFailedOperations", &m.NumberOfFailedOperations) delete(rawMsg, key) - case "resultPrefix": - err = unpopulate(val, "ResultPrefix", &m.ResultPrefix) + case "numberOfSuccessfulOperations": + err = unpopulate(val, "NumberOfSuccessfulOperations", &m.NumberOfSuccessfulOperations) delete(rawMsg, key) case "resultType": err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) + case "schemaErrorResultPrefix": + err = unpopulate(val, "SchemaErrorResultPrefix", &m.SchemaErrorResultPrefix) + delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &m.Stage) + delete(rawMsg, key) case "startedOn": err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &m.State) delete(rawMsg, key) - case "statusMessage": - err = unpopulate(val, "StatusMessage", &m.StatusMessage) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6763,19 +9181,18 @@ func (m *MigrateSQLServerSQLDbTaskOutputTableLevel) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutputValidationResult. -func (m MigrateSQLServerSQLDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutputError. +func (m MigrateSchemaSQLServerSQLDbTaskOutputError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "commandText", m.CommandText) + populate(objectMap, "errorText", m.ErrorText) populate(objectMap, "id", m.ID) - populate(objectMap, "migrationId", m.MigrationID) - objectMap["resultType"] = "MigrationValidationOutput" - populate(objectMap, "status", m.Status) - populate(objectMap, "summaryResults", m.SummaryResults) + objectMap["resultType"] = "SchemaErrorOutput" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskOutputValidationResult. -func (m *MigrateSQLServerSQLDbTaskOutputValidationResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutputError. +func (m *MigrateSchemaSQLServerSQLDbTaskOutputError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6783,21 +9200,18 @@ func (m *MigrateSQLServerSQLDbTaskOutputValidationResult) UnmarshalJSON(data []b for key, val := range rawMsg { var err error switch key { + case "commandText": + err = unpopulate(val, "CommandText", &m.CommandText) + delete(rawMsg, key) + case "errorText": + err = unpopulate(val, "ErrorText", &m.ErrorText) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "migrationId": - err = unpopulate(val, "MigrationID", &m.MigrationID) - delete(rawMsg, key) case "resultType": err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) - case "summaryResults": - err = unpopulate(val, "SummaryResults", &m.SummaryResults) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6806,21 +9220,23 @@ func (m *MigrateSQLServerSQLDbTaskOutputValidationResult) UnmarshalJSON(data []b return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskProperties. -func (m MigrateSQLServerSQLDbTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel. +func (m MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", m.ClientData) - populate(objectMap, "commands", m.Commands) - populate(objectMap, "errors", m.Errors) - populate(objectMap, "input", m.Input) - populate(objectMap, "output", m.Output) + populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "id", m.ID) + objectMap["resultType"] = "MigrationLevelOutput" + populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) + populate(objectMap, "sourceServerVersion", m.SourceServerVersion) + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) populate(objectMap, "state", m.State) - objectMap["taskType"] = "Migrate.SqlServer.SqlDb" + populate(objectMap, "targetServerBrandVersion", m.TargetServerBrandVersion) + populate(objectMap, "targetServerVersion", m.TargetServerVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLDbTaskProperties. -func (m *MigrateSQLServerSQLDbTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel. +func (m *MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6828,26 +9244,32 @@ func (m *MigrateSQLServerSQLDbTaskProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &m.ClientData) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) - case "commands": - m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &m.Errors) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &m.Input) + case "sourceServerBrandVersion": + err = unpopulate(val, "SourceServerBrandVersion", &m.SourceServerBrandVersion) delete(rawMsg, key) - case "output": - m.Output, err = unmarshalMigrateSQLServerSQLDbTaskOutputClassificationArray(val) + case "sourceServerVersion": + err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &m.State) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &m.TaskType) + case "targetServerBrandVersion": + err = unpopulate(val, "TargetServerBrandVersion", &m.TargetServerBrandVersion) + delete(rawMsg, key) + case "targetServerVersion": + err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) delete(rawMsg, key) } if err != nil { @@ -6857,18 +9279,24 @@ func (m *MigrateSQLServerSQLDbTaskProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMIDatabaseInput. -func (m MigrateSQLServerSQLMIDatabaseInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbTaskProperties. +func (m MigrateSchemaSQLServerSQLDbTaskProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "backupFilePaths", m.BackupFilePaths) - populate(objectMap, "backupFileShare", m.BackupFileShare) - populate(objectMap, "name", m.Name) - populate(objectMap, "restoreDatabaseName", m.RestoreDatabaseName) + populate(objectMap, "clientData", m.ClientData) + populate(objectMap, "commands", m.Commands) + populate(objectMap, "createdOn", m.CreatedOn) + populate(objectMap, "errors", m.Errors) + populate(objectMap, "input", m.Input) + populate(objectMap, "isCloneable", m.IsCloneable) + populate(objectMap, "output", m.Output) + populate(objectMap, "state", m.State) + populate(objectMap, "taskId", m.TaskID) + objectMap["taskType"] = TaskTypeMigrateSchemaSQLServerSQLDb return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMIDatabaseInput. -func (m *MigrateSQLServerSQLMIDatabaseInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLServerSQLDbTaskProperties. +func (m *MigrateSchemaSQLServerSQLDbTaskProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6876,64 +9304,35 @@ func (m *MigrateSQLServerSQLMIDatabaseInput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "backupFilePaths": - err = unpopulate(val, "BackupFilePaths", &m.BackupFilePaths) + case "clientData": + err = unpopulate(val, "ClientData", &m.ClientData) delete(rawMsg, key) - case "backupFileShare": - err = unpopulate(val, "BackupFileShare", &m.BackupFileShare) + case "commands": + m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "createdOn": + err = unpopulate(val, "CreatedOn", &m.CreatedOn) delete(rawMsg, key) - case "restoreDatabaseName": - err = unpopulate(val, "RestoreDatabaseName", &m.RestoreDatabaseName) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskInput. -func (m MigrateSQLServerSQLMISyncTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "azureApp", m.AzureApp) - populate(objectMap, "backupFileShare", m.BackupFileShare) - populate(objectMap, "selectedDatabases", m.SelectedDatabases) - populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) - populate(objectMap, "storageResourceId", m.StorageResourceID) - populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMISyncTaskInput. -func (m *MigrateSQLServerSQLMISyncTaskInput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "azureApp": - err = unpopulate(val, "AzureApp", &m.AzureApp) + case "input": + err = unpopulate(val, "Input", &m.Input) delete(rawMsg, key) - case "backupFileShare": - err = unpopulate(val, "BackupFileShare", &m.BackupFileShare) + case "isCloneable": + err = unpopulate(val, "IsCloneable", &m.IsCloneable) delete(rawMsg, key) - case "selectedDatabases": - err = unpopulate(val, "SelectedDatabases", &m.SelectedDatabases) + case "output": + m.Output, err = unmarshalMigrateSchemaSQLServerSQLDbTaskOutputClassificationArray(val) delete(rawMsg, key) - case "sourceConnectionInfo": - err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) + case "state": + err = unpopulate(val, "State", &m.State) delete(rawMsg, key) - case "storageResourceId": - err = unpopulate(val, "StorageResourceID", &m.StorageResourceID) + case "taskId": + err = unpopulate(val, "TaskID", &m.TaskID) delete(rawMsg, key) - case "targetConnectionInfo": - err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) + case "taskType": + err = unpopulate(val, "TaskType", &m.TaskType) delete(rawMsg, key) } if err != nil { @@ -6943,16 +9342,17 @@ func (m *MigrateSQLServerSQLMISyncTaskInput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskOutput. -func (m MigrateSQLServerSQLMISyncTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLTaskOutputError. +func (m MigrateSchemaSQLTaskOutputError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "error", m.Error) populate(objectMap, "id", m.ID) - objectMap["resultType"] = m.ResultType + objectMap["resultType"] = "ErrorOutput" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMISyncTaskOutput. -func (m *MigrateSQLServerSQLMISyncTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLTaskOutputError. +func (m *MigrateSchemaSQLTaskOutputError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6960,6 +9360,9 @@ func (m *MigrateSQLServerSQLMISyncTaskOutput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "error": + err = unpopulate(val, "Error", &m.Error) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) @@ -6974,27 +9377,17 @@ func (m *MigrateSQLServerSQLMISyncTaskOutput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskOutputDatabaseLevel. -func (m MigrateSQLServerSQLMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSsisTaskInput. +func (m MigrateSsisTaskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "activeBackupSets", m.ActiveBackupSets) - populate(objectMap, "containerName", m.ContainerName) - populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "errorPrefix", m.ErrorPrefix) - populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) - populate(objectMap, "fullBackupSetInfo", m.FullBackupSetInfo) - populate(objectMap, "id", m.ID) - populate(objectMap, "isFullBackupRestored", m.IsFullBackupRestored) - populate(objectMap, "lastRestoredBackupSetInfo", m.LastRestoredBackupSetInfo) - populate(objectMap, "migrationState", m.MigrationState) - objectMap["resultType"] = "DatabaseLevelOutput" - populate(objectMap, "sourceDatabaseName", m.SourceDatabaseName) - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) + populate(objectMap, "ssisMigrationInfo", m.SsisMigrationInfo) + populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMISyncTaskOutputDatabaseLevel. -func (m *MigrateSQLServerSQLMISyncTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSsisTaskInput. +func (m *MigrateSsisTaskInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7002,44 +9395,14 @@ func (m *MigrateSQLServerSQLMISyncTaskOutputDatabaseLevel) UnmarshalJSON(data [] for key, val := range rawMsg { var err error switch key { - case "activeBackupSets": - err = unpopulate(val, "ActiveBackupSets", &m.ActiveBackupSets) - delete(rawMsg, key) - case "containerName": - err = unpopulate(val, "ContainerName", &m.ContainerName) - delete(rawMsg, key) - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) - delete(rawMsg, key) - case "errorPrefix": - err = unpopulate(val, "ErrorPrefix", &m.ErrorPrefix) - delete(rawMsg, key) - case "exceptionsAndWarnings": - err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) - delete(rawMsg, key) - case "fullBackupSetInfo": - err = unpopulate(val, "FullBackupSetInfo", &m.FullBackupSetInfo) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "isFullBackupRestored": - err = unpopulate(val, "IsFullBackupRestored", &m.IsFullBackupRestored) - delete(rawMsg, key) - case "lastRestoredBackupSetInfo": - err = unpopulate(val, "LastRestoredBackupSetInfo", &m.LastRestoredBackupSetInfo) - delete(rawMsg, key) - case "migrationState": - err = unpopulate(val, "MigrationState", &m.MigrationState) - delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) delete(rawMsg, key) - case "sourceDatabaseName": - err = unpopulate(val, "SourceDatabaseName", &m.SourceDatabaseName) + case "ssisMigrationInfo": + err = unpopulate(val, "SsisMigrationInfo", &m.SsisMigrationInfo) delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) delete(rawMsg, key) } if err != nil { @@ -7049,17 +9412,16 @@ func (m *MigrateSQLServerSQLMISyncTaskOutputDatabaseLevel) UnmarshalJSON(data [] return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskOutputError. -func (m MigrateSQLServerSQLMISyncTaskOutputError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSsisTaskOutput. +func (m MigrateSsisTaskOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", m.Error) populate(objectMap, "id", m.ID) - objectMap["resultType"] = "ErrorOutput" + objectMap["resultType"] = m.ResultType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMISyncTaskOutputError. -func (m *MigrateSQLServerSQLMISyncTaskOutputError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSsisTaskOutput. +func (m *MigrateSsisTaskOutput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7067,9 +9429,6 @@ func (m *MigrateSQLServerSQLMISyncTaskOutputError) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &m.Error) - delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) @@ -7084,27 +9443,26 @@ func (m *MigrateSQLServerSQLMISyncTaskOutputError) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskOutputMigrationLevel. -func (m MigrateSQLServerSQLMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSsisTaskOutputMigrationLevel. +func (m MigrateSsisTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseCount", m.DatabaseCount) - populate(objectMap, "databaseErrorCount", m.DatabaseErrorCount) populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) populate(objectMap, "id", m.ID) + populate(objectMap, "message", m.Message) objectMap["resultType"] = "MigrationLevelOutput" populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) - populate(objectMap, "sourceServerName", m.SourceServerName) populate(objectMap, "sourceServerVersion", m.SourceServerVersion) + populate(objectMap, "stage", m.Stage) populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "state", m.State) + populate(objectMap, "status", m.Status) populate(objectMap, "targetServerBrandVersion", m.TargetServerBrandVersion) - populate(objectMap, "targetServerName", m.TargetServerName) populate(objectMap, "targetServerVersion", m.TargetServerVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMISyncTaskOutputMigrationLevel. -func (m *MigrateSQLServerSQLMISyncTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSsisTaskOutputMigrationLevel. +func (m *MigrateSsisTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7112,42 +9470,39 @@ func (m *MigrateSQLServerSQLMISyncTaskOutputMigrationLevel) UnmarshalJSON(data [ for key, val := range rawMsg { var err error switch key { - case "databaseCount": - err = unpopulate(val, "DatabaseCount", &m.DatabaseCount) - delete(rawMsg, key) - case "databaseErrorCount": - err = unpopulate(val, "DatabaseErrorCount", &m.DatabaseErrorCount) - delete(rawMsg, key) case "endedOn": err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) + case "exceptionsAndWarnings": + err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &m.Message) + delete(rawMsg, key) case "resultType": err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) case "sourceServerBrandVersion": err = unpopulate(val, "SourceServerBrandVersion", &m.SourceServerBrandVersion) delete(rawMsg, key) - case "sourceServerName": - err = unpopulate(val, "SourceServerName", &m.SourceServerName) - delete(rawMsg, key) case "sourceServerVersion": err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &m.Stage) + delete(rawMsg, key) case "startedOn": err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "status": + err = unpopulate(val, "Status", &m.Status) delete(rawMsg, key) case "targetServerBrandVersion": err = unpopulate(val, "TargetServerBrandVersion", &m.TargetServerBrandVersion) delete(rawMsg, key) - case "targetServerName": - err = unpopulate(val, "TargetServerName", &m.TargetServerName) - delete(rawMsg, key) case "targetServerVersion": err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) delete(rawMsg, key) @@ -7159,21 +9514,24 @@ func (m *MigrateSQLServerSQLMISyncTaskOutputMigrationLevel) UnmarshalJSON(data [ return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskProperties. -func (m MigrateSQLServerSQLMISyncTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSsisTaskOutputProjectLevel. +func (m MigrateSsisTaskOutputProjectLevel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", m.ClientData) - populate(objectMap, "commands", m.Commands) - populate(objectMap, "errors", m.Errors) - populate(objectMap, "input", m.Input) - populate(objectMap, "output", m.Output) + populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) + populate(objectMap, "folderName", m.FolderName) + populate(objectMap, "id", m.ID) + populate(objectMap, "message", m.Message) + populate(objectMap, "projectName", m.ProjectName) + objectMap["resultType"] = "SsisProjectLevelOutput" + populate(objectMap, "stage", m.Stage) + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) populate(objectMap, "state", m.State) - objectMap["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMISyncTaskProperties. -func (m *MigrateSQLServerSQLMISyncTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSsisTaskOutputProjectLevel. +func (m *MigrateSsisTaskOutputProjectLevel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7181,27 +9539,36 @@ func (m *MigrateSQLServerSQLMISyncTaskProperties) UnmarshalJSON(data []byte) err for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &m.ClientData) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) - case "commands": - m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + case "exceptionsAndWarnings": + err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &m.Errors) + case "folderName": + err = unpopulate(val, "FolderName", &m.FolderName) delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &m.Input) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "output": - m.Output, err = unmarshalMigrateSQLServerSQLMISyncTaskOutputClassificationArray(val) + case "message": + err = unpopulate(val, "Message", &m.Message) + delete(rawMsg, key) + case "projectName": + err = unpopulate(val, "ProjectName", &m.ProjectName) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &m.Stage) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &m.State) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &m.TaskType) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7210,23 +9577,21 @@ func (m *MigrateSQLServerSQLMISyncTaskProperties) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskInput. -func (m MigrateSQLServerSQLMITaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSsisTaskProperties. +func (m MigrateSsisTaskProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "aadDomainName", m.AADDomainName) - populate(objectMap, "backupBlobShare", m.BackupBlobShare) - populate(objectMap, "backupFileShare", m.BackupFileShare) - populate(objectMap, "backupMode", m.BackupMode) - populate(objectMap, "selectedAgentJobs", m.SelectedAgentJobs) - populate(objectMap, "selectedDatabases", m.SelectedDatabases) - populate(objectMap, "selectedLogins", m.SelectedLogins) - populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) - populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) + populate(objectMap, "clientData", m.ClientData) + populate(objectMap, "commands", m.Commands) + populate(objectMap, "errors", m.Errors) + populate(objectMap, "input", m.Input) + populate(objectMap, "output", m.Output) + populate(objectMap, "state", m.State) + objectMap["taskType"] = TaskTypeMigrateSsis return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskInput. -func (m *MigrateSQLServerSQLMITaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSsisTaskProperties. +func (m *MigrateSsisTaskProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7234,32 +9599,26 @@ func (m *MigrateSQLServerSQLMITaskInput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "aadDomainName": - err = unpopulate(val, "AADDomainName", &m.AADDomainName) - delete(rawMsg, key) - case "backupBlobShare": - err = unpopulate(val, "BackupBlobShare", &m.BackupBlobShare) - delete(rawMsg, key) - case "backupFileShare": - err = unpopulate(val, "BackupFileShare", &m.BackupFileShare) - delete(rawMsg, key) - case "backupMode": - err = unpopulate(val, "BackupMode", &m.BackupMode) + case "clientData": + err = unpopulate(val, "ClientData", &m.ClientData) delete(rawMsg, key) - case "selectedAgentJobs": - err = unpopulate(val, "SelectedAgentJobs", &m.SelectedAgentJobs) + case "commands": + m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) delete(rawMsg, key) - case "selectedDatabases": - err = unpopulate(val, "SelectedDatabases", &m.SelectedDatabases) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) delete(rawMsg, key) - case "selectedLogins": - err = unpopulate(val, "SelectedLogins", &m.SelectedLogins) + case "input": + err = unpopulate(val, "Input", &m.Input) delete(rawMsg, key) - case "sourceConnectionInfo": - err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) + case "output": + m.Output, err = unmarshalMigrateSsisTaskOutputClassificationArray(val) delete(rawMsg, key) - case "targetConnectionInfo": - err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &m.TaskType) delete(rawMsg, key) } if err != nil { @@ -7269,16 +9628,16 @@ func (m *MigrateSQLServerSQLMITaskInput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutput. -func (m MigrateSQLServerSQLMITaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSyncCompleteCommandInput. +func (m MigrateSyncCompleteCommandInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - objectMap["resultType"] = m.ResultType + populateDateTimeRFC3339(objectMap, "commitTimeStamp", m.CommitTimeStamp) + populate(objectMap, "databaseName", m.DatabaseName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskOutput. -func (m *MigrateSQLServerSQLMITaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSyncCompleteCommandInput. +func (m *MigrateSyncCompleteCommandInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7286,11 +9645,11 @@ func (m *MigrateSQLServerSQLMITaskOutput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) + case "commitTimeStamp": + err = unpopulateDateTimeRFC3339(val, "CommitTimeStamp", &m.CommitTimeStamp) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) delete(rawMsg, key) } if err != nil { @@ -7300,23 +9659,16 @@ func (m *MigrateSQLServerSQLMITaskOutput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputAgentJobLevel. -func (m MigrateSQLServerSQLMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSyncCompleteCommandOutput. +func (m MigrateSyncCompleteCommandOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) + populate(objectMap, "errors", m.Errors) populate(objectMap, "id", m.ID) - populate(objectMap, "isEnabled", m.IsEnabled) - populate(objectMap, "message", m.Message) - populate(objectMap, "name", m.Name) - objectMap["resultType"] = "AgentJobLevelOutput" - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "state", m.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskOutputAgentJobLevel. -func (m *MigrateSQLServerSQLMITaskOutputAgentJobLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSyncCompleteCommandOutput. +func (m *MigrateSyncCompleteCommandOutput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7324,33 +9676,12 @@ func (m *MigrateSQLServerSQLMITaskOutputAgentJobLevel) UnmarshalJSON(data []byte for key, val := range rawMsg { var err error switch key { - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) - delete(rawMsg, key) - case "exceptionsAndWarnings": - err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &m.IsEnabled) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &m.Message) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) - delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7359,24 +9690,20 @@ func (m *MigrateSQLServerSQLMITaskOutputAgentJobLevel) UnmarshalJSON(data []byte return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputDatabaseLevel. -func (m MigrateSQLServerSQLMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrateSyncCompleteCommandProperties. +func (m MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseName", m.DatabaseName) - populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) - populate(objectMap, "id", m.ID) - populate(objectMap, "message", m.Message) - objectMap["resultType"] = "DatabaseLevelOutput" - populate(objectMap, "sizeMB", m.SizeMB) - populate(objectMap, "stage", m.Stage) - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "commandId", m.CommandID) + objectMap["commandType"] = CommandTypeMigrateSyncCompleteDatabase + populate(objectMap, "errors", m.Errors) + populate(objectMap, "input", m.Input) + populate(objectMap, "output", m.Output) populate(objectMap, "state", m.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskOutputDatabaseLevel. -func (m *MigrateSQLServerSQLMITaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSyncCompleteCommandProperties. +func (m *MigrateSyncCompleteCommandProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7384,32 +9711,20 @@ func (m *MigrateSQLServerSQLMITaskOutputDatabaseLevel) UnmarshalJSON(data []byte for key, val := range rawMsg { var err error switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) - delete(rawMsg, key) - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) - delete(rawMsg, key) - case "exceptionsAndWarnings": - err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) + case "commandId": + err = unpopulate(val, "CommandID", &m.CommandID) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &m.Message) - delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "commandType": + err = unpopulate(val, "CommandType", &m.CommandType) delete(rawMsg, key) - case "sizeMB": - err = unpopulate(val, "SizeMB", &m.SizeMB) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) delete(rawMsg, key) - case "stage": - err = unpopulate(val, "Stage", &m.Stage) + case "input": + err = unpopulate(val, "Input", &m.Input) delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + case "output": + err = unpopulate(val, "Output", &m.Output) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &m.State) @@ -7422,17 +9737,16 @@ func (m *MigrateSQLServerSQLMITaskOutputDatabaseLevel) UnmarshalJSON(data []byte return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputError. -func (m MigrateSQLServerSQLMITaskOutputError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationEligibilityInfo. +func (m MigrationEligibilityInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", m.Error) - populate(objectMap, "id", m.ID) - objectMap["resultType"] = "ErrorOutput" + populate(objectMap, "isEligibleForMigration", m.IsEligibleForMigration) + populate(objectMap, "validationMessages", m.ValidationMessages) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskOutputError. -func (m *MigrateSQLServerSQLMITaskOutputError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationEligibilityInfo. +func (m *MigrationEligibilityInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7440,14 +9754,11 @@ func (m *MigrateSQLServerSQLMITaskOutputError) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &m.Error) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) + case "isEligibleForMigration": + err = unpopulate(val, "IsEligibleForMigration", &m.IsEligibleForMigration) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "validationMessages": + err = unpopulate(val, "ValidationMessages", &m.ValidationMessages) delete(rawMsg, key) } if err != nil { @@ -7457,23 +9768,15 @@ func (m *MigrateSQLServerSQLMITaskOutputError) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputLoginLevel. -func (m MigrateSQLServerSQLMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationOperationInput. +func (m MigrationOperationInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) - populate(objectMap, "id", m.ID) - populate(objectMap, "loginName", m.LoginName) - populate(objectMap, "message", m.Message) - objectMap["resultType"] = "LoginLevelOutput" - populate(objectMap, "stage", m.Stage) - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "state", m.State) + populate(objectMap, "migrationOperationId", m.MigrationOperationID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskOutputLoginLevel. -func (m *MigrateSQLServerSQLMITaskOutputLoginLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationOperationInput. +func (m *MigrationOperationInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7481,32 +9784,8 @@ func (m *MigrateSQLServerSQLMITaskOutputLoginLevel) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) - delete(rawMsg, key) - case "exceptionsAndWarnings": - err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "loginName": - err = unpopulate(val, "LoginName", &m.LoginName) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &m.Message) - delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) - delete(rawMsg, key) - case "stage": - err = unpopulate(val, "Stage", &m.Stage) - delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "migrationOperationId": + err = unpopulate(val, "MigrationOperationID", &m.MigrationOperationID) delete(rawMsg, key) } if err != nil { @@ -7516,88 +9795,28 @@ func (m *MigrateSQLServerSQLMITaskOutputLoginLevel) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputMigrationLevel. -func (m MigrateSQLServerSQLMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationReportResult. +func (m MigrationReportResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "agentJobs", m.AgentJobs) - populate(objectMap, "databases", m.Databases) - populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) populate(objectMap, "id", m.ID) - populate(objectMap, "logins", m.Logins) - populate(objectMap, "message", m.Message) - populate(objectMap, "orphanedUsersInfo", m.OrphanedUsersInfo) - objectMap["resultType"] = "MigrationLevelOutput" - populate(objectMap, "serverRoleResults", m.ServerRoleResults) - populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) - populate(objectMap, "sourceServerVersion", m.SourceServerVersion) - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "state", m.State) - populate(objectMap, "status", m.Status) - populate(objectMap, "targetServerBrandVersion", m.TargetServerBrandVersion) - populate(objectMap, "targetServerVersion", m.TargetServerVersion) + populate(objectMap, "reportUrl", m.ReportURL) return json.Marshal(objectMap) } - -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskOutputMigrationLevel. -func (m *MigrateSQLServerSQLMITaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "agentJobs": - err = unpopulate(val, "AgentJobs", &m.AgentJobs) - delete(rawMsg, key) - case "databases": - err = unpopulate(val, "Databases", &m.Databases) - delete(rawMsg, key) - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) - delete(rawMsg, key) - case "exceptionsAndWarnings": - err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "logins": - err = unpopulate(val, "Logins", &m.Logins) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &m.Message) - delete(rawMsg, key) - case "orphanedUsersInfo": - err = unpopulate(val, "OrphanedUsersInfo", &m.OrphanedUsersInfo) - delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) - delete(rawMsg, key) - case "serverRoleResults": - err = unpopulate(val, "ServerRoleResults", &m.ServerRoleResults) - delete(rawMsg, key) - case "sourceServerBrandVersion": - err = unpopulate(val, "SourceServerBrandVersion", &m.SourceServerBrandVersion) - delete(rawMsg, key) - case "sourceServerVersion": - err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) - delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) - case "targetServerBrandVersion": - err = unpopulate(val, "TargetServerBrandVersion", &m.TargetServerBrandVersion) + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationReportResult. +func (m *MigrationReportResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "targetServerVersion": - err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) + case "reportUrl": + err = unpopulate(val, "ReportURL", &m.ReportURL) delete(rawMsg, key) } if err != nil { @@ -7607,21 +9826,21 @@ func (m *MigrateSQLServerSQLMITaskOutputMigrationLevel) UnmarshalJSON(data []byt return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskProperties. -func (m MigrateSQLServerSQLMITaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationService. +func (m MigrationService) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", m.ClientData) - populate(objectMap, "commands", m.Commands) - populate(objectMap, "errors", m.Errors) - populate(objectMap, "input", m.Input) - populate(objectMap, "output", m.Output) - populate(objectMap, "state", m.State) - objectMap["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSQLServerSQLMITaskProperties. -func (m *MigrateSQLServerSQLMITaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationService. +func (m *MigrationService) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7629,26 +9848,26 @@ func (m *MigrateSQLServerSQLMITaskProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &m.ClientData) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "commands": - m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + case "location": + err = unpopulate(val, "Location", &m.Location) delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &m.Errors) + case "name": + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &m.Input) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) - case "output": - m.Output, err = unmarshalMigrateSQLServerSQLMITaskOutputClassificationArray(val) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &m.TaskType) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { @@ -7658,17 +9877,16 @@ func (m *MigrateSQLServerSQLMITaskProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbDatabaseInput. -func (m MigrateSchemaSQLServerSQLDbDatabaseInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationServiceListResult. +func (m MigrationServiceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", m.Name) - populate(objectMap, "schemaSetting", m.SchemaSetting) - populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLServerSQLDbDatabaseInput. -func (m *MigrateSchemaSQLServerSQLDbDatabaseInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationServiceListResult. +func (m *MigrationServiceListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7676,14 +9894,11 @@ func (m *MigrateSchemaSQLServerSQLDbDatabaseInput) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "schemaSetting": - err = unpopulate(val, "SchemaSetting", &m.SchemaSetting) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "targetDatabaseName": - err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { @@ -7693,17 +9908,16 @@ func (m *MigrateSchemaSQLServerSQLDbDatabaseInput) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbTaskInput. -func (m MigrateSchemaSQLServerSQLDbTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationServiceProperties. +func (m MigrationServiceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "selectedDatabases", m.SelectedDatabases) - populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) - populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) + populate(objectMap, "integrationRuntimeState", m.IntegrationRuntimeState) + populate(objectMap, "provisioningState", m.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLServerSQLDbTaskInput. -func (m *MigrateSchemaSQLServerSQLDbTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationServiceProperties. +func (m *MigrationServiceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7711,14 +9925,11 @@ func (m *MigrateSchemaSQLServerSQLDbTaskInput) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "selectedDatabases": - err = unpopulate(val, "SelectedDatabases", &m.SelectedDatabases) - delete(rawMsg, key) - case "sourceConnectionInfo": - err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) + case "integrationRuntimeState": + err = unpopulate(val, "IntegrationRuntimeState", &m.IntegrationRuntimeState) delete(rawMsg, key) - case "targetConnectionInfo": - err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) delete(rawMsg, key) } if err != nil { @@ -7728,16 +9939,15 @@ func (m *MigrateSchemaSQLServerSQLDbTaskInput) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutput. -func (m MigrateSchemaSQLServerSQLDbTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationServiceUpdate. +func (m MigrationServiceUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - objectMap["resultType"] = m.ResultType + populate(objectMap, "tags", m.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutput. -func (m *MigrateSchemaSQLServerSQLDbTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationServiceUpdate. +func (m *MigrationServiceUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7745,11 +9955,8 @@ func (m *MigrateSchemaSQLServerSQLDbTaskOutput) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) delete(rawMsg, key) } if err != nil { @@ -7759,26 +9966,27 @@ func (m *MigrateSchemaSQLServerSQLDbTaskOutput) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutputDatabaseLevel. -func (m MigrateSchemaSQLServerSQLDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationStatusDetails. +func (m MigrationStatusDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseErrorResultPrefix", m.DatabaseErrorResultPrefix) - populate(objectMap, "databaseName", m.DatabaseName) - populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "fileId", m.FileID) - populate(objectMap, "id", m.ID) - populate(objectMap, "numberOfFailedOperations", m.NumberOfFailedOperations) - populate(objectMap, "numberOfSuccessfulOperations", m.NumberOfSuccessfulOperations) - objectMap["resultType"] = "DatabaseLevelOutput" - populate(objectMap, "schemaErrorResultPrefix", m.SchemaErrorResultPrefix) - populate(objectMap, "stage", m.Stage) - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "state", m.State) + populate(objectMap, "activeBackupSets", m.ActiveBackupSets) + populate(objectMap, "blobContainerName", m.BlobContainerName) + populate(objectMap, "completeRestoreErrorMessage", m.CompleteRestoreErrorMessage) + populate(objectMap, "currentRestoringFilename", m.CurrentRestoringFilename) + populate(objectMap, "fileUploadBlockingErrors", m.FileUploadBlockingErrors) + populate(objectMap, "fullBackupSetInfo", m.FullBackupSetInfo) + populate(objectMap, "invalidFiles", m.InvalidFiles) + populate(objectMap, "isFullBackupRestored", m.IsFullBackupRestored) + populate(objectMap, "lastRestoredBackupSetInfo", m.LastRestoredBackupSetInfo) + populate(objectMap, "lastRestoredFilename", m.LastRestoredFilename) + populate(objectMap, "migrationState", m.MigrationState) + populate(objectMap, "pendingLogBackupsCount", m.PendingLogBackupsCount) + populate(objectMap, "restoreBlockingReason", m.RestoreBlockingReason) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutputDatabaseLevel. -func (m *MigrateSchemaSQLServerSQLDbTaskOutputDatabaseLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationStatusDetails. +func (m *MigrationStatusDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7786,41 +9994,44 @@ func (m *MigrateSchemaSQLServerSQLDbTaskOutputDatabaseLevel) UnmarshalJSON(data for key, val := range rawMsg { var err error switch key { - case "databaseErrorResultPrefix": - err = unpopulate(val, "DatabaseErrorResultPrefix", &m.DatabaseErrorResultPrefix) + case "activeBackupSets": + err = unpopulate(val, "ActiveBackupSets", &m.ActiveBackupSets) delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) + case "blobContainerName": + err = unpopulate(val, "BlobContainerName", &m.BlobContainerName) delete(rawMsg, key) - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) + case "completeRestoreErrorMessage": + err = unpopulate(val, "CompleteRestoreErrorMessage", &m.CompleteRestoreErrorMessage) delete(rawMsg, key) - case "fileId": - err = unpopulate(val, "FileID", &m.FileID) + case "currentRestoringFilename": + err = unpopulate(val, "CurrentRestoringFilename", &m.CurrentRestoringFilename) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) + case "fileUploadBlockingErrors": + err = unpopulate(val, "FileUploadBlockingErrors", &m.FileUploadBlockingErrors) delete(rawMsg, key) - case "numberOfFailedOperations": - err = unpopulate(val, "NumberOfFailedOperations", &m.NumberOfFailedOperations) + case "fullBackupSetInfo": + err = unpopulate(val, "FullBackupSetInfo", &m.FullBackupSetInfo) delete(rawMsg, key) - case "numberOfSuccessfulOperations": - err = unpopulate(val, "NumberOfSuccessfulOperations", &m.NumberOfSuccessfulOperations) + case "invalidFiles": + err = unpopulate(val, "InvalidFiles", &m.InvalidFiles) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "isFullBackupRestored": + err = unpopulate(val, "IsFullBackupRestored", &m.IsFullBackupRestored) delete(rawMsg, key) - case "schemaErrorResultPrefix": - err = unpopulate(val, "SchemaErrorResultPrefix", &m.SchemaErrorResultPrefix) + case "lastRestoredBackupSetInfo": + err = unpopulate(val, "LastRestoredBackupSetInfo", &m.LastRestoredBackupSetInfo) delete(rawMsg, key) - case "stage": - err = unpopulate(val, "Stage", &m.Stage) + case "lastRestoredFilename": + err = unpopulate(val, "LastRestoredFilename", &m.LastRestoredFilename) delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + case "migrationState": + err = unpopulate(val, "MigrationState", &m.MigrationState) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "pendingLogBackupsCount": + err = unpopulate(val, "PendingLogBackupsCount", &m.PendingLogBackupsCount) + delete(rawMsg, key) + case "restoreBlockingReason": + err = unpopulate(val, "RestoreBlockingReason", &m.RestoreBlockingReason) delete(rawMsg, key) } if err != nil { @@ -7830,18 +10041,55 @@ func (m *MigrateSchemaSQLServerSQLDbTaskOutputDatabaseLevel) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutputError. -func (m MigrateSchemaSQLServerSQLDbTaskOutputError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationTableMetadata. +func (m MigrationTableMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "commandText", m.CommandText) - populate(objectMap, "errorText", m.ErrorText) + populate(objectMap, "sourceTableName", m.SourceTableName) + populate(objectMap, "targetTableName", m.TargetTableName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationTableMetadata. +func (m *MigrationTableMetadata) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sourceTableName": + err = unpopulate(val, "SourceTableName", &m.SourceTableName) + delete(rawMsg, key) + case "targetTableName": + err = unpopulate(val, "TargetTableName", &m.TargetTableName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationValidationDatabaseLevelResult. +func (m MigrationValidationDatabaseLevelResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataIntegrityValidationResult", m.DataIntegrityValidationResult) + populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) populate(objectMap, "id", m.ID) - objectMap["resultType"] = "SchemaErrorOutput" + populate(objectMap, "migrationId", m.MigrationID) + populate(objectMap, "queryAnalysisValidationResult", m.QueryAnalysisValidationResult) + populate(objectMap, "schemaValidationResult", m.SchemaValidationResult) + populate(objectMap, "sourceDatabaseName", m.SourceDatabaseName) + populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "status", m.Status) + populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutputError. -func (m *MigrateSchemaSQLServerSQLDbTaskOutputError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationValidationDatabaseLevelResult. +func (m *MigrationValidationDatabaseLevelResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7849,17 +10097,35 @@ func (m *MigrateSchemaSQLServerSQLDbTaskOutputError) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "commandText": - err = unpopulate(val, "CommandText", &m.CommandText) + case "dataIntegrityValidationResult": + err = unpopulate(val, "DataIntegrityValidationResult", &m.DataIntegrityValidationResult) delete(rawMsg, key) - case "errorText": - err = unpopulate(val, "ErrorText", &m.ErrorText) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "migrationId": + err = unpopulate(val, "MigrationID", &m.MigrationID) + delete(rawMsg, key) + case "queryAnalysisValidationResult": + err = unpopulate(val, "QueryAnalysisValidationResult", &m.QueryAnalysisValidationResult) + delete(rawMsg, key) + case "schemaValidationResult": + err = unpopulate(val, "SchemaValidationResult", &m.SchemaValidationResult) + delete(rawMsg, key) + case "sourceDatabaseName": + err = unpopulate(val, "SourceDatabaseName", &m.SourceDatabaseName) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "targetDatabaseName": + err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) delete(rawMsg, key) } if err != nil { @@ -7869,23 +10135,21 @@ func (m *MigrateSchemaSQLServerSQLDbTaskOutputError) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel. -func (m MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationValidationDatabaseSummaryResult. +func (m MigrationValidationDatabaseSummaryResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) populate(objectMap, "id", m.ID) - objectMap["resultType"] = "MigrationLevelOutput" - populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) - populate(objectMap, "sourceServerVersion", m.SourceServerVersion) + populate(objectMap, "migrationId", m.MigrationID) + populate(objectMap, "sourceDatabaseName", m.SourceDatabaseName) populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "state", m.State) - populate(objectMap, "targetServerBrandVersion", m.TargetServerBrandVersion) - populate(objectMap, "targetServerVersion", m.TargetServerVersion) + populate(objectMap, "status", m.Status) + populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel. -func (m *MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationValidationDatabaseSummaryResult. +func (m *MigrationValidationDatabaseSummaryResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7899,26 +10163,20 @@ func (m *MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel) UnmarshalJSON(data case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) - delete(rawMsg, key) - case "sourceServerBrandVersion": - err = unpopulate(val, "SourceServerBrandVersion", &m.SourceServerBrandVersion) + case "migrationId": + err = unpopulate(val, "MigrationID", &m.MigrationID) delete(rawMsg, key) - case "sourceServerVersion": - err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) + case "sourceDatabaseName": + err = unpopulate(val, "SourceDatabaseName", &m.SourceDatabaseName) delete(rawMsg, key) case "startedOn": err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) - delete(rawMsg, key) - case "targetServerBrandVersion": - err = unpopulate(val, "TargetServerBrandVersion", &m.TargetServerBrandVersion) + case "status": + err = unpopulate(val, "Status", &m.Status) delete(rawMsg, key) - case "targetServerVersion": - err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) + case "targetDatabaseName": + err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) delete(rawMsg, key) } if err != nil { @@ -7928,21 +10186,17 @@ func (m *MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbTaskProperties. -func (m MigrateSchemaSQLServerSQLDbTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationValidationOptions. +func (m MigrationValidationOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", m.ClientData) - populate(objectMap, "commands", m.Commands) - populate(objectMap, "errors", m.Errors) - populate(objectMap, "input", m.Input) - populate(objectMap, "output", m.Output) - populate(objectMap, "state", m.State) - objectMap["taskType"] = "MigrateSchemaSqlServerSqlDb" + populate(objectMap, "enableDataIntegrityValidation", m.EnableDataIntegrityValidation) + populate(objectMap, "enableQueryAnalysisValidation", m.EnableQueryAnalysisValidation) + populate(objectMap, "enableSchemaValidation", m.EnableSchemaValidation) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLServerSQLDbTaskProperties. -func (m *MigrateSchemaSQLServerSQLDbTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationValidationOptions. +func (m *MigrationValidationOptions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7950,26 +10204,14 @@ func (m *MigrateSchemaSQLServerSQLDbTaskProperties) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &m.ClientData) - delete(rawMsg, key) - case "commands": - m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &m.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &m.Input) - delete(rawMsg, key) - case "output": - m.Output, err = unmarshalMigrateSchemaSQLServerSQLDbTaskOutputClassificationArray(val) + case "enableDataIntegrityValidation": + err = unpopulate(val, "EnableDataIntegrityValidation", &m.EnableDataIntegrityValidation) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "enableQueryAnalysisValidation": + err = unpopulate(val, "EnableQueryAnalysisValidation", &m.EnableQueryAnalysisValidation) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &m.TaskType) + case "enableSchemaValidation": + err = unpopulate(val, "EnableSchemaValidation", &m.EnableSchemaValidation) delete(rawMsg, key) } if err != nil { @@ -7979,17 +10221,18 @@ func (m *MigrateSchemaSQLServerSQLDbTaskProperties) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLTaskOutputError. -func (m MigrateSchemaSQLTaskOutputError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationValidationResult. +func (m MigrationValidationResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", m.Error) populate(objectMap, "id", m.ID) - objectMap["resultType"] = "ErrorOutput" + populate(objectMap, "migrationId", m.MigrationID) + populate(objectMap, "status", m.Status) + populate(objectMap, "summaryResults", m.SummaryResults) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSchemaSQLTaskOutputError. -func (m *MigrateSchemaSQLTaskOutputError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationValidationResult. +func (m *MigrationValidationResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7997,14 +10240,17 @@ func (m *MigrateSchemaSQLTaskOutputError) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &m.Error) - delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "migrationId": + err = unpopulate(val, "MigrationID", &m.MigrationID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "summaryResults": + err = unpopulate(val, "SummaryResults", &m.SummaryResults) delete(rawMsg, key) } if err != nil { @@ -8014,17 +10260,20 @@ func (m *MigrateSchemaSQLTaskOutputError) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSsisTaskInput. -func (m MigrateSsisTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoConnectionInformation. +func (m MongoConnectionInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) - populate(objectMap, "ssisMigrationInfo", m.SsisMigrationInfo) - populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) + populate(objectMap, "connectionString", m.ConnectionString) + populate(objectMap, "host", m.Host) + populate(objectMap, "password", m.Password) + populate(objectMap, "port", m.Port) + populate(objectMap, "useSsl", m.UseSSL) + populate(objectMap, "userName", m.UserName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSsisTaskInput. -func (m *MigrateSsisTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoConnectionInformation. +func (m *MongoConnectionInformation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8032,14 +10281,23 @@ func (m *MigrateSsisTaskInput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "sourceConnectionInfo": - err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) + case "connectionString": + err = unpopulate(val, "ConnectionString", &m.ConnectionString) delete(rawMsg, key) - case "ssisMigrationInfo": - err = unpopulate(val, "SsisMigrationInfo", &m.SsisMigrationInfo) + case "host": + err = unpopulate(val, "Host", &m.Host) delete(rawMsg, key) - case "targetConnectionInfo": - err = unpopulate(val, "TargetConnectionInfo", &m.TargetConnectionInfo) + case "password": + err = unpopulate(val, "Password", &m.Password) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &m.Port) + delete(rawMsg, key) + case "useSsl": + err = unpopulate(val, "UseSSL", &m.UseSSL) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &m.UserName) delete(rawMsg, key) } if err != nil { @@ -8049,16 +10307,18 @@ func (m *MigrateSsisTaskInput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSsisTaskOutput. -func (m MigrateSsisTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbCancelCommand. +func (m MongoDbCancelCommand) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - objectMap["resultType"] = m.ResultType + objectMap["commandType"] = CommandTypeCancel + populate(objectMap, "errors", m.Errors) + populate(objectMap, "input", m.Input) + populate(objectMap, "state", m.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSsisTaskOutput. -func (m *MigrateSsisTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbCancelCommand. +func (m *MongoDbCancelCommand) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8066,11 +10326,17 @@ func (m *MigrateSsisTaskOutput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) + case "commandType": + err = unpopulate(val, "CommandType", &m.CommandType) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &m.Input) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) delete(rawMsg, key) } if err != nil { @@ -8080,26 +10346,18 @@ func (m *MigrateSsisTaskOutput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSsisTaskOutputMigrationLevel. -func (m MigrateSsisTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbClusterInfo. +func (m MongoDbClusterInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) - populate(objectMap, "id", m.ID) - populate(objectMap, "message", m.Message) - objectMap["resultType"] = "MigrationLevelOutput" - populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) - populate(objectMap, "sourceServerVersion", m.SourceServerVersion) - populate(objectMap, "stage", m.Stage) - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "status", m.Status) - populate(objectMap, "targetServerBrandVersion", m.TargetServerBrandVersion) - populate(objectMap, "targetServerVersion", m.TargetServerVersion) + populate(objectMap, "databases", m.Databases) + populate(objectMap, "supportsSharding", m.SupportsSharding) + populate(objectMap, "type", m.Type) + populate(objectMap, "version", m.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSsisTaskOutputMigrationLevel. -func (m *MigrateSsisTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbClusterInfo. +func (m *MongoDbClusterInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8107,41 +10365,17 @@ func (m *MigrateSsisTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) - delete(rawMsg, key) - case "exceptionsAndWarnings": - err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &m.Message) - delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) - delete(rawMsg, key) - case "sourceServerBrandVersion": - err = unpopulate(val, "SourceServerBrandVersion", &m.SourceServerBrandVersion) - delete(rawMsg, key) - case "sourceServerVersion": - err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) - delete(rawMsg, key) - case "stage": - err = unpopulate(val, "Stage", &m.Stage) - delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + case "databases": + err = unpopulate(val, "Databases", &m.Databases) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "supportsSharding": + err = unpopulate(val, "SupportsSharding", &m.SupportsSharding) delete(rawMsg, key) - case "targetServerBrandVersion": - err = unpopulate(val, "TargetServerBrandVersion", &m.TargetServerBrandVersion) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) - case "targetServerVersion": - err = unpopulate(val, "TargetServerVersion", &m.TargetServerVersion) + case "version": + err = unpopulate(val, "Version", &m.Version) delete(rawMsg, key) } if err != nil { @@ -8151,24 +10385,26 @@ func (m *MigrateSsisTaskOutputMigrationLevel) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSsisTaskOutputProjectLevel. -func (m MigrateSsisTaskOutputProjectLevel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbCollectionInfo. +func (m MongoDbCollectionInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) - populate(objectMap, "folderName", m.FolderName) - populate(objectMap, "id", m.ID) - populate(objectMap, "message", m.Message) - populate(objectMap, "projectName", m.ProjectName) - objectMap["resultType"] = "SsisProjectLevelOutput" - populate(objectMap, "stage", m.Stage) - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "state", m.State) + populate(objectMap, "averageDocumentSize", m.AverageDocumentSize) + populate(objectMap, "dataSize", m.DataSize) + populate(objectMap, "databaseName", m.DatabaseName) + populate(objectMap, "documentCount", m.DocumentCount) + populate(objectMap, "isCapped", m.IsCapped) + populate(objectMap, "isSystemCollection", m.IsSystemCollection) + populate(objectMap, "isView", m.IsView) + populate(objectMap, "name", m.Name) + populate(objectMap, "qualifiedName", m.QualifiedName) + populate(objectMap, "shardKey", m.ShardKey) + populate(objectMap, "supportsSharding", m.SupportsSharding) + populate(objectMap, "viewOf", m.ViewOf) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSsisTaskOutputProjectLevel. -func (m *MigrateSsisTaskOutputProjectLevel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbCollectionInfo. +func (m *MongoDbCollectionInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8176,35 +10412,41 @@ func (m *MigrateSsisTaskOutputProjectLevel) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) + case "averageDocumentSize": + err = unpopulate(val, "AverageDocumentSize", &m.AverageDocumentSize) delete(rawMsg, key) - case "exceptionsAndWarnings": - err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) + case "dataSize": + err = unpopulate(val, "DataSize", &m.DataSize) delete(rawMsg, key) - case "folderName": - err = unpopulate(val, "FolderName", &m.FolderName) + case "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) + case "documentCount": + err = unpopulate(val, "DocumentCount", &m.DocumentCount) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &m.Message) + case "isCapped": + err = unpopulate(val, "IsCapped", &m.IsCapped) + delete(rawMsg, key) + case "isSystemCollection": + err = unpopulate(val, "IsSystemCollection", &m.IsSystemCollection) delete(rawMsg, key) - case "projectName": - err = unpopulate(val, "ProjectName", &m.ProjectName) + case "isView": + err = unpopulate(val, "IsView", &m.IsView) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "name": + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "stage": - err = unpopulate(val, "Stage", &m.Stage) + case "qualifiedName": + err = unpopulate(val, "QualifiedName", &m.QualifiedName) delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + case "shardKey": + err = unpopulate(val, "ShardKey", &m.ShardKey) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "supportsSharding": + err = unpopulate(val, "SupportsSharding", &m.SupportsSharding) + delete(rawMsg, key) + case "viewOf": + err = unpopulate(val, "ViewOf", &m.ViewOf) delete(rawMsg, key) } if err != nil { @@ -8214,21 +10456,28 @@ func (m *MigrateSsisTaskOutputProjectLevel) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSsisTaskProperties. -func (m MigrateSsisTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbCollectionProgress. +func (m MongoDbCollectionProgress) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", m.ClientData) - populate(objectMap, "commands", m.Commands) + populate(objectMap, "bytesCopied", m.BytesCopied) + populate(objectMap, "documentsCopied", m.DocumentsCopied) + populate(objectMap, "elapsedTime", m.ElapsedTime) populate(objectMap, "errors", m.Errors) - populate(objectMap, "input", m.Input) - populate(objectMap, "output", m.Output) + populate(objectMap, "eventsPending", m.EventsPending) + populate(objectMap, "eventsReplayed", m.EventsReplayed) + populateDateTimeRFC3339(objectMap, "lastEventTime", m.LastEventTime) + populateDateTimeRFC3339(objectMap, "lastReplayTime", m.LastReplayTime) + populate(objectMap, "name", m.Name) + populate(objectMap, "qualifiedName", m.QualifiedName) + objectMap["resultType"] = MongoDbProgressResultTypeCollection populate(objectMap, "state", m.State) - objectMap["taskType"] = "Migrate.Ssis" + populate(objectMap, "totalBytes", m.TotalBytes) + populate(objectMap, "totalDocuments", m.TotalDocuments) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSsisTaskProperties. -func (m *MigrateSsisTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbCollectionProgress. +func (m *MongoDbCollectionProgress) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8236,26 +10485,47 @@ func (m *MigrateSsisTaskProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &m.ClientData) + case "bytesCopied": + err = unpopulate(val, "BytesCopied", &m.BytesCopied) delete(rawMsg, key) - case "commands": - m.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + case "documentsCopied": + err = unpopulate(val, "DocumentsCopied", &m.DocumentsCopied) + delete(rawMsg, key) + case "elapsedTime": + err = unpopulate(val, "ElapsedTime", &m.ElapsedTime) delete(rawMsg, key) case "errors": err = unpopulate(val, "Errors", &m.Errors) delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &m.Input) + case "eventsPending": + err = unpopulate(val, "EventsPending", &m.EventsPending) delete(rawMsg, key) - case "output": - m.Output, err = unmarshalMigrateSsisTaskOutputClassificationArray(val) + case "eventsReplayed": + err = unpopulate(val, "EventsReplayed", &m.EventsReplayed) + delete(rawMsg, key) + case "lastEventTime": + err = unpopulateDateTimeRFC3339(val, "LastEventTime", &m.LastEventTime) + delete(rawMsg, key) + case "lastReplayTime": + err = unpopulateDateTimeRFC3339(val, "LastReplayTime", &m.LastReplayTime) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "qualifiedName": + err = unpopulate(val, "QualifiedName", &m.QualifiedName) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &m.State) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &m.TaskType) + case "totalBytes": + err = unpopulate(val, "TotalBytes", &m.TotalBytes) + delete(rawMsg, key) + case "totalDocuments": + err = unpopulate(val, "TotalDocuments", &m.TotalDocuments) delete(rawMsg, key) } if err != nil { @@ -8265,16 +10535,17 @@ func (m *MigrateSsisTaskProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSyncCompleteCommandInput. -func (m MigrateSyncCompleteCommandInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbCollectionSettings. +func (m MongoDbCollectionSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "commitTimeStamp", m.CommitTimeStamp) - populate(objectMap, "databaseName", m.DatabaseName) + populate(objectMap, "canDelete", m.CanDelete) + populate(objectMap, "shardKey", m.ShardKey) + populate(objectMap, "targetRUs", m.TargetRUs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSyncCompleteCommandInput. -func (m *MigrateSyncCompleteCommandInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbCollectionSettings. +func (m *MongoDbCollectionSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8282,11 +10553,14 @@ func (m *MigrateSyncCompleteCommandInput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "commitTimeStamp": - err = unpopulateDateTimeRFC3339(val, "CommitTimeStamp", &m.CommitTimeStamp) + case "canDelete": + err = unpopulate(val, "CanDelete", &m.CanDelete) delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) + case "shardKey": + err = unpopulate(val, "ShardKey", &m.ShardKey) + delete(rawMsg, key) + case "targetRUs": + err = unpopulate(val, "TargetRUs", &m.TargetRUs) delete(rawMsg, key) } if err != nil { @@ -8296,16 +10570,15 @@ func (m *MigrateSyncCompleteCommandInput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSyncCompleteCommandOutput. -func (m MigrateSyncCompleteCommandOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbCommandInput. +func (m MongoDbCommandInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "errors", m.Errors) - populate(objectMap, "id", m.ID) + populate(objectMap, "objectName", m.ObjectName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSyncCompleteCommandOutput. -func (m *MigrateSyncCompleteCommandOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbCommandInput. +func (m *MongoDbCommandInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8313,11 +10586,8 @@ func (m *MigrateSyncCompleteCommandOutput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "errors": - err = unpopulate(val, "Errors", &m.Errors) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) + case "objectName": + err = unpopulate(val, "ObjectName", &m.ObjectName) delete(rawMsg, key) } if err != nil { @@ -8327,19 +10597,28 @@ func (m *MigrateSyncCompleteCommandOutput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrateSyncCompleteCommandProperties. -func (m MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbConnectionInfo. +func (m MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["commandType"] = "Migrate.Sync.Complete.Database" - populate(objectMap, "errors", m.Errors) - populate(objectMap, "input", m.Input) - populate(objectMap, "output", m.Output) - populate(objectMap, "state", m.State) + populate(objectMap, "additionalSettings", m.AdditionalSettings) + populate(objectMap, "authentication", m.Authentication) + populate(objectMap, "connectionString", m.ConnectionString) + populate(objectMap, "dataSource", m.DataSource) + populate(objectMap, "encryptConnection", m.EncryptConnection) + populate(objectMap, "enforceSSL", m.EnforceSSL) + populate(objectMap, "password", m.Password) + populate(objectMap, "port", m.Port) + populate(objectMap, "serverBrandVersion", m.ServerBrandVersion) + populate(objectMap, "serverName", m.ServerName) + populate(objectMap, "serverVersion", m.ServerVersion) + populate(objectMap, "trustServerCertificate", m.TrustServerCertificate) + objectMap["type"] = "MongoDbConnectionInfo" + populate(objectMap, "userName", m.UserName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateSyncCompleteCommandProperties. -func (m *MigrateSyncCompleteCommandProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbConnectionInfo. +func (m *MongoDbConnectionInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8347,51 +10626,47 @@ func (m *MigrateSyncCompleteCommandProperties) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "commandType": - err = unpopulate(val, "CommandType", &m.CommandType) + case "additionalSettings": + err = unpopulate(val, "AdditionalSettings", &m.AdditionalSettings) delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &m.Errors) + case "authentication": + err = unpopulate(val, "Authentication", &m.Authentication) delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &m.Input) + case "connectionString": + err = unpopulate(val, "ConnectionString", &m.ConnectionString) delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &m.Output) + case "dataSource": + err = unpopulate(val, "DataSource", &m.DataSource) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "encryptConnection": + err = unpopulate(val, "EncryptConnection", &m.EncryptConnection) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrationEligibilityInfo. -func (m MigrationEligibilityInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "isEligibleForMigration", m.IsEligibleForMigration) - populate(objectMap, "validationMessages", m.ValidationMessages) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationEligibilityInfo. -func (m *MigrationEligibilityInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "isEligibleForMigration": - err = unpopulate(val, "IsEligibleForMigration", &m.IsEligibleForMigration) + case "enforceSSL": + err = unpopulate(val, "EnforceSSL", &m.EnforceSSL) delete(rawMsg, key) - case "validationMessages": - err = unpopulate(val, "ValidationMessages", &m.ValidationMessages) + case "password": + err = unpopulate(val, "Password", &m.Password) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &m.Port) + delete(rawMsg, key) + case "serverBrandVersion": + err = unpopulate(val, "ServerBrandVersion", &m.ServerBrandVersion) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &m.ServerName) + delete(rawMsg, key) + case "serverVersion": + err = unpopulate(val, "ServerVersion", &m.ServerVersion) + delete(rawMsg, key) + case "trustServerCertificate": + err = unpopulate(val, "TrustServerCertificate", &m.TrustServerCertificate) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &m.UserName) delete(rawMsg, key) } if err != nil { @@ -8401,16 +10676,21 @@ func (m *MigrationEligibilityInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrationReportResult. -func (m MigrationReportResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbDatabaseInfo. +func (m MongoDbDatabaseInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "reportUrl", m.ReportURL) + populate(objectMap, "averageDocumentSize", m.AverageDocumentSize) + populate(objectMap, "collections", m.Collections) + populate(objectMap, "dataSize", m.DataSize) + populate(objectMap, "documentCount", m.DocumentCount) + populate(objectMap, "name", m.Name) + populate(objectMap, "qualifiedName", m.QualifiedName) + populate(objectMap, "supportsSharding", m.SupportsSharding) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationReportResult. -func (m *MigrationReportResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbDatabaseInfo. +func (m *MongoDbDatabaseInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8418,11 +10698,26 @@ func (m *MigrationReportResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) + case "averageDocumentSize": + err = unpopulate(val, "AverageDocumentSize", &m.AverageDocumentSize) delete(rawMsg, key) - case "reportUrl": - err = unpopulate(val, "ReportURL", &m.ReportURL) + case "collections": + err = unpopulate(val, "Collections", &m.Collections) + delete(rawMsg, key) + case "dataSize": + err = unpopulate(val, "DataSize", &m.DataSize) + delete(rawMsg, key) + case "documentCount": + err = unpopulate(val, "DocumentCount", &m.DocumentCount) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "qualifiedName": + err = unpopulate(val, "QualifiedName", &m.QualifiedName) + delete(rawMsg, key) + case "supportsSharding": + err = unpopulate(val, "SupportsSharding", &m.SupportsSharding) delete(rawMsg, key) } if err != nil { @@ -8432,16 +10727,29 @@ func (m *MigrationReportResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrationTableMetadata. -func (m MigrationTableMetadata) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbDatabaseProgress. +func (m MongoDbDatabaseProgress) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sourceTableName", m.SourceTableName) - populate(objectMap, "targetTableName", m.TargetTableName) + populate(objectMap, "bytesCopied", m.BytesCopied) + populate(objectMap, "collections", m.Collections) + populate(objectMap, "documentsCopied", m.DocumentsCopied) + populate(objectMap, "elapsedTime", m.ElapsedTime) + populate(objectMap, "errors", m.Errors) + populate(objectMap, "eventsPending", m.EventsPending) + populate(objectMap, "eventsReplayed", m.EventsReplayed) + populateDateTimeRFC3339(objectMap, "lastEventTime", m.LastEventTime) + populateDateTimeRFC3339(objectMap, "lastReplayTime", m.LastReplayTime) + populate(objectMap, "name", m.Name) + populate(objectMap, "qualifiedName", m.QualifiedName) + objectMap["resultType"] = MongoDbProgressResultTypeDatabase + populate(objectMap, "state", m.State) + populate(objectMap, "totalBytes", m.TotalBytes) + populate(objectMap, "totalDocuments", m.TotalDocuments) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationTableMetadata. -func (m *MigrationTableMetadata) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbDatabaseProgress. +func (m *MongoDbDatabaseProgress) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8449,11 +10757,50 @@ func (m *MigrationTableMetadata) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "sourceTableName": - err = unpopulate(val, "SourceTableName", &m.SourceTableName) + case "bytesCopied": + err = unpopulate(val, "BytesCopied", &m.BytesCopied) delete(rawMsg, key) - case "targetTableName": - err = unpopulate(val, "TargetTableName", &m.TargetTableName) + case "collections": + err = unpopulate(val, "Collections", &m.Collections) + delete(rawMsg, key) + case "documentsCopied": + err = unpopulate(val, "DocumentsCopied", &m.DocumentsCopied) + delete(rawMsg, key) + case "elapsedTime": + err = unpopulate(val, "ElapsedTime", &m.ElapsedTime) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) + delete(rawMsg, key) + case "eventsPending": + err = unpopulate(val, "EventsPending", &m.EventsPending) + delete(rawMsg, key) + case "eventsReplayed": + err = unpopulate(val, "EventsReplayed", &m.EventsReplayed) + delete(rawMsg, key) + case "lastEventTime": + err = unpopulateDateTimeRFC3339(val, "LastEventTime", &m.LastEventTime) + delete(rawMsg, key) + case "lastReplayTime": + err = unpopulateDateTimeRFC3339(val, "LastReplayTime", &m.LastReplayTime) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "qualifiedName": + err = unpopulate(val, "QualifiedName", &m.QualifiedName) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "totalBytes": + err = unpopulate(val, "TotalBytes", &m.TotalBytes) + delete(rawMsg, key) + case "totalDocuments": + err = unpopulate(val, "TotalDocuments", &m.TotalDocuments) delete(rawMsg, key) } if err != nil { @@ -8463,24 +10810,16 @@ func (m *MigrationTableMetadata) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrationValidationDatabaseLevelResult. -func (m MigrationValidationDatabaseLevelResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbDatabaseSettings. +func (m MongoDbDatabaseSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataIntegrityValidationResult", m.DataIntegrityValidationResult) - populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "id", m.ID) - populate(objectMap, "migrationId", m.MigrationID) - populate(objectMap, "queryAnalysisValidationResult", m.QueryAnalysisValidationResult) - populate(objectMap, "schemaValidationResult", m.SchemaValidationResult) - populate(objectMap, "sourceDatabaseName", m.SourceDatabaseName) - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "status", m.Status) - populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) + populate(objectMap, "collections", m.Collections) + populate(objectMap, "targetRUs", m.TargetRUs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationValidationDatabaseLevelResult. -func (m *MigrationValidationDatabaseLevelResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbDatabaseSettings. +func (m *MongoDbDatabaseSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8488,35 +10827,11 @@ func (m *MigrationValidationDatabaseLevelResult) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { - case "dataIntegrityValidationResult": - err = unpopulate(val, "DataIntegrityValidationResult", &m.DataIntegrityValidationResult) - delete(rawMsg, key) - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "migrationId": - err = unpopulate(val, "MigrationID", &m.MigrationID) - delete(rawMsg, key) - case "queryAnalysisValidationResult": - err = unpopulate(val, "QueryAnalysisValidationResult", &m.QueryAnalysisValidationResult) - delete(rawMsg, key) - case "schemaValidationResult": - err = unpopulate(val, "SchemaValidationResult", &m.SchemaValidationResult) - delete(rawMsg, key) - case "sourceDatabaseName": - err = unpopulate(val, "SourceDatabaseName", &m.SourceDatabaseName) - delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "collections": + err = unpopulate(val, "Collections", &m.Collections) delete(rawMsg, key) - case "targetDatabaseName": - err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) + case "targetRUs": + err = unpopulate(val, "TargetRUs", &m.TargetRUs) delete(rawMsg, key) } if err != nil { @@ -8526,21 +10841,18 @@ func (m *MigrationValidationDatabaseLevelResult) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrationValidationDatabaseSummaryResult. -func (m MigrationValidationDatabaseSummaryResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbError. +func (m MongoDbError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "id", m.ID) - populate(objectMap, "migrationId", m.MigrationID) - populate(objectMap, "sourceDatabaseName", m.SourceDatabaseName) - populateDateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "status", m.Status) - populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) + populate(objectMap, "code", m.Code) + populate(objectMap, "count", m.Count) + populate(objectMap, "message", m.Message) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationValidationDatabaseSummaryResult. -func (m *MigrationValidationDatabaseSummaryResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbError. +func (m *MongoDbError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8548,26 +10860,17 @@ func (m *MigrationValidationDatabaseSummaryResult) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &m.EndedOn) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "migrationId": - err = unpopulate(val, "MigrationID", &m.MigrationID) - delete(rawMsg, key) - case "sourceDatabaseName": - err = unpopulate(val, "SourceDatabaseName", &m.SourceDatabaseName) + case "code": + err = unpopulate(val, "Code", &m.Code) delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &m.StartedOn) + case "count": + err = unpopulate(val, "Count", &m.Count) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "message": + err = unpopulate(val, "Message", &m.Message) delete(rawMsg, key) - case "targetDatabaseName": - err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { @@ -8577,17 +10880,18 @@ func (m *MigrationValidationDatabaseSummaryResult) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrationValidationOptions. -func (m MigrationValidationOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbFinishCommand. +func (m MongoDbFinishCommand) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enableDataIntegrityValidation", m.EnableDataIntegrityValidation) - populate(objectMap, "enableQueryAnalysisValidation", m.EnableQueryAnalysisValidation) - populate(objectMap, "enableSchemaValidation", m.EnableSchemaValidation) + objectMap["commandType"] = CommandTypeFinish + populate(objectMap, "errors", m.Errors) + populate(objectMap, "input", m.Input) + populate(objectMap, "state", m.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationValidationOptions. -func (m *MigrationValidationOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbFinishCommand. +func (m *MongoDbFinishCommand) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8595,14 +10899,17 @@ func (m *MigrationValidationOptions) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "enableDataIntegrityValidation": - err = unpopulate(val, "EnableDataIntegrityValidation", &m.EnableDataIntegrityValidation) + case "commandType": + err = unpopulate(val, "CommandType", &m.CommandType) delete(rawMsg, key) - case "enableQueryAnalysisValidation": - err = unpopulate(val, "EnableQueryAnalysisValidation", &m.EnableQueryAnalysisValidation) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) delete(rawMsg, key) - case "enableSchemaValidation": - err = unpopulate(val, "EnableSchemaValidation", &m.EnableSchemaValidation) + case "input": + err = unpopulate(val, "Input", &m.Input) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) delete(rawMsg, key) } if err != nil { @@ -8612,18 +10919,16 @@ func (m *MigrationValidationOptions) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrationValidationResult. -func (m MigrationValidationResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbFinishCommandInput. +func (m MongoDbFinishCommandInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "migrationId", m.MigrationID) - populate(objectMap, "status", m.Status) - populate(objectMap, "summaryResults", m.SummaryResults) + populate(objectMap, "immediate", m.Immediate) + populate(objectMap, "objectName", m.ObjectName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationValidationResult. -func (m *MigrationValidationResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbFinishCommandInput. +func (m *MongoDbFinishCommandInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8631,17 +10936,11 @@ func (m *MigrationValidationResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "migrationId": - err = unpopulate(val, "MigrationID", &m.MigrationID) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "immediate": + err = unpopulate(val, "Immediate", &m.Immediate) delete(rawMsg, key) - case "summaryResults": - err = unpopulate(val, "SummaryResults", &m.SummaryResults) + case "objectName": + err = unpopulate(val, "ObjectName", &m.ObjectName) delete(rawMsg, key) } if err != nil { @@ -8651,18 +10950,29 @@ func (m *MigrationValidationResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbCancelCommand. -func (m MongoDbCancelCommand) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbMigrationProgress. +func (m MongoDbMigrationProgress) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["commandType"] = "cancel" + populate(objectMap, "bytesCopied", m.BytesCopied) + populate(objectMap, "databases", m.Databases) + populate(objectMap, "documentsCopied", m.DocumentsCopied) + populate(objectMap, "elapsedTime", m.ElapsedTime) populate(objectMap, "errors", m.Errors) - populate(objectMap, "input", m.Input) + populate(objectMap, "eventsPending", m.EventsPending) + populate(objectMap, "eventsReplayed", m.EventsReplayed) + populateDateTimeRFC3339(objectMap, "lastEventTime", m.LastEventTime) + populateDateTimeRFC3339(objectMap, "lastReplayTime", m.LastReplayTime) + populate(objectMap, "name", m.Name) + populate(objectMap, "qualifiedName", m.QualifiedName) + objectMap["resultType"] = MongoDbProgressResultTypeMigration populate(objectMap, "state", m.State) + populate(objectMap, "totalBytes", m.TotalBytes) + populate(objectMap, "totalDocuments", m.TotalDocuments) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbCancelCommand. -func (m *MongoDbCancelCommand) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbMigrationProgress. +func (m *MongoDbMigrationProgress) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8670,18 +10980,51 @@ func (m *MongoDbCancelCommand) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "commandType": - err = unpopulate(val, "CommandType", &m.CommandType) + case "bytesCopied": + err = unpopulate(val, "BytesCopied", &m.BytesCopied) + delete(rawMsg, key) + case "databases": + err = unpopulate(val, "Databases", &m.Databases) + delete(rawMsg, key) + case "documentsCopied": + err = unpopulate(val, "DocumentsCopied", &m.DocumentsCopied) + delete(rawMsg, key) + case "elapsedTime": + err = unpopulate(val, "ElapsedTime", &m.ElapsedTime) delete(rawMsg, key) case "errors": err = unpopulate(val, "Errors", &m.Errors) delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &m.Input) + case "eventsPending": + err = unpopulate(val, "EventsPending", &m.EventsPending) + delete(rawMsg, key) + case "eventsReplayed": + err = unpopulate(val, "EventsReplayed", &m.EventsReplayed) + delete(rawMsg, key) + case "lastEventTime": + err = unpopulateDateTimeRFC3339(val, "LastEventTime", &m.LastEventTime) + delete(rawMsg, key) + case "lastReplayTime": + err = unpopulateDateTimeRFC3339(val, "LastReplayTime", &m.LastReplayTime) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "qualifiedName": + err = unpopulate(val, "QualifiedName", &m.QualifiedName) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &m.ResultType) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &m.State) delete(rawMsg, key) + case "totalBytes": + err = unpopulate(val, "TotalBytes", &m.TotalBytes) + delete(rawMsg, key) + case "totalDocuments": + err = unpopulate(val, "TotalDocuments", &m.TotalDocuments) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8690,18 +11033,20 @@ func (m *MongoDbCancelCommand) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbClusterInfo. -func (m MongoDbClusterInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbMigrationSettings. +func (m MongoDbMigrationSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "boostRUs", m.BoostRUs) populate(objectMap, "databases", m.Databases) - populate(objectMap, "supportsSharding", m.SupportsSharding) - populate(objectMap, "type", m.Type) - populate(objectMap, "version", m.Version) + populate(objectMap, "replication", m.Replication) + populate(objectMap, "source", m.Source) + populate(objectMap, "target", m.Target) + populate(objectMap, "throttling", m.Throttling) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbClusterInfo. -func (m *MongoDbClusterInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbMigrationSettings. +func (m *MongoDbMigrationSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8709,17 +11054,23 @@ func (m *MongoDbClusterInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "boostRUs": + err = unpopulate(val, "BoostRUs", &m.BoostRUs) + delete(rawMsg, key) case "databases": err = unpopulate(val, "Databases", &m.Databases) delete(rawMsg, key) - case "supportsSharding": - err = unpopulate(val, "SupportsSharding", &m.SupportsSharding) + case "replication": + err = unpopulate(val, "Replication", &m.Replication) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "source": + err = unpopulate(val, "Source", &m.Source) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &m.Version) + case "target": + err = unpopulate(val, "Target", &m.Target) + delete(rawMsg, key) + case "throttling": + err = unpopulate(val, "Throttling", &m.Throttling) delete(rawMsg, key) } if err != nil { @@ -8729,26 +11080,19 @@ func (m *MongoDbClusterInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbCollectionInfo. -func (m MongoDbCollectionInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbObjectInfo. +func (m MongoDbObjectInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "averageDocumentSize", m.AverageDocumentSize) populate(objectMap, "dataSize", m.DataSize) - populate(objectMap, "databaseName", m.DatabaseName) populate(objectMap, "documentCount", m.DocumentCount) - populate(objectMap, "isCapped", m.IsCapped) - populate(objectMap, "isSystemCollection", m.IsSystemCollection) - populate(objectMap, "isView", m.IsView) populate(objectMap, "name", m.Name) populate(objectMap, "qualifiedName", m.QualifiedName) - populate(objectMap, "shardKey", m.ShardKey) - populate(objectMap, "supportsSharding", m.SupportsSharding) - populate(objectMap, "viewOf", m.ViewOf) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbCollectionInfo. -func (m *MongoDbCollectionInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbObjectInfo. +func (m *MongoDbObjectInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8762,36 +11106,15 @@ func (m *MongoDbCollectionInfo) UnmarshalJSON(data []byte) error { case "dataSize": err = unpopulate(val, "DataSize", &m.DataSize) delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) - delete(rawMsg, key) case "documentCount": err = unpopulate(val, "DocumentCount", &m.DocumentCount) delete(rawMsg, key) - case "isCapped": - err = unpopulate(val, "IsCapped", &m.IsCapped) - delete(rawMsg, key) - case "isSystemCollection": - err = unpopulate(val, "IsSystemCollection", &m.IsSystemCollection) - delete(rawMsg, key) - case "isView": - err = unpopulate(val, "IsView", &m.IsView) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) case "qualifiedName": err = unpopulate(val, "QualifiedName", &m.QualifiedName) delete(rawMsg, key) - case "shardKey": - err = unpopulate(val, "ShardKey", &m.ShardKey) - delete(rawMsg, key) - case "supportsSharding": - err = unpopulate(val, "SupportsSharding", &m.SupportsSharding) - delete(rawMsg, key) - case "viewOf": - err = unpopulate(val, "ViewOf", &m.ViewOf) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8800,8 +11123,8 @@ func (m *MongoDbCollectionInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbCollectionProgress. -func (m MongoDbCollectionProgress) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDbProgress. +func (m MongoDbProgress) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "bytesCopied", m.BytesCopied) populate(objectMap, "documentsCopied", m.DocumentsCopied) @@ -8813,15 +11136,15 @@ func (m MongoDbCollectionProgress) MarshalJSON() ([]byte, error) { populateDateTimeRFC3339(objectMap, "lastReplayTime", m.LastReplayTime) populate(objectMap, "name", m.Name) populate(objectMap, "qualifiedName", m.QualifiedName) - objectMap["resultType"] = MongoDbProgressResultTypeCollection + objectMap["resultType"] = m.ResultType populate(objectMap, "state", m.State) populate(objectMap, "totalBytes", m.TotalBytes) populate(objectMap, "totalDocuments", m.TotalDocuments) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbCollectionProgress. -func (m *MongoDbCollectionProgress) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbProgress. +func (m *MongoDbProgress) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8865,11 +11188,178 @@ func (m *MongoDbCollectionProgress) UnmarshalJSON(data []byte) error { case "state": err = unpopulate(val, "State", &m.State) delete(rawMsg, key) - case "totalBytes": - err = unpopulate(val, "TotalBytes", &m.TotalBytes) + case "totalBytes": + err = unpopulate(val, "TotalBytes", &m.TotalBytes) + delete(rawMsg, key) + case "totalDocuments": + err = unpopulate(val, "TotalDocuments", &m.TotalDocuments) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MongoDbRestartCommand. +func (m MongoDbRestartCommand) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["commandType"] = CommandTypeRestart + populate(objectMap, "errors", m.Errors) + populate(objectMap, "input", m.Input) + populate(objectMap, "state", m.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbRestartCommand. +func (m *MongoDbRestartCommand) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "commandType": + err = unpopulate(val, "CommandType", &m.CommandType) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &m.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &m.Input) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MongoDbShardKeyField. +func (m MongoDbShardKeyField) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", m.Name) + populate(objectMap, "order", m.Order) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbShardKeyField. +func (m *MongoDbShardKeyField) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "order": + err = unpopulate(val, "Order", &m.Order) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MongoDbShardKeyInfo. +func (m MongoDbShardKeyInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fields", m.Fields) + populate(objectMap, "isUnique", m.IsUnique) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbShardKeyInfo. +func (m *MongoDbShardKeyInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fields": + err = unpopulate(val, "Fields", &m.Fields) + delete(rawMsg, key) + case "isUnique": + err = unpopulate(val, "IsUnique", &m.IsUnique) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MongoDbShardKeySetting. +func (m MongoDbShardKeySetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fields", m.Fields) + populate(objectMap, "isUnique", m.IsUnique) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbShardKeySetting. +func (m *MongoDbShardKeySetting) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fields": + err = unpopulate(val, "Fields", &m.Fields) + delete(rawMsg, key) + case "isUnique": + err = unpopulate(val, "IsUnique", &m.IsUnique) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MongoDbThrottlingSettings. +func (m MongoDbThrottlingSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxParallelism", m.MaxParallelism) + populate(objectMap, "minFreeCpu", m.MinFreeCPU) + populate(objectMap, "minFreeMemoryMb", m.MinFreeMemoryMb) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbThrottlingSettings. +func (m *MongoDbThrottlingSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "maxParallelism": + err = unpopulate(val, "MaxParallelism", &m.MaxParallelism) + delete(rawMsg, key) + case "minFreeCpu": + err = unpopulate(val, "MinFreeCPU", &m.MinFreeCPU) delete(rawMsg, key) - case "totalDocuments": - err = unpopulate(val, "TotalDocuments", &m.TotalDocuments) + case "minFreeMemoryMb": + err = unpopulate(val, "MinFreeMemoryMb", &m.MinFreeMemoryMb) delete(rawMsg, key) } if err != nil { @@ -8879,17 +11369,19 @@ func (m *MongoDbCollectionProgress) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbCollectionSettings. -func (m MongoDbCollectionSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoMigrationCollection. +func (m MongoMigrationCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "canDelete", m.CanDelete) - populate(objectMap, "shardKey", m.ShardKey) - populate(objectMap, "targetRUs", m.TargetRUs) + populate(objectMap, "migrationProgressDetails", m.MigrationProgressDetails) + populate(objectMap, "sourceCollection", m.SourceCollection) + populate(objectMap, "sourceDatabase", m.SourceDatabase) + populate(objectMap, "targetCollection", m.TargetCollection) + populate(objectMap, "targetDatabase", m.TargetDatabase) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbCollectionSettings. -func (m *MongoDbCollectionSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoMigrationCollection. +func (m *MongoMigrationCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8897,14 +11389,20 @@ func (m *MongoDbCollectionSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "canDelete": - err = unpopulate(val, "CanDelete", &m.CanDelete) + case "migrationProgressDetails": + err = unpopulate(val, "MigrationProgressDetails", &m.MigrationProgressDetails) delete(rawMsg, key) - case "shardKey": - err = unpopulate(val, "ShardKey", &m.ShardKey) + case "sourceCollection": + err = unpopulate(val, "SourceCollection", &m.SourceCollection) delete(rawMsg, key) - case "targetRUs": - err = unpopulate(val, "TargetRUs", &m.TargetRUs) + case "sourceDatabase": + err = unpopulate(val, "SourceDatabase", &m.SourceDatabase) + delete(rawMsg, key) + case "targetCollection": + err = unpopulate(val, "TargetCollection", &m.TargetCollection) + delete(rawMsg, key) + case "targetDatabase": + err = unpopulate(val, "TargetDatabase", &m.TargetDatabase) delete(rawMsg, key) } if err != nil { @@ -8914,15 +11412,19 @@ func (m *MongoDbCollectionSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbCommandInput. -func (m MongoDbCommandInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoMigrationProgressDetails. +func (m MongoMigrationProgressDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "objectName", m.ObjectName) + populate(objectMap, "durationInSeconds", m.DurationInSeconds) + populate(objectMap, "migrationError", m.MigrationError) + populate(objectMap, "migrationStatus", m.MigrationStatus) + populate(objectMap, "processedDocumentCount", m.ProcessedDocumentCount) + populate(objectMap, "sourceDocumentCount", m.SourceDocumentCount) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbCommandInput. -func (m *MongoDbCommandInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoMigrationProgressDetails. +func (m *MongoMigrationProgressDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8930,8 +11432,20 @@ func (m *MongoDbCommandInput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "objectName": - err = unpopulate(val, "ObjectName", &m.ObjectName) + case "durationInSeconds": + err = unpopulate(val, "DurationInSeconds", &m.DurationInSeconds) + delete(rawMsg, key) + case "migrationError": + err = unpopulate(val, "MigrationError", &m.MigrationError) + delete(rawMsg, key) + case "migrationStatus": + err = unpopulate(val, "MigrationStatus", &m.MigrationStatus) + delete(rawMsg, key) + case "processedDocumentCount": + err = unpopulate(val, "ProcessedDocumentCount", &m.ProcessedDocumentCount) + delete(rawMsg, key) + case "sourceDocumentCount": + err = unpopulate(val, "SourceDocumentCount", &m.SourceDocumentCount) delete(rawMsg, key) } if err != nil { @@ -8941,18 +11455,23 @@ func (m *MongoDbCommandInput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbConnectionInfo. -func (m MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MySQLConnectionInfo. +func (m MySQLConnectionInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "connectionString", m.ConnectionString) + populate(objectMap, "additionalSettings", m.AdditionalSettings) + populate(objectMap, "authentication", m.Authentication) + populate(objectMap, "dataSource", m.DataSource) + populate(objectMap, "encryptConnection", m.EncryptConnection) populate(objectMap, "password", m.Password) - objectMap["type"] = "MongoDbConnectionInfo" + populate(objectMap, "port", m.Port) + populate(objectMap, "serverName", m.ServerName) + objectMap["type"] = "MySqlConnectionInfo" populate(objectMap, "userName", m.UserName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbConnectionInfo. -func (m *MongoDbConnectionInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MySQLConnectionInfo. +func (m *MySQLConnectionInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -8960,12 +11479,27 @@ func (m *MongoDbConnectionInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "connectionString": - err = unpopulate(val, "ConnectionString", &m.ConnectionString) + case "additionalSettings": + err = unpopulate(val, "AdditionalSettings", &m.AdditionalSettings) + delete(rawMsg, key) + case "authentication": + err = unpopulate(val, "Authentication", &m.Authentication) + delete(rawMsg, key) + case "dataSource": + err = unpopulate(val, "DataSource", &m.DataSource) + delete(rawMsg, key) + case "encryptConnection": + err = unpopulate(val, "EncryptConnection", &m.EncryptConnection) delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &m.Password) delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &m.Port) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &m.ServerName) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) @@ -8980,2079 +11514,2188 @@ func (m *MongoDbConnectionInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbDatabaseInfo. -func (m MongoDbDatabaseInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NameAvailabilityRequest. +func (n NameAvailabilityRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "averageDocumentSize", m.AverageDocumentSize) - populate(objectMap, "collections", m.Collections) - populate(objectMap, "dataSize", m.DataSize) - populate(objectMap, "documentCount", m.DocumentCount) - populate(objectMap, "name", m.Name) - populate(objectMap, "qualifiedName", m.QualifiedName) - populate(objectMap, "supportsSharding", m.SupportsSharding) + populate(objectMap, "name", n.Name) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbDatabaseInfo. -func (m *MongoDbDatabaseInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailabilityRequest. +func (n *NameAvailabilityRequest) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "averageDocumentSize": - err = unpopulate(val, "AverageDocumentSize", &m.AverageDocumentSize) - delete(rawMsg, key) - case "collections": - err = unpopulate(val, "Collections", &m.Collections) - delete(rawMsg, key) - case "dataSize": - err = unpopulate(val, "DataSize", &m.DataSize) + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "documentCount": - err = unpopulate(val, "DocumentCount", &m.DocumentCount) + case "type": + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NameAvailabilityResponse. +func (n NameAvailabilityResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "message", n.Message) + populate(objectMap, "nameAvailable", n.NameAvailable) + populate(objectMap, "reason", n.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailabilityResponse. +func (n *NameAvailabilityResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &n.Message) delete(rawMsg, key) - case "qualifiedName": - err = unpopulate(val, "QualifiedName", &m.QualifiedName) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &n.NameAvailable) delete(rawMsg, key) - case "supportsSharding": - err = unpopulate(val, "SupportsSharding", &m.SupportsSharding) + case "reason": + err = unpopulate(val, "Reason", &n.Reason) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbDatabaseProgress. -func (m MongoDbDatabaseProgress) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NodeMonitoringData. +func (n NodeMonitoringData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "bytesCopied", m.BytesCopied) - populate(objectMap, "collections", m.Collections) - populate(objectMap, "documentsCopied", m.DocumentsCopied) - populate(objectMap, "elapsedTime", m.ElapsedTime) - populate(objectMap, "errors", m.Errors) - populate(objectMap, "eventsPending", m.EventsPending) - populate(objectMap, "eventsReplayed", m.EventsReplayed) - populateDateTimeRFC3339(objectMap, "lastEventTime", m.LastEventTime) - populateDateTimeRFC3339(objectMap, "lastReplayTime", m.LastReplayTime) - populate(objectMap, "name", m.Name) - populate(objectMap, "qualifiedName", m.QualifiedName) - objectMap["resultType"] = MongoDbProgressResultTypeDatabase - populate(objectMap, "state", m.State) - populate(objectMap, "totalBytes", m.TotalBytes) - populate(objectMap, "totalDocuments", m.TotalDocuments) + populate(objectMap, "additionalProperties", n.AdditionalProperties) + populate(objectMap, "availableMemoryInMB", n.AvailableMemoryInMB) + populate(objectMap, "cpuUtilization", n.CPUUtilization) + populate(objectMap, "concurrentJobsLimit", n.ConcurrentJobsLimit) + populate(objectMap, "concurrentJobsRunning", n.ConcurrentJobsRunning) + populate(objectMap, "maxConcurrentJobs", n.MaxConcurrentJobs) + populate(objectMap, "nodeName", n.NodeName) + populate(objectMap, "receivedBytes", n.ReceivedBytes) + populate(objectMap, "sentBytes", n.SentBytes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbDatabaseProgress. -func (m *MongoDbDatabaseProgress) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NodeMonitoringData. +func (n *NodeMonitoringData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "bytesCopied": - err = unpopulate(val, "BytesCopied", &m.BytesCopied) + case "additionalProperties": + err = unpopulate(val, "AdditionalProperties", &n.AdditionalProperties) delete(rawMsg, key) - case "collections": - err = unpopulate(val, "Collections", &m.Collections) + case "availableMemoryInMB": + err = unpopulate(val, "AvailableMemoryInMB", &n.AvailableMemoryInMB) delete(rawMsg, key) - case "documentsCopied": - err = unpopulate(val, "DocumentsCopied", &m.DocumentsCopied) + case "cpuUtilization": + err = unpopulate(val, "CPUUtilization", &n.CPUUtilization) delete(rawMsg, key) - case "elapsedTime": - err = unpopulate(val, "ElapsedTime", &m.ElapsedTime) + case "concurrentJobsLimit": + err = unpopulate(val, "ConcurrentJobsLimit", &n.ConcurrentJobsLimit) delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &m.Errors) + case "concurrentJobsRunning": + err = unpopulate(val, "ConcurrentJobsRunning", &n.ConcurrentJobsRunning) delete(rawMsg, key) - case "eventsPending": - err = unpopulate(val, "EventsPending", &m.EventsPending) + case "maxConcurrentJobs": + err = unpopulate(val, "MaxConcurrentJobs", &n.MaxConcurrentJobs) delete(rawMsg, key) - case "eventsReplayed": - err = unpopulate(val, "EventsReplayed", &m.EventsReplayed) + case "nodeName": + err = unpopulate(val, "NodeName", &n.NodeName) delete(rawMsg, key) - case "lastEventTime": - err = unpopulateDateTimeRFC3339(val, "LastEventTime", &m.LastEventTime) + case "receivedBytes": + err = unpopulate(val, "ReceivedBytes", &n.ReceivedBytes) delete(rawMsg, key) - case "lastReplayTime": - err = unpopulateDateTimeRFC3339(val, "LastReplayTime", &m.LastReplayTime) + case "sentBytes": + err = unpopulate(val, "SentBytes", &n.SentBytes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NonSQLDataMigrationTable. +func (n NonSQLDataMigrationTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceName", n.SourceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NonSQLDataMigrationTable. +func (n *NonSQLDataMigrationTable) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sourceName": + err = unpopulate(val, "SourceName", &n.SourceName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NonSQLDataMigrationTableResult. +func (n NonSQLDataMigrationTableResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "elapsedTimeInMiliseconds", n.ElapsedTimeInMiliseconds) + populate(objectMap, "errors", n.Errors) + populate(objectMap, "resultCode", n.ResultCode) + populate(objectMap, "sourceName", n.SourceName) + populate(objectMap, "sourceRowCount", n.SourceRowCount) + populate(objectMap, "targetName", n.TargetName) + populate(objectMap, "targetRowCount", n.TargetRowCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NonSQLDataMigrationTableResult. +func (n *NonSQLDataMigrationTableResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "elapsedTimeInMiliseconds": + err = unpopulate(val, "ElapsedTimeInMiliseconds", &n.ElapsedTimeInMiliseconds) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "errors": + err = unpopulate(val, "Errors", &n.Errors) delete(rawMsg, key) - case "qualifiedName": - err = unpopulate(val, "QualifiedName", &m.QualifiedName) + case "resultCode": + err = unpopulate(val, "ResultCode", &n.ResultCode) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "sourceName": + err = unpopulate(val, "SourceName", &n.SourceName) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "sourceRowCount": + err = unpopulate(val, "SourceRowCount", &n.SourceRowCount) delete(rawMsg, key) - case "totalBytes": - err = unpopulate(val, "TotalBytes", &m.TotalBytes) + case "targetName": + err = unpopulate(val, "TargetName", &n.TargetName) delete(rawMsg, key) - case "totalDocuments": - err = unpopulate(val, "TotalDocuments", &m.TotalDocuments) + case "targetRowCount": + err = unpopulate(val, "TargetRowCount", &n.TargetRowCount) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbDatabaseSettings. -func (m MongoDbDatabaseSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NonSQLMigrationTaskInput. +func (n NonSQLMigrationTaskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "collections", m.Collections) - populate(objectMap, "targetRUs", m.TargetRUs) + populate(objectMap, "projectLocation", n.ProjectLocation) + populate(objectMap, "projectName", n.ProjectName) + populate(objectMap, "selectedTables", n.SelectedTables) + populate(objectMap, "targetConnectionInfo", n.TargetConnectionInfo) + populate(objectMap, "targetDatabaseName", n.TargetDatabaseName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbDatabaseSettings. -func (m *MongoDbDatabaseSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NonSQLMigrationTaskInput. +func (n *NonSQLMigrationTaskInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "collections": - err = unpopulate(val, "Collections", &m.Collections) + case "projectLocation": + err = unpopulate(val, "ProjectLocation", &n.ProjectLocation) delete(rawMsg, key) - case "targetRUs": - err = unpopulate(val, "TargetRUs", &m.TargetRUs) + case "projectName": + err = unpopulate(val, "ProjectName", &n.ProjectName) + delete(rawMsg, key) + case "selectedTables": + err = unpopulate(val, "SelectedTables", &n.SelectedTables) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &n.TargetConnectionInfo) + delete(rawMsg, key) + case "targetDatabaseName": + err = unpopulate(val, "TargetDatabaseName", &n.TargetDatabaseName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbError. -func (m MongoDbError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NonSQLMigrationTaskOutput. +func (n NonSQLMigrationTaskOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", m.Code) - populate(objectMap, "count", m.Count) - populate(objectMap, "message", m.Message) - populate(objectMap, "type", m.Type) + populate(objectMap, "dataMigrationTableResults", n.DataMigrationTableResults) + populateDateTimeRFC3339(objectMap, "endedOn", n.EndedOn) + populate(objectMap, "id", n.ID) + populate(objectMap, "progressMessage", n.ProgressMessage) + populate(objectMap, "sourceServerName", n.SourceServerName) + populateDateTimeRFC3339(objectMap, "startedOn", n.StartedOn) + populate(objectMap, "status", n.Status) + populate(objectMap, "targetServerName", n.TargetServerName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbError. -func (m *MongoDbError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NonSQLMigrationTaskOutput. +func (n *NonSQLMigrationTaskOutput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &m.Code) + case "dataMigrationTableResults": + err = unpopulate(val, "DataMigrationTableResults", &n.DataMigrationTableResults) delete(rawMsg, key) - case "count": - err = unpopulate(val, "Count", &m.Count) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &n.EndedOn) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &m.Message) + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "progressMessage": + err = unpopulate(val, "ProgressMessage", &n.ProgressMessage) + delete(rawMsg, key) + case "sourceServerName": + err = unpopulate(val, "SourceServerName", &n.SourceServerName) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &n.StartedOn) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &n.Status) + delete(rawMsg, key) + case "targetServerName": + err = unpopulate(val, "TargetServerName", &n.TargetServerName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbFinishCommand. -func (m MongoDbFinishCommand) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ODataError. +func (o ODataError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["commandType"] = "finish" - populate(objectMap, "errors", m.Errors) - populate(objectMap, "input", m.Input) - populate(objectMap, "state", m.State) + populate(objectMap, "code", o.Code) + populate(objectMap, "details", o.Details) + populate(objectMap, "message", o.Message) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbFinishCommand. -func (m *MongoDbFinishCommand) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ODataError. +func (o *ODataError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "commandType": - err = unpopulate(val, "CommandType", &m.CommandType) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &m.Errors) + case "code": + err = unpopulate(val, "Code", &o.Code) delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &m.Input) + case "details": + err = unpopulate(val, "Details", &o.Details) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "message": + err = unpopulate(val, "Message", &o.Message) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbFinishCommandInput. -func (m MongoDbFinishCommandInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OfflineConfiguration. +func (o OfflineConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "immediate", m.Immediate) - populate(objectMap, "objectName", m.ObjectName) + populate(objectMap, "lastBackupName", o.LastBackupName) + populate(objectMap, "offline", o.Offline) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbFinishCommandInput. -func (m *MongoDbFinishCommandInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OfflineConfiguration. +func (o *OfflineConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "immediate": - err = unpopulate(val, "Immediate", &m.Immediate) + case "lastBackupName": + err = unpopulate(val, "LastBackupName", &o.LastBackupName) delete(rawMsg, key) - case "objectName": - err = unpopulate(val, "ObjectName", &m.ObjectName) + case "offline": + err = unpopulate(val, "Offline", &o.Offline) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbMigrationProgress. -func (m MongoDbMigrationProgress) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "bytesCopied", m.BytesCopied) - populate(objectMap, "databases", m.Databases) - populate(objectMap, "documentsCopied", m.DocumentsCopied) - populate(objectMap, "elapsedTime", m.ElapsedTime) - populate(objectMap, "errors", m.Errors) - populate(objectMap, "eventsPending", m.EventsPending) - populate(objectMap, "eventsReplayed", m.EventsReplayed) - populateDateTimeRFC3339(objectMap, "lastEventTime", m.LastEventTime) - populateDateTimeRFC3339(objectMap, "lastReplayTime", m.LastReplayTime) - populate(objectMap, "name", m.Name) - populate(objectMap, "qualifiedName", m.QualifiedName) - objectMap["resultType"] = MongoDbProgressResultTypeMigration - populate(objectMap, "state", m.State) - populate(objectMap, "totalBytes", m.TotalBytes) - populate(objectMap, "totalDocuments", m.TotalDocuments) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbMigrationProgress. -func (m *MongoDbMigrationProgress) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "bytesCopied": - err = unpopulate(val, "BytesCopied", &m.BytesCopied) - delete(rawMsg, key) - case "databases": - err = unpopulate(val, "Databases", &m.Databases) - delete(rawMsg, key) - case "documentsCopied": - err = unpopulate(val, "DocumentsCopied", &m.DocumentsCopied) - delete(rawMsg, key) - case "elapsedTime": - err = unpopulate(val, "ElapsedTime", &m.ElapsedTime) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &m.Errors) - delete(rawMsg, key) - case "eventsPending": - err = unpopulate(val, "EventsPending", &m.EventsPending) - delete(rawMsg, key) - case "eventsReplayed": - err = unpopulate(val, "EventsReplayed", &m.EventsReplayed) - delete(rawMsg, key) - case "lastEventTime": - err = unpopulateDateTimeRFC3339(val, "LastEventTime", &m.LastEventTime) - delete(rawMsg, key) - case "lastReplayTime": - err = unpopulateDateTimeRFC3339(val, "LastReplayTime", &m.LastReplayTime) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "qualifiedName": - err = unpopulate(val, "QualifiedName", &m.QualifiedName) - delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) - delete(rawMsg, key) - case "totalBytes": - err = unpopulate(val, "TotalBytes", &m.TotalBytes) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "totalDocuments": - err = unpopulate(val, "TotalDocuments", &m.TotalDocuments) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbMigrationSettings. -func (m MongoDbMigrationSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationsDefinition. +func (o OperationsDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "boostRUs", m.BoostRUs) - populate(objectMap, "databases", m.Databases) - populate(objectMap, "replication", m.Replication) - populate(objectMap, "source", m.Source) - populate(objectMap, "target", m.Target) - populate(objectMap, "throttling", m.Throttling) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", o.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbMigrationSettings. -func (m *MongoDbMigrationSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsDefinition. +func (o *OperationsDefinition) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "boostRUs": - err = unpopulate(val, "BoostRUs", &m.BoostRUs) - delete(rawMsg, key) - case "databases": - err = unpopulate(val, "Databases", &m.Databases) - delete(rawMsg, key) - case "replication": - err = unpopulate(val, "Replication", &m.Replication) + case "display": + err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &m.Source) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &m.Target) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "throttling": - err = unpopulate(val, "Throttling", &m.Throttling) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbObjectInfo. -func (m MongoDbObjectInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationsDisplayDefinition. +func (o OperationsDisplayDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "averageDocumentSize", m.AverageDocumentSize) - populate(objectMap, "dataSize", m.DataSize) - populate(objectMap, "documentCount", m.DocumentCount) - populate(objectMap, "name", m.Name) - populate(objectMap, "qualifiedName", m.QualifiedName) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbObjectInfo. -func (m *MongoDbObjectInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsDisplayDefinition. +func (o *OperationsDisplayDefinition) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "averageDocumentSize": - err = unpopulate(val, "AverageDocumentSize", &m.AverageDocumentSize) - delete(rawMsg, key) - case "dataSize": - err = unpopulate(val, "DataSize", &m.DataSize) + case "description": + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "documentCount": - err = unpopulate(val, "DocumentCount", &m.DocumentCount) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) delete(rawMsg, key) - case "qualifiedName": - err = unpopulate(val, "QualifiedName", &m.QualifiedName) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbProgress. -func (m MongoDbProgress) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OracleConnectionInfo. +func (o OracleConnectionInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "bytesCopied", m.BytesCopied) - populate(objectMap, "documentsCopied", m.DocumentsCopied) - populate(objectMap, "elapsedTime", m.ElapsedTime) - populate(objectMap, "errors", m.Errors) - populate(objectMap, "eventsPending", m.EventsPending) - populate(objectMap, "eventsReplayed", m.EventsReplayed) - populateDateTimeRFC3339(objectMap, "lastEventTime", m.LastEventTime) - populateDateTimeRFC3339(objectMap, "lastReplayTime", m.LastReplayTime) - populate(objectMap, "name", m.Name) - populate(objectMap, "qualifiedName", m.QualifiedName) - objectMap["resultType"] = m.ResultType - populate(objectMap, "state", m.State) - populate(objectMap, "totalBytes", m.TotalBytes) - populate(objectMap, "totalDocuments", m.TotalDocuments) + populate(objectMap, "authentication", o.Authentication) + populate(objectMap, "dataSource", o.DataSource) + populate(objectMap, "password", o.Password) + populate(objectMap, "port", o.Port) + populate(objectMap, "serverName", o.ServerName) + populate(objectMap, "serverVersion", o.ServerVersion) + objectMap["type"] = "OracleConnectionInfo" + populate(objectMap, "userName", o.UserName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbProgress. -func (m *MongoDbProgress) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OracleConnectionInfo. +func (o *OracleConnectionInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "bytesCopied": - err = unpopulate(val, "BytesCopied", &m.BytesCopied) - delete(rawMsg, key) - case "documentsCopied": - err = unpopulate(val, "DocumentsCopied", &m.DocumentsCopied) - delete(rawMsg, key) - case "elapsedTime": - err = unpopulate(val, "ElapsedTime", &m.ElapsedTime) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &m.Errors) - delete(rawMsg, key) - case "eventsPending": - err = unpopulate(val, "EventsPending", &m.EventsPending) - delete(rawMsg, key) - case "eventsReplayed": - err = unpopulate(val, "EventsReplayed", &m.EventsReplayed) - delete(rawMsg, key) - case "lastEventTime": - err = unpopulateDateTimeRFC3339(val, "LastEventTime", &m.LastEventTime) + case "authentication": + err = unpopulate(val, "Authentication", &o.Authentication) delete(rawMsg, key) - case "lastReplayTime": - err = unpopulateDateTimeRFC3339(val, "LastReplayTime", &m.LastReplayTime) + case "dataSource": + err = unpopulate(val, "DataSource", &o.DataSource) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "password": + err = unpopulate(val, "Password", &o.Password) delete(rawMsg, key) - case "qualifiedName": - err = unpopulate(val, "QualifiedName", &m.QualifiedName) + case "port": + err = unpopulate(val, "Port", &o.Port) delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &m.ResultType) + case "serverName": + err = unpopulate(val, "ServerName", &o.ServerName) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "serverVersion": + err = unpopulate(val, "ServerVersion", &o.ServerVersion) delete(rawMsg, key) - case "totalBytes": - err = unpopulate(val, "TotalBytes", &m.TotalBytes) + case "type": + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) - case "totalDocuments": - err = unpopulate(val, "TotalDocuments", &m.TotalDocuments) + case "userName": + err = unpopulate(val, "UserName", &o.UserName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbRestartCommand. -func (m MongoDbRestartCommand) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OracleOCIDriverInfo. +func (o OracleOCIDriverInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["commandType"] = "restart" - populate(objectMap, "errors", m.Errors) - populate(objectMap, "input", m.Input) - populate(objectMap, "state", m.State) + populate(objectMap, "archiveChecksum", o.ArchiveChecksum) + populate(objectMap, "assemblyVersion", o.AssemblyVersion) + populate(objectMap, "driverName", o.DriverName) + populate(objectMap, "driverSize", o.DriverSize) + populate(objectMap, "oracleChecksum", o.OracleChecksum) + populate(objectMap, "supportedOracleVersions", o.SupportedOracleVersions) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbRestartCommand. -func (m *MongoDbRestartCommand) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OracleOCIDriverInfo. +func (o *OracleOCIDriverInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "commandType": - err = unpopulate(val, "CommandType", &m.CommandType) + case "archiveChecksum": + err = unpopulate(val, "ArchiveChecksum", &o.ArchiveChecksum) delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &m.Errors) + case "assemblyVersion": + err = unpopulate(val, "AssemblyVersion", &o.AssemblyVersion) delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &m.Input) + case "driverName": + err = unpopulate(val, "DriverName", &o.DriverName) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "driverSize": + err = unpopulate(val, "DriverSize", &o.DriverSize) + delete(rawMsg, key) + case "oracleChecksum": + err = unpopulate(val, "OracleChecksum", &o.OracleChecksum) + delete(rawMsg, key) + case "supportedOracleVersions": + err = unpopulate(val, "SupportedOracleVersions", &o.SupportedOracleVersions) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbShardKeyField. -func (m MongoDbShardKeyField) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OrphanedUserInfo. +func (o OrphanedUserInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", m.Name) - populate(objectMap, "order", m.Order) + populate(objectMap, "databaseName", o.DatabaseName) + populate(objectMap, "name", o.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbShardKeyField. -func (m *MongoDbShardKeyField) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OrphanedUserInfo. +func (o *OrphanedUserInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &m.Name) + case "databaseName": + err = unpopulate(val, "DatabaseName", &o.DatabaseName) delete(rawMsg, key) - case "order": - err = unpopulate(val, "Order", &m.Order) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbShardKeyInfo. -func (m MongoDbShardKeyInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PostgreSQLConnectionInfo. +func (p PostgreSQLConnectionInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "fields", m.Fields) - populate(objectMap, "isUnique", m.IsUnique) + populate(objectMap, "additionalSettings", p.AdditionalSettings) + populate(objectMap, "authentication", p.Authentication) + populate(objectMap, "dataSource", p.DataSource) + populate(objectMap, "databaseName", p.DatabaseName) + populate(objectMap, "encryptConnection", p.EncryptConnection) + populate(objectMap, "password", p.Password) + populate(objectMap, "port", p.Port) + populate(objectMap, "serverBrandVersion", p.ServerBrandVersion) + populate(objectMap, "serverName", p.ServerName) + populate(objectMap, "serverVersion", p.ServerVersion) + populate(objectMap, "trustServerCertificate", p.TrustServerCertificate) + objectMap["type"] = "PostgreSqlConnectionInfo" + populate(objectMap, "userName", p.UserName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbShardKeyInfo. -func (m *MongoDbShardKeyInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PostgreSQLConnectionInfo. +func (p *PostgreSQLConnectionInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "fields": - err = unpopulate(val, "Fields", &m.Fields) + case "additionalSettings": + err = unpopulate(val, "AdditionalSettings", &p.AdditionalSettings) delete(rawMsg, key) - case "isUnique": - err = unpopulate(val, "IsUnique", &m.IsUnique) + case "authentication": + err = unpopulate(val, "Authentication", &p.Authentication) + delete(rawMsg, key) + case "dataSource": + err = unpopulate(val, "DataSource", &p.DataSource) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &p.DatabaseName) + delete(rawMsg, key) + case "encryptConnection": + err = unpopulate(val, "EncryptConnection", &p.EncryptConnection) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &p.Password) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &p.Port) + delete(rawMsg, key) + case "serverBrandVersion": + err = unpopulate(val, "ServerBrandVersion", &p.ServerBrandVersion) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &p.ServerName) + delete(rawMsg, key) + case "serverVersion": + err = unpopulate(val, "ServerVersion", &p.ServerVersion) + delete(rawMsg, key) + case "trustServerCertificate": + err = unpopulate(val, "TrustServerCertificate", &p.TrustServerCertificate) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &p.UserName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbShardKeySetting. -func (m MongoDbShardKeySetting) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Project. +func (p Project) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "fields", m.Fields) - populate(objectMap, "isUnique", m.IsUnique) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbShardKeySetting. -func (m *MongoDbShardKeySetting) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Project. +func (p *Project) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "fields": - err = unpopulate(val, "Fields", &m.Fields) + case "etag": + err = unpopulate(val, "Etag", &p.Etag) delete(rawMsg, key) - case "isUnique": - err = unpopulate(val, "IsUnique", &m.IsUnique) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDbThrottlingSettings. -func (m MongoDbThrottlingSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProjectFile. +func (p ProjectFile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "maxParallelism", m.MaxParallelism) - populate(objectMap, "minFreeCpu", m.MinFreeCPU) - populate(objectMap, "minFreeMemoryMb", m.MinFreeMemoryMb) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbThrottlingSettings. -func (m *MongoDbThrottlingSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectFile. +func (p *ProjectFile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "maxParallelism": - err = unpopulate(val, "MaxParallelism", &m.MaxParallelism) + case "etag": + err = unpopulate(val, "Etag", &p.Etag) delete(rawMsg, key) - case "minFreeCpu": - err = unpopulate(val, "MinFreeCPU", &m.MinFreeCPU) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "minFreeMemoryMb": - err = unpopulate(val, "MinFreeMemoryMb", &m.MinFreeMemoryMb) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MySQLConnectionInfo. -func (m MySQLConnectionInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProjectFileProperties. +func (p ProjectFileProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "encryptConnection", m.EncryptConnection) - populate(objectMap, "password", m.Password) - populate(objectMap, "port", m.Port) - populate(objectMap, "serverName", m.ServerName) - objectMap["type"] = "MySqlConnectionInfo" - populate(objectMap, "userName", m.UserName) + populate(objectMap, "extension", p.Extension) + populate(objectMap, "filePath", p.FilePath) + populateDateTimeRFC3339(objectMap, "lastModified", p.LastModified) + populate(objectMap, "mediaType", p.MediaType) + populate(objectMap, "size", p.Size) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MySQLConnectionInfo. -func (m *MySQLConnectionInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectFileProperties. +func (p *ProjectFileProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "encryptConnection": - err = unpopulate(val, "EncryptConnection", &m.EncryptConnection) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &m.Password) + case "extension": + err = unpopulate(val, "Extension", &p.Extension) delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &m.Port) + case "filePath": + err = unpopulate(val, "FilePath", &p.FilePath) delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &m.ServerName) + case "lastModified": + err = unpopulateDateTimeRFC3339(val, "LastModified", &p.LastModified) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "mediaType": + err = unpopulate(val, "MediaType", &p.MediaType) delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &m.UserName) + case "size": + err = unpopulate(val, "Size", &p.Size) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NameAvailabilityRequest. -func (n NameAvailabilityRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProjectList. +func (p ProjectList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", n.Name) - populate(objectMap, "type", n.Type) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailabilityRequest. -func (n *NameAvailabilityRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectList. +func (p *ProjectList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &n.Name) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NameAvailabilityResponse. -func (n NameAvailabilityResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProjectMetadata. +func (p ProjectMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "message", n.Message) - populate(objectMap, "nameAvailable", n.NameAvailable) - populate(objectMap, "reason", n.Reason) + populate(objectMap, "selectedMigrationTables", p.SelectedMigrationTables) + populate(objectMap, "sourceServerName", p.SourceServerName) + populate(objectMap, "sourceServerPort", p.SourceServerPort) + populate(objectMap, "sourceUsername", p.SourceUsername) + populate(objectMap, "targetDbName", p.TargetDbName) + populate(objectMap, "targetServerName", p.TargetServerName) + populate(objectMap, "targetUsername", p.TargetUsername) + populate(objectMap, "targetUsingWinAuth", p.TargetUsingWinAuth) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailabilityResponse. -func (n *NameAvailabilityResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectMetadata. +func (p *ProjectMetadata) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "message": - err = unpopulate(val, "Message", &n.Message) + case "selectedMigrationTables": + err = unpopulate(val, "SelectedMigrationTables", &p.SelectedMigrationTables) delete(rawMsg, key) - case "nameAvailable": - err = unpopulate(val, "NameAvailable", &n.NameAvailable) + case "sourceServerName": + err = unpopulate(val, "SourceServerName", &p.SourceServerName) delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &n.Reason) + case "sourceServerPort": + err = unpopulate(val, "SourceServerPort", &p.SourceServerPort) + delete(rawMsg, key) + case "sourceUsername": + err = unpopulate(val, "SourceUsername", &p.SourceUsername) + delete(rawMsg, key) + case "targetDbName": + err = unpopulate(val, "TargetDbName", &p.TargetDbName) + delete(rawMsg, key) + case "targetServerName": + err = unpopulate(val, "TargetServerName", &p.TargetServerName) + delete(rawMsg, key) + case "targetUsername": + err = unpopulate(val, "TargetUsername", &p.TargetUsername) + delete(rawMsg, key) + case "targetUsingWinAuth": + err = unpopulate(val, "TargetUsingWinAuth", &p.TargetUsingWinAuth) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NonSQLDataMigrationTable. -func (n NonSQLDataMigrationTable) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProjectProperties. +func (p ProjectProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sourceName", n.SourceName) + populate(objectMap, "azureAuthenticationInfo", p.AzureAuthenticationInfo) + populateDateTimeRFC3339(objectMap, "creationTime", p.CreationTime) + populate(objectMap, "databasesInfo", p.DatabasesInfo) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "sourceConnectionInfo", p.SourceConnectionInfo) + populate(objectMap, "sourcePlatform", p.SourcePlatform) + populate(objectMap, "targetConnectionInfo", p.TargetConnectionInfo) + populate(objectMap, "targetPlatform", p.TargetPlatform) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NonSQLDataMigrationTable. -func (n *NonSQLDataMigrationTable) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectProperties. +func (p *ProjectProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "sourceName": - err = unpopulate(val, "SourceName", &n.SourceName) + case "azureAuthenticationInfo": + err = unpopulate(val, "AzureAuthenticationInfo", &p.AzureAuthenticationInfo) + delete(rawMsg, key) + case "creationTime": + err = unpopulateDateTimeRFC3339(val, "CreationTime", &p.CreationTime) + delete(rawMsg, key) + case "databasesInfo": + err = unpopulate(val, "DatabasesInfo", &p.DatabasesInfo) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "sourceConnectionInfo": + p.SourceConnectionInfo, err = unmarshalConnectionInfoClassification(val) + delete(rawMsg, key) + case "sourcePlatform": + err = unpopulate(val, "SourcePlatform", &p.SourcePlatform) + delete(rawMsg, key) + case "targetConnectionInfo": + p.TargetConnectionInfo, err = unmarshalConnectionInfoClassification(val) + delete(rawMsg, key) + case "targetPlatform": + err = unpopulate(val, "TargetPlatform", &p.TargetPlatform) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NonSQLDataMigrationTableResult. -func (n NonSQLDataMigrationTableResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProjectTask. +func (p ProjectTask) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "elapsedTimeInMiliseconds", n.ElapsedTimeInMiliseconds) - populate(objectMap, "errors", n.Errors) - populate(objectMap, "resultCode", n.ResultCode) - populate(objectMap, "sourceName", n.SourceName) - populate(objectMap, "sourceRowCount", n.SourceRowCount) - populate(objectMap, "targetName", n.TargetName) - populate(objectMap, "targetRowCount", n.TargetRowCount) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NonSQLDataMigrationTableResult. -func (n *NonSQLDataMigrationTableResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectTask. +func (p *ProjectTask) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "elapsedTimeInMiliseconds": - err = unpopulate(val, "ElapsedTimeInMiliseconds", &n.ElapsedTimeInMiliseconds) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &n.Errors) + case "etag": + err = unpopulate(val, "Etag", &p.Etag) delete(rawMsg, key) - case "resultCode": - err = unpopulate(val, "ResultCode", &n.ResultCode) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "sourceName": - err = unpopulate(val, "SourceName", &n.SourceName) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "sourceRowCount": - err = unpopulate(val, "SourceRowCount", &n.SourceRowCount) + case "properties": + p.Properties, err = unmarshalProjectTaskPropertiesClassification(val) delete(rawMsg, key) - case "targetName": - err = unpopulate(val, "TargetName", &n.TargetName) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) - case "targetRowCount": - err = unpopulate(val, "TargetRowCount", &n.TargetRowCount) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NonSQLMigrationTaskInput. -func (n NonSQLMigrationTaskInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProjectTaskProperties. +func (p ProjectTaskProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "projectLocation", n.ProjectLocation) - populate(objectMap, "projectName", n.ProjectName) - populate(objectMap, "selectedTables", n.SelectedTables) - populate(objectMap, "targetConnectionInfo", n.TargetConnectionInfo) - populate(objectMap, "targetDatabaseName", n.TargetDatabaseName) + populate(objectMap, "clientData", p.ClientData) + populate(objectMap, "commands", p.Commands) + populate(objectMap, "errors", p.Errors) + populate(objectMap, "state", p.State) + objectMap["taskType"] = p.TaskType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NonSQLMigrationTaskInput. -func (n *NonSQLMigrationTaskInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectTaskProperties. +func (p *ProjectTaskProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "projectLocation": - err = unpopulate(val, "ProjectLocation", &n.ProjectLocation) + case "clientData": + err = unpopulate(val, "ClientData", &p.ClientData) delete(rawMsg, key) - case "projectName": - err = unpopulate(val, "ProjectName", &n.ProjectName) + case "commands": + p.Commands, err = unmarshalCommandPropertiesClassificationArray(val) delete(rawMsg, key) - case "selectedTables": - err = unpopulate(val, "SelectedTables", &n.SelectedTables) + case "errors": + err = unpopulate(val, "Errors", &p.Errors) delete(rawMsg, key) - case "targetConnectionInfo": - err = unpopulate(val, "TargetConnectionInfo", &n.TargetConnectionInfo) + case "state": + err = unpopulate(val, "State", &p.State) delete(rawMsg, key) - case "targetDatabaseName": - err = unpopulate(val, "TargetDatabaseName", &n.TargetDatabaseName) + case "taskType": + err = unpopulate(val, "TaskType", &p.TaskType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NonSQLMigrationTaskOutput. -func (n NonSQLMigrationTaskOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataMigrationTableResults", n.DataMigrationTableResults) - populateDateTimeRFC3339(objectMap, "endedOn", n.EndedOn) - populate(objectMap, "id", n.ID) - populate(objectMap, "progressMessage", n.ProgressMessage) - populate(objectMap, "sourceServerName", n.SourceServerName) - populateDateTimeRFC3339(objectMap, "startedOn", n.StartedOn) - populate(objectMap, "status", n.Status) - populate(objectMap, "targetServerName", n.TargetServerName) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NonSQLMigrationTaskOutput. -func (n *NonSQLMigrationTaskOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "dataMigrationTableResults": - err = unpopulate(val, "DataMigrationTableResults", &n.DataMigrationTableResults) - delete(rawMsg, key) - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &n.EndedOn) - delete(rawMsg, key) case "id": - err = unpopulate(val, "ID", &n.ID) - delete(rawMsg, key) - case "progressMessage": - err = unpopulate(val, "ProgressMessage", &n.ProgressMessage) - delete(rawMsg, key) - case "sourceServerName": - err = unpopulate(val, "SourceServerName", &n.SourceServerName) + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &n.StartedOn) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &n.Status) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) - case "targetServerName": - err = unpopulate(val, "TargetServerName", &n.TargetServerName) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ODataError. -func (o ODataError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProxyResourceAutoGenerated. +func (p ProxyResourceAutoGenerated) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", o.Code) - populate(objectMap, "details", o.Details) - populate(objectMap, "message", o.Message) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ODataError. -func (o *ODataError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResourceAutoGenerated. +func (p *ProxyResourceAutoGenerated) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &o.Code) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &o.Details) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &o.Message) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OracleConnectionInfo. -func (o OracleConnectionInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QueryAnalysisValidationResult. +func (q QueryAnalysisValidationResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataSource", o.DataSource) - populate(objectMap, "password", o.Password) - objectMap["type"] = "OracleConnectionInfo" - populate(objectMap, "userName", o.UserName) + populate(objectMap, "queryResults", q.QueryResults) + populate(objectMap, "validationErrors", q.ValidationErrors) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OracleConnectionInfo. -func (o *OracleConnectionInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryAnalysisValidationResult. +func (q *QueryAnalysisValidationResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "dataSource": - err = unpopulate(val, "DataSource", &o.DataSource) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &o.Password) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &o.Type) + case "queryResults": + err = unpopulate(val, "QueryResults", &q.QueryResults) delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &o.UserName) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &q.ValidationErrors) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OracleOCIDriverInfo. -func (o OracleOCIDriverInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QueryExecutionResult. +func (q QueryExecutionResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "archiveChecksum", o.ArchiveChecksum) - populate(objectMap, "assemblyVersion", o.AssemblyVersion) - populate(objectMap, "driverName", o.DriverName) - populate(objectMap, "driverSize", o.DriverSize) - populate(objectMap, "oracleChecksum", o.OracleChecksum) - populate(objectMap, "supportedOracleVersions", o.SupportedOracleVersions) + populate(objectMap, "queryText", q.QueryText) + populate(objectMap, "sourceResult", q.SourceResult) + populate(objectMap, "statementsInBatch", q.StatementsInBatch) + populate(objectMap, "targetResult", q.TargetResult) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OracleOCIDriverInfo. -func (o *OracleOCIDriverInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryExecutionResult. +func (q *QueryExecutionResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "archiveChecksum": - err = unpopulate(val, "ArchiveChecksum", &o.ArchiveChecksum) - delete(rawMsg, key) - case "assemblyVersion": - err = unpopulate(val, "AssemblyVersion", &o.AssemblyVersion) - delete(rawMsg, key) - case "driverName": - err = unpopulate(val, "DriverName", &o.DriverName) + case "queryText": + err = unpopulate(val, "QueryText", &q.QueryText) delete(rawMsg, key) - case "driverSize": - err = unpopulate(val, "DriverSize", &o.DriverSize) + case "sourceResult": + err = unpopulate(val, "SourceResult", &q.SourceResult) delete(rawMsg, key) - case "oracleChecksum": - err = unpopulate(val, "OracleChecksum", &o.OracleChecksum) + case "statementsInBatch": + err = unpopulate(val, "StatementsInBatch", &q.StatementsInBatch) delete(rawMsg, key) - case "supportedOracleVersions": - err = unpopulate(val, "SupportedOracleVersions", &o.SupportedOracleVersions) + case "targetResult": + err = unpopulate(val, "TargetResult", &q.TargetResult) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OrphanedUserInfo. -func (o OrphanedUserInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Quota. +func (q Quota) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseName", o.DatabaseName) - populate(objectMap, "name", o.Name) + populate(objectMap, "currentValue", q.CurrentValue) + populate(objectMap, "id", q.ID) + populate(objectMap, "limit", q.Limit) + populate(objectMap, "name", q.Name) + populate(objectMap, "unit", q.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OrphanedUserInfo. -func (o *OrphanedUserInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Quota. +func (q *Quota) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &o.DatabaseName) + case "currentValue": + err = unpopulate(val, "CurrentValue", &q.CurrentValue) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &q.ID) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &q.Limit) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &o.Name) + err = unpopulate(val, "Name", &q.Name) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &q.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PostgreSQLConnectionInfo. -func (p PostgreSQLConnectionInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QuotaList. +func (q QuotaList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseName", p.DatabaseName) - populate(objectMap, "encryptConnection", p.EncryptConnection) - populate(objectMap, "password", p.Password) - populate(objectMap, "port", p.Port) - populate(objectMap, "serverName", p.ServerName) - populate(objectMap, "trustServerCertificate", p.TrustServerCertificate) - objectMap["type"] = "PostgreSqlConnectionInfo" - populate(objectMap, "userName", p.UserName) + populate(objectMap, "nextLink", q.NextLink) + populate(objectMap, "value", q.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PostgreSQLConnectionInfo. -func (p *PostgreSQLConnectionInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaList. +func (q *QuotaList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &p.DatabaseName) - delete(rawMsg, key) - case "encryptConnection": - err = unpopulate(val, "EncryptConnection", &p.EncryptConnection) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &p.Password) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &p.Port) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &p.ServerName) - delete(rawMsg, key) - case "trustServerCertificate": - err = unpopulate(val, "TrustServerCertificate", &p.TrustServerCertificate) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "nextLink": + err = unpopulate(val, "NextLink", &q.NextLink) delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &p.UserName) + case "value": + err = unpopulate(val, "Value", &q.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Project. -func (p Project) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QuotaName. +func (q QuotaName) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) + populate(objectMap, "localizedValue", q.LocalizedValue) + populate(objectMap, "value", q.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Project. -func (p *Project) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaName. +func (q *QuotaName) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &q.LocalizedValue) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "value": + err = unpopulate(val, "Value", &q.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProjectFile. -func (p ProjectFile) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegenAuthKeys. +func (r RegenAuthKeys) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "type", p.Type) + populate(objectMap, "authKey1", r.AuthKey1) + populate(objectMap, "authKey2", r.AuthKey2) + populate(objectMap, "keyName", r.KeyName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectFile. -func (p *ProjectFile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegenAuthKeys. +func (r *RegenAuthKeys) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) + case "authKey1": + err = unpopulate(val, "AuthKey1", &r.AuthKey1) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) + case "authKey2": + err = unpopulate(val, "AuthKey2", &r.AuthKey2) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "keyName": + err = unpopulate(val, "KeyName", &r.KeyName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProjectFileProperties. -func (p ProjectFileProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReportableException. +func (r ReportableException) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "extension", p.Extension) - populate(objectMap, "filePath", p.FilePath) - populateDateTimeRFC3339(objectMap, "lastModified", p.LastModified) - populate(objectMap, "mediaType", p.MediaType) - populate(objectMap, "size", p.Size) + populate(objectMap, "actionableMessage", r.ActionableMessage) + populate(objectMap, "filePath", r.FilePath) + populate(objectMap, "hResult", r.HResult) + populate(objectMap, "lineNumber", r.LineNumber) + populate(objectMap, "message", r.Message) + populate(objectMap, "stackTrace", r.StackTrace) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectFileProperties. -func (p *ProjectFileProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ReportableException. +func (r *ReportableException) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "extension": - err = unpopulate(val, "Extension", &p.Extension) + case "actionableMessage": + err = unpopulate(val, "ActionableMessage", &r.ActionableMessage) delete(rawMsg, key) case "filePath": - err = unpopulate(val, "FilePath", &p.FilePath) + err = unpopulate(val, "FilePath", &r.FilePath) delete(rawMsg, key) - case "lastModified": - err = unpopulateDateTimeRFC3339(val, "LastModified", &p.LastModified) + case "hResult": + err = unpopulate(val, "HResult", &r.HResult) delete(rawMsg, key) - case "mediaType": - err = unpopulate(val, "MediaType", &p.MediaType) + case "lineNumber": + err = unpopulate(val, "LineNumber", &r.LineNumber) delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &p.Size) + case "message": + err = unpopulate(val, "Message", &r.Message) + delete(rawMsg, key) + case "stackTrace": + err = unpopulate(val, "StackTrace", &r.StackTrace) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProjectList. -func (p ProjectList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectList. -func (p *ProjectList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProjectMetadata. -func (p ProjectMetadata) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated. +func (r ResourceAutoGenerated) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "selectedMigrationTables", p.SelectedMigrationTables) - populate(objectMap, "sourceServerName", p.SourceServerName) - populate(objectMap, "sourceServerPort", p.SourceServerPort) - populate(objectMap, "sourceUsername", p.SourceUsername) - populate(objectMap, "targetDbName", p.TargetDbName) - populate(objectMap, "targetServerName", p.TargetServerName) - populate(objectMap, "targetUsername", p.TargetUsername) - populate(objectMap, "targetUsingWinAuth", p.TargetUsingWinAuth) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectMetadata. -func (p *ProjectMetadata) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated. +func (r *ResourceAutoGenerated) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "selectedMigrationTables": - err = unpopulate(val, "SelectedMigrationTables", &p.SelectedMigrationTables) - delete(rawMsg, key) - case "sourceServerName": - err = unpopulate(val, "SourceServerName", &p.SourceServerName) - delete(rawMsg, key) - case "sourceServerPort": - err = unpopulate(val, "SourceServerPort", &p.SourceServerPort) - delete(rawMsg, key) - case "sourceUsername": - err = unpopulate(val, "SourceUsername", &p.SourceUsername) - delete(rawMsg, key) - case "targetDbName": - err = unpopulate(val, "TargetDbName", &p.TargetDbName) - delete(rawMsg, key) - case "targetServerName": - err = unpopulate(val, "TargetServerName", &p.TargetServerName) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "targetUsername": - err = unpopulate(val, "TargetUsername", &p.TargetUsername) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "targetUsingWinAuth": - err = unpopulate(val, "TargetUsingWinAuth", &p.TargetUsingWinAuth) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProjectProperties. -func (p ProjectProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "creationTime", p.CreationTime) - populate(objectMap, "databasesInfo", p.DatabasesInfo) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "sourceConnectionInfo", p.SourceConnectionInfo) - populate(objectMap, "sourcePlatform", p.SourcePlatform) - populate(objectMap, "targetConnectionInfo", p.TargetConnectionInfo) - populate(objectMap, "targetPlatform", p.TargetPlatform) +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceSKU. +func (r ResourceSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiVersions", r.APIVersions) + populate(objectMap, "capabilities", r.Capabilities) + populate(objectMap, "capacity", r.Capacity) + populate(objectMap, "costs", r.Costs) + populate(objectMap, "family", r.Family) + populate(objectMap, "kind", r.Kind) + populate(objectMap, "locations", r.Locations) + populate(objectMap, "name", r.Name) + populate(objectMap, "resourceType", r.ResourceType) + populate(objectMap, "restrictions", r.Restrictions) + populate(objectMap, "size", r.Size) + populate(objectMap, "tier", r.Tier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectProperties. -func (p *ProjectProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKU. +func (r *ResourceSKU) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "creationTime": - err = unpopulateDateTimeRFC3339(val, "CreationTime", &p.CreationTime) + case "apiVersions": + err = unpopulate(val, "APIVersions", &r.APIVersions) delete(rawMsg, key) - case "databasesInfo": - err = unpopulate(val, "DatabasesInfo", &p.DatabasesInfo) + case "capabilities": + err = unpopulate(val, "Capabilities", &r.Capabilities) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "capacity": + err = unpopulate(val, "Capacity", &r.Capacity) delete(rawMsg, key) - case "sourceConnectionInfo": - p.SourceConnectionInfo, err = unmarshalConnectionInfoClassification(val) + case "costs": + err = unpopulate(val, "Costs", &r.Costs) delete(rawMsg, key) - case "sourcePlatform": - err = unpopulate(val, "SourcePlatform", &p.SourcePlatform) + case "family": + err = unpopulate(val, "Family", &r.Family) delete(rawMsg, key) - case "targetConnectionInfo": - p.TargetConnectionInfo, err = unmarshalConnectionInfoClassification(val) + case "kind": + err = unpopulate(val, "Kind", &r.Kind) delete(rawMsg, key) - case "targetPlatform": - err = unpopulate(val, "TargetPlatform", &p.TargetPlatform) + case "locations": + err = unpopulate(val, "Locations", &r.Locations) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &r.ResourceType) + delete(rawMsg, key) + case "restrictions": + err = unpopulate(val, "Restrictions", &r.Restrictions) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &r.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &r.Tier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProjectTask. -func (p ProjectTask) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapabilities. +func (r ResourceSKUCapabilities) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "type", p.Type) + populate(objectMap, "name", r.Name) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectTask. -func (p *ProjectTask) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapabilities. +func (r *ResourceSKUCapabilities) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - p.Properties, err = unmarshalProjectTaskPropertiesClassification(val) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProjectTaskProperties. -func (p ProjectTaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapacity. +func (r ResourceSKUCapacity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientData", p.ClientData) - populate(objectMap, "commands", p.Commands) - populate(objectMap, "errors", p.Errors) - populate(objectMap, "state", p.State) - objectMap["taskType"] = p.TaskType + populate(objectMap, "default", r.Default) + populate(objectMap, "maximum", r.Maximum) + populate(objectMap, "minimum", r.Minimum) + populate(objectMap, "scaleType", r.ScaleType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectTaskProperties. -func (p *ProjectTaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapacity. +func (r *ResourceSKUCapacity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "clientData": - err = unpopulate(val, "ClientData", &p.ClientData) - delete(rawMsg, key) - case "commands": - p.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + case "default": + err = unpopulate(val, "Default", &r.Default) delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &p.Errors) + case "maximum": + err = unpopulate(val, "Maximum", &r.Maximum) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &p.State) + case "minimum": + err = unpopulate(val, "Minimum", &r.Minimum) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &p.TaskType) + case "scaleType": + err = unpopulate(val, "ScaleType", &r.ScaleType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QueryAnalysisValidationResult. -func (q QueryAnalysisValidationResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCosts. +func (r ResourceSKUCosts) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "queryResults", q.QueryResults) - populate(objectMap, "validationErrors", q.ValidationErrors) + populate(objectMap, "extendedUnit", r.ExtendedUnit) + populate(objectMap, "meterID", r.MeterID) + populate(objectMap, "quantity", r.Quantity) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryAnalysisValidationResult. -func (q *QueryAnalysisValidationResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCosts. +func (r *ResourceSKUCosts) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "queryResults": - err = unpopulate(val, "QueryResults", &q.QueryResults) + case "extendedUnit": + err = unpopulate(val, "ExtendedUnit", &r.ExtendedUnit) delete(rawMsg, key) - case "validationErrors": - err = unpopulate(val, "ValidationErrors", &q.ValidationErrors) + case "meterID": + err = unpopulate(val, "MeterID", &r.MeterID) + delete(rawMsg, key) + case "quantity": + err = unpopulate(val, "Quantity", &r.Quantity) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QueryExecutionResult. -func (q QueryExecutionResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceSKURestrictions. +func (r ResourceSKURestrictions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "queryText", q.QueryText) - populate(objectMap, "sourceResult", q.SourceResult) - populate(objectMap, "statementsInBatch", q.StatementsInBatch) - populate(objectMap, "targetResult", q.TargetResult) + populate(objectMap, "reasonCode", r.ReasonCode) + populate(objectMap, "type", r.Type) + populate(objectMap, "values", r.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryExecutionResult. -func (q *QueryExecutionResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKURestrictions. +func (r *ResourceSKURestrictions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "queryText": - err = unpopulate(val, "QueryText", &q.QueryText) - delete(rawMsg, key) - case "sourceResult": - err = unpopulate(val, "SourceResult", &q.SourceResult) + case "reasonCode": + err = unpopulate(val, "ReasonCode", &r.ReasonCode) delete(rawMsg, key) - case "statementsInBatch": - err = unpopulate(val, "StatementsInBatch", &q.StatementsInBatch) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) - case "targetResult": - err = unpopulate(val, "TargetResult", &q.TargetResult) + case "values": + err = unpopulate(val, "Values", &r.Values) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Quota. -func (q Quota) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceSKUsResult. +func (r ResourceSKUsResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "currentValue", q.CurrentValue) - populate(objectMap, "id", q.ID) - populate(objectMap, "limit", q.Limit) - populate(objectMap, "name", q.Name) - populate(objectMap, "unit", q.Unit) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Quota. -func (q *Quota) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUsResult. +func (r *ResourceSKUsResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "currentValue": - err = unpopulate(val, "CurrentValue", &q.CurrentValue) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &q.ID) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &q.Limit) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &q.Name) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &q.Unit) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QuotaList. -func (q QuotaList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SQLBackupFileInfo. +func (s SQLBackupFileInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", q.NextLink) - populate(objectMap, "value", q.Value) + populate(objectMap, "copyDuration", s.CopyDuration) + populate(objectMap, "copyThroughput", s.CopyThroughput) + populate(objectMap, "dataRead", s.DataRead) + populate(objectMap, "dataWritten", s.DataWritten) + populate(objectMap, "familySequenceNumber", s.FamilySequenceNumber) + populate(objectMap, "fileName", s.FileName) + populate(objectMap, "status", s.Status) + populate(objectMap, "totalSize", s.TotalSize) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaList. -func (q *QuotaList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLBackupFileInfo. +func (s *SQLBackupFileInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &q.NextLink) + case "copyDuration": + err = unpopulate(val, "CopyDuration", &s.CopyDuration) + delete(rawMsg, key) + case "copyThroughput": + err = unpopulate(val, "CopyThroughput", &s.CopyThroughput) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &q.Value) + case "dataRead": + err = unpopulate(val, "DataRead", &s.DataRead) + delete(rawMsg, key) + case "dataWritten": + err = unpopulate(val, "DataWritten", &s.DataWritten) + delete(rawMsg, key) + case "familySequenceNumber": + err = unpopulate(val, "FamilySequenceNumber", &s.FamilySequenceNumber) + delete(rawMsg, key) + case "fileName": + err = unpopulate(val, "FileName", &s.FileName) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "totalSize": + err = unpopulate(val, "TotalSize", &s.TotalSize) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QuotaName. -func (q QuotaName) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SQLBackupSetInfo. +func (s SQLBackupSetInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "localizedValue", q.LocalizedValue) - populate(objectMap, "value", q.Value) + populateDateTimeRFC3339(objectMap, "backupFinishDate", s.BackupFinishDate) + populate(objectMap, "backupSetId", s.BackupSetID) + populateDateTimeRFC3339(objectMap, "backupStartDate", s.BackupStartDate) + populate(objectMap, "backupType", s.BackupType) + populate(objectMap, "familyCount", s.FamilyCount) + populate(objectMap, "firstLSN", s.FirstLSN) + populate(objectMap, "hasBackupChecksums", s.HasBackupChecksums) + populate(objectMap, "ignoreReasons", s.IgnoreReasons) + populate(objectMap, "isBackupRestored", s.IsBackupRestored) + populate(objectMap, "lastLSN", s.LastLSN) + populate(objectMap, "listOfBackupFiles", s.ListOfBackupFiles) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaName. -func (q *QuotaName) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLBackupSetInfo. +func (s *SQLBackupSetInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "localizedValue": - err = unpopulate(val, "LocalizedValue", &q.LocalizedValue) + case "backupFinishDate": + err = unpopulateDateTimeRFC3339(val, "BackupFinishDate", &s.BackupFinishDate) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &q.Value) + case "backupSetId": + err = unpopulate(val, "BackupSetID", &s.BackupSetID) + delete(rawMsg, key) + case "backupStartDate": + err = unpopulateDateTimeRFC3339(val, "BackupStartDate", &s.BackupStartDate) + delete(rawMsg, key) + case "backupType": + err = unpopulate(val, "BackupType", &s.BackupType) + delete(rawMsg, key) + case "familyCount": + err = unpopulate(val, "FamilyCount", &s.FamilyCount) + delete(rawMsg, key) + case "firstLSN": + err = unpopulate(val, "FirstLSN", &s.FirstLSN) + delete(rawMsg, key) + case "hasBackupChecksums": + err = unpopulate(val, "HasBackupChecksums", &s.HasBackupChecksums) + delete(rawMsg, key) + case "ignoreReasons": + err = unpopulate(val, "IgnoreReasons", &s.IgnoreReasons) + delete(rawMsg, key) + case "isBackupRestored": + err = unpopulate(val, "IsBackupRestored", &s.IsBackupRestored) + delete(rawMsg, key) + case "lastLSN": + err = unpopulate(val, "LastLSN", &s.LastLSN) + delete(rawMsg, key) + case "listOfBackupFiles": + err = unpopulate(val, "ListOfBackupFiles", &s.ListOfBackupFiles) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ReportableException. -func (r ReportableException) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SQLConnectionInfo. +func (s SQLConnectionInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actionableMessage", r.ActionableMessage) - populate(objectMap, "filePath", r.FilePath) - populate(objectMap, "hResult", r.HResult) - populate(objectMap, "lineNumber", r.LineNumber) - populate(objectMap, "message", r.Message) - populate(objectMap, "stackTrace", r.StackTrace) + populate(objectMap, "additionalSettings", s.AdditionalSettings) + populate(objectMap, "authentication", s.Authentication) + populate(objectMap, "dataSource", s.DataSource) + populate(objectMap, "encryptConnection", s.EncryptConnection) + populate(objectMap, "password", s.Password) + populate(objectMap, "platform", s.Platform) + populate(objectMap, "port", s.Port) + populate(objectMap, "resourceId", s.ResourceID) + populate(objectMap, "serverBrandVersion", s.ServerBrandVersion) + populate(objectMap, "serverName", s.ServerName) + populate(objectMap, "serverVersion", s.ServerVersion) + populate(objectMap, "trustServerCertificate", s.TrustServerCertificate) + objectMap["type"] = "SqlConnectionInfo" + populate(objectMap, "userName", s.UserName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReportableException. -func (r *ReportableException) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLConnectionInfo. +func (s *SQLConnectionInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "actionableMessage": - err = unpopulate(val, "ActionableMessage", &r.ActionableMessage) + case "additionalSettings": + err = unpopulate(val, "AdditionalSettings", &s.AdditionalSettings) delete(rawMsg, key) - case "filePath": - err = unpopulate(val, "FilePath", &r.FilePath) + case "authentication": + err = unpopulate(val, "Authentication", &s.Authentication) delete(rawMsg, key) - case "hResult": - err = unpopulate(val, "HResult", &r.HResult) + case "dataSource": + err = unpopulate(val, "DataSource", &s.DataSource) delete(rawMsg, key) - case "lineNumber": - err = unpopulate(val, "LineNumber", &r.LineNumber) + case "encryptConnection": + err = unpopulate(val, "EncryptConnection", &s.EncryptConnection) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &r.Message) + case "password": + err = unpopulate(val, "Password", &s.Password) delete(rawMsg, key) - case "stackTrace": - err = unpopulate(val, "StackTrace", &r.StackTrace) + case "platform": + err = unpopulate(val, "Platform", &s.Platform) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &s.Port) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &s.ResourceID) + delete(rawMsg, key) + case "serverBrandVersion": + err = unpopulate(val, "ServerBrandVersion", &s.ServerBrandVersion) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &s.ServerName) + delete(rawMsg, key) + case "serverVersion": + err = unpopulate(val, "ServerVersion", &s.ServerVersion) + delete(rawMsg, key) + case "trustServerCertificate": + err = unpopulate(val, "TrustServerCertificate", &s.TrustServerCertificate) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &s.UserName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SQLConnectionInformation. +func (s SQLConnectionInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) + populate(objectMap, "authentication", s.Authentication) + populate(objectMap, "dataSource", s.DataSource) + populate(objectMap, "encryptConnection", s.EncryptConnection) + populate(objectMap, "password", s.Password) + populate(objectMap, "trustServerCertificate", s.TrustServerCertificate) + populate(objectMap, "userName", s.UserName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLConnectionInformation. +func (s *SQLConnectionInformation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) + case "authentication": + err = unpopulate(val, "Authentication", &s.Authentication) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "dataSource": + err = unpopulate(val, "DataSource", &s.DataSource) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "encryptConnection": + err = unpopulate(val, "EncryptConnection", &s.EncryptConnection) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &s.Password) + delete(rawMsg, key) + case "trustServerCertificate": + err = unpopulate(val, "TrustServerCertificate", &s.TrustServerCertificate) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &s.UserName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceSKU. -func (r ResourceSKU) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SQLDbMigrationStatusDetails. +func (s SQLDbMigrationStatusDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "apiVersions", r.APIVersions) - populate(objectMap, "capabilities", r.Capabilities) - populate(objectMap, "capacity", r.Capacity) - populate(objectMap, "costs", r.Costs) - populate(objectMap, "family", r.Family) - populate(objectMap, "kind", r.Kind) - populate(objectMap, "locations", r.Locations) - populate(objectMap, "name", r.Name) - populate(objectMap, "resourceType", r.ResourceType) - populate(objectMap, "restrictions", r.Restrictions) - populate(objectMap, "size", r.Size) - populate(objectMap, "tier", r.Tier) + populate(objectMap, "listOfCopyProgressDetails", s.ListOfCopyProgressDetails) + populate(objectMap, "migrationState", s.MigrationState) + populate(objectMap, "sqlDataCopyErrors", s.SQLDataCopyErrors) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKU. -func (r *ResourceSKU) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDbMigrationStatusDetails. +func (s *SQLDbMigrationStatusDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "apiVersions": - err = unpopulate(val, "APIVersions", &r.APIVersions) - delete(rawMsg, key) - case "capabilities": - err = unpopulate(val, "Capabilities", &r.Capabilities) - delete(rawMsg, key) - case "capacity": - err = unpopulate(val, "Capacity", &r.Capacity) - delete(rawMsg, key) - case "costs": - err = unpopulate(val, "Costs", &r.Costs) - delete(rawMsg, key) - case "family": - err = unpopulate(val, "Family", &r.Family) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &r.Kind) - delete(rawMsg, key) - case "locations": - err = unpopulate(val, "Locations", &r.Locations) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &r.ResourceType) + case "listOfCopyProgressDetails": + err = unpopulate(val, "ListOfCopyProgressDetails", &s.ListOfCopyProgressDetails) delete(rawMsg, key) - case "restrictions": - err = unpopulate(val, "Restrictions", &r.Restrictions) - delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &r.Size) + case "migrationState": + err = unpopulate(val, "MigrationState", &s.MigrationState) delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &r.Tier) + case "sqlDataCopyErrors": + err = unpopulate(val, "SQLDataCopyErrors", &s.SQLDataCopyErrors) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapabilities. -func (r ResourceSKUCapabilities) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SQLDbOfflineConfiguration. +func (s SQLDbOfflineConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", r.Name) - populate(objectMap, "value", r.Value) + populate(objectMap, "offline", s.Offline) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapabilities. -func (r *ResourceSKUCapabilities) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDbOfflineConfiguration. +func (s *SQLDbOfflineConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "offline": + err = unpopulate(val, "Offline", &s.Offline) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapacity. -func (r ResourceSKUCapacity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SQLFileShare. +func (s SQLFileShare) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "default", r.Default) - populate(objectMap, "maximum", r.Maximum) - populate(objectMap, "minimum", r.Minimum) - populate(objectMap, "scaleType", r.ScaleType) + populate(objectMap, "password", s.Password) + populate(objectMap, "path", s.Path) + populate(objectMap, "username", s.Username) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapacity. -func (r *ResourceSKUCapacity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLFileShare. +func (s *SQLFileShare) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "default": - err = unpopulate(val, "Default", &r.Default) - delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &r.Maximum) + case "password": + err = unpopulate(val, "Password", &s.Password) delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &r.Minimum) + case "path": + err = unpopulate(val, "Path", &s.Path) delete(rawMsg, key) - case "scaleType": - err = unpopulate(val, "ScaleType", &r.ScaleType) + case "username": + err = unpopulate(val, "Username", &s.Username) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCosts. -func (r ResourceSKUCosts) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SQLMigrationListResult. +func (s SQLMigrationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "extendedUnit", r.ExtendedUnit) - populate(objectMap, "meterID", r.MeterID) - populate(objectMap, "quantity", r.Quantity) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCosts. -func (r *ResourceSKUCosts) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLMigrationListResult. +func (s *SQLMigrationListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "extendedUnit": - err = unpopulate(val, "ExtendedUnit", &r.ExtendedUnit) - delete(rawMsg, key) - case "meterID": - err = unpopulate(val, "MeterID", &r.MeterID) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "quantity": - err = unpopulate(val, "Quantity", &r.Quantity) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceSKURestrictions. -func (r ResourceSKURestrictions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SQLMigrationService. +func (s SQLMigrationService) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "reasonCode", r.ReasonCode) - populate(objectMap, "type", r.Type) - populate(objectMap, "values", r.Values) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKURestrictions. -func (r *ResourceSKURestrictions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLMigrationService. +func (s *SQLMigrationService) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "reasonCode": - err = unpopulate(val, "ReasonCode", &r.ReasonCode) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "location": + err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &r.Values) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceSKUsResult. -func (r ResourceSKUsResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SQLMigrationServiceProperties. +func (s SQLMigrationServiceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) + populate(objectMap, "integrationRuntimeState", s.IntegrationRuntimeState) + populate(objectMap, "provisioningState", s.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUsResult. -func (r *ResourceSKUsResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLMigrationServiceProperties. +func (s *SQLMigrationServiceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) + case "integrationRuntimeState": + err = unpopulate(val, "IntegrationRuntimeState", &s.IntegrationRuntimeState) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SQLConnectionInfo. -func (s SQLConnectionInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SQLMigrationServiceUpdate. +func (s SQLMigrationServiceUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "additionalSettings", s.AdditionalSettings) - populate(objectMap, "authentication", s.Authentication) - populate(objectMap, "dataSource", s.DataSource) - populate(objectMap, "encryptConnection", s.EncryptConnection) - populate(objectMap, "password", s.Password) - populate(objectMap, "platform", s.Platform) - populate(objectMap, "trustServerCertificate", s.TrustServerCertificate) - objectMap["type"] = "SqlConnectionInfo" - populate(objectMap, "userName", s.UserName) + populate(objectMap, "tags", s.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SQLConnectionInfo. -func (s *SQLConnectionInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLMigrationServiceUpdate. +func (s *SQLMigrationServiceUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -11060,32 +13703,8 @@ func (s *SQLConnectionInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "additionalSettings": - err = unpopulate(val, "AdditionalSettings", &s.AdditionalSettings) - delete(rawMsg, key) - case "authentication": - err = unpopulate(val, "Authentication", &s.Authentication) - delete(rawMsg, key) - case "dataSource": - err = unpopulate(val, "DataSource", &s.DataSource) - delete(rawMsg, key) - case "encryptConnection": - err = unpopulate(val, "EncryptConnection", &s.EncryptConnection) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &s.Password) - delete(rawMsg, key) - case "platform": - err = unpopulate(val, "Platform", &s.Platform) - delete(rawMsg, key) - case "trustServerCertificate": - err = unpopulate(val, "TrustServerCertificate", &s.TrustServerCertificate) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &s.UserName) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) delete(rawMsg, key) } if err != nil { @@ -11251,6 +13870,7 @@ func (s *SchemaComparisonValidationResultType) UnmarshalJSON(data []byte) error func (s SchemaMigrationSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "fileId", s.FileID) + populate(objectMap, "fileName", s.FileName) populate(objectMap, "schemaOption", s.SchemaOption) return json.Marshal(objectMap) } @@ -11267,6 +13887,9 @@ func (s *SchemaMigrationSetting) UnmarshalJSON(data []byte) error { case "fileId": err = unpopulate(val, "FileID", &s.FileID) delete(rawMsg, key) + case "fileName": + err = unpopulate(val, "FileName", &s.FileName) + delete(rawMsg, key) case "schemaOption": err = unpopulate(val, "SchemaOption", &s.SchemaOption) delete(rawMsg, key) @@ -11554,6 +14177,8 @@ func (s *ServiceOperationList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServiceProperties. func (s ServiceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "autoStopDelay", s.AutoStopDelay) + populate(objectMap, "deleteResourcesOnStop", s.DeleteResourcesOnStop) populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "publicKey", s.PublicKey) populate(objectMap, "virtualNicId", s.VirtualNicID) @@ -11570,6 +14195,12 @@ func (s *ServiceProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "autoStopDelay": + err = unpopulate(val, "AutoStopDelay", &s.AutoStopDelay) + delete(rawMsg, key) + case "deleteResourcesOnStop": + err = unpopulate(val, "DeleteResourcesOnStop", &s.DeleteResourcesOnStop) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) @@ -11667,6 +14298,7 @@ func (s *ServiceSKUList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServiceStatusResponse. func (s ServiceStatusResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populateAny(objectMap, "agentConfiguration", s.AgentConfiguration) populate(objectMap, "agentVersion", s.AgentVersion) populate(objectMap, "status", s.Status) populate(objectMap, "supportedTaskTypes", s.SupportedTaskTypes) @@ -11683,6 +14315,9 @@ func (s *ServiceStatusResponse) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "agentConfiguration": + err = unpopulate(val, "AgentConfiguration", &s.AgentConfiguration) + delete(rawMsg, key) case "agentVersion": err = unpopulate(val, "AgentVersion", &s.AgentVersion) delete(rawMsg, key) @@ -11703,6 +14338,41 @@ func (s *ServiceStatusResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SourceLocation. +func (s SourceLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureBlob", s.AzureBlob) + populate(objectMap, "fileShare", s.FileShare) + populate(objectMap, "fileStorageType", s.FileStorageType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SourceLocation. +func (s *SourceLocation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureBlob": + err = unpopulate(val, "AzureBlob", &s.AzureBlob) + delete(rawMsg, key) + case "fileShare": + err = unpopulate(val, "FileShare", &s.FileShare) + delete(rawMsg, key) + case "fileStorageType": + err = unpopulate(val, "FileStorageType", &s.FileStorageType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SsisMigrationInfo. func (s SsisMigrationInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -11855,6 +14525,84 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SystemDataAutoGenerated. +func (s SystemDataAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemDataAutoGenerated. +func (s *SystemDataAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TargetLocation. +func (t TargetLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountKey", t.AccountKey) + populate(objectMap, "storageAccountResourceId", t.StorageAccountResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TargetLocation. +func (t *TargetLocation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accountKey": + err = unpopulate(val, "AccountKey", &t.AccountKey) + delete(rawMsg, key) + case "storageAccountResourceId": + err = unpopulate(val, "StorageAccountResourceID", &t.StorageAccountResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TaskList. func (t TaskList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -11933,6 +14681,53 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TrackedResourceAutoGenerated. +func (t TrackedResourceAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResourceAutoGenerated. +func (t *TrackedResourceAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type UploadOCIDriverTaskInput. func (u UploadOCIDriverTaskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -12000,7 +14795,7 @@ func (u UploadOCIDriverTaskProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "input", u.Input) populate(objectMap, "output", u.Output) populate(objectMap, "state", u.State) - objectMap["taskType"] = "Service.Upload.OCI" + objectMap["taskType"] = TaskTypeServiceUploadOCI return json.Marshal(objectMap) } @@ -12051,7 +14846,7 @@ func (v ValidateMigrationInputSQLServerSQLDbSyncTaskProperties) MarshalJSON() ([ populate(objectMap, "input", v.Input) populate(objectMap, "output", v.Output) populate(objectMap, "state", v.State) - objectMap["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + objectMap["taskType"] = TaskTypeValidateMigrationInputSQLServerSQLDbSync return json.Marshal(objectMap) } @@ -12184,7 +14979,7 @@ func (v ValidateMigrationInputSQLServerSQLMISyncTaskProperties) MarshalJSON() ([ populate(objectMap, "input", v.Input) populate(objectMap, "output", v.Output) populate(objectMap, "state", v.State) - objectMap["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + objectMap["taskType"] = TaskTypeValidateMigrationInputSQLServerAzureSQLDbMISyncLRS return json.Marshal(objectMap) } @@ -12341,7 +15136,7 @@ func (v ValidateMigrationInputSQLServerSQLMITaskProperties) MarshalJSON() ([]byt populate(objectMap, "input", v.Input) populate(objectMap, "output", v.Output) populate(objectMap, "state", v.State) - objectMap["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + objectMap["taskType"] = TaskTypeValidateMigrationInputSQLServerAzureSQLDbMI return json.Marshal(objectMap) } @@ -12392,7 +15187,7 @@ func (v ValidateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "input", v.Input) populate(objectMap, "output", v.Output) populate(objectMap, "state", v.State) - objectMap["taskType"] = "Validate.MongoDb" + objectMap["taskType"] = TaskTypeValidateMongoDb return json.Marshal(objectMap) } @@ -12443,7 +15238,7 @@ func (v ValidateOracleAzureDbForPostgreSQLSyncTaskProperties) MarshalJSON() ([]b populate(objectMap, "input", v.Input) populate(objectMap, "output", v.Output) populate(objectMap, "state", v.State) - objectMap["taskType"] = "Validate.Oracle.AzureDbPostgreSql.Sync" + objectMap["taskType"] = TaskTypeValidateOracleAzureDbPostgreSQLSync return json.Marshal(objectMap) } @@ -12658,8 +15453,18 @@ func populate(m map[string]any, k string, v any) { } } +func populateAny(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else { + m[k] = v + } +} + func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/datamigration/armdatamigration/operations_client.go b/sdk/resourcemanager/datamigration/armdatamigration/operations_client.go index 61a0b29cdafb..693349e9a2d0 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/operations_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/operations_client.go @@ -37,9 +37,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// NewListPager - Lists all available actions exposed by the Database Migration Service resource provider. +// NewListPager - Lists all of the available SQL Migration REST API operations. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -81,7 +81,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { result := OperationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceOperationList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return OperationsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/datamigration/armdatamigration/operations_client_example_test.go b/sdk/resourcemanager/datamigration/armdatamigration/operations_client_example_test.go deleted file mode 100644 index 5589470e390f..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/operations_client_example_test.go +++ /dev/null @@ -1,55 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdatamigration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceOperationList = armdatamigration.ServiceOperationList{ - // Value: []*armdatamigration.ServiceOperation{ - // { - // Name: to.Ptr("Microsoft.DataMigration/services/read"), - // Display: &armdatamigration.ServiceOperationDisplay{ - // Description: to.Ptr("Read information about services."), - // Operation: to.Ptr("Read"), - // Provider: to.Ptr("Database Migration Service"), - // Resource: to.Ptr("Database Migration Service"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/options.go b/sdk/resourcemanager/datamigration/armdatamigration/options.go index 74eeec747f98..91256cf609bf 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/options.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/options.go @@ -8,6 +8,163 @@ package armdatamigration +// DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginCreateOptions contains the optional parameters for the DatabaseMigrationsMongoToCosmosDbRUMongoClient.BeginCreate +// method. +type DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginDeleteOptions contains the optional parameters for the DatabaseMigrationsMongoToCosmosDbRUMongoClient.BeginDelete +// method. +type DatabaseMigrationsMongoToCosmosDbRUMongoClientBeginDeleteOptions struct { + // Optional force delete boolean. If this is provided as true, migration will be deleted even if active. + Force *bool + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeOptions contains the optional parameters for the DatabaseMigrationsMongoToCosmosDbRUMongoClient.NewGetForScopePager +// method. +type DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeOptions struct { + // placeholder for future optional parameters +} + +// DatabaseMigrationsMongoToCosmosDbRUMongoClientGetOptions contains the optional parameters for the DatabaseMigrationsMongoToCosmosDbRUMongoClient.Get +// method. +type DatabaseMigrationsMongoToCosmosDbRUMongoClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginCreateOptions contains the optional parameters for the DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.BeginCreate +// method. +type DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginDeleteOptions contains the optional parameters for the DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.BeginDelete +// method. +type DatabaseMigrationsMongoToCosmosDbvCoreMongoClientBeginDeleteOptions struct { + // Optional force delete boolean. If this is provided as true, migration will be deleted even if active. + Force *bool + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeOptions contains the optional parameters for the DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.NewGetForScopePager +// method. +type DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeOptions struct { + // placeholder for future optional parameters +} + +// DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetOptions contains the optional parameters for the DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.Get +// method. +type DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseMigrationsSQLDbClientBeginCancelOptions contains the optional parameters for the DatabaseMigrationsSQLDbClient.BeginCancel +// method. +type DatabaseMigrationsSQLDbClientBeginCancelOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseMigrationsSQLDbClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseMigrationsSQLDbClient.BeginCreateOrUpdate +// method. +type DatabaseMigrationsSQLDbClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseMigrationsSQLDbClientBeginDeleteOptions contains the optional parameters for the DatabaseMigrationsSQLDbClient.BeginDelete +// method. +type DatabaseMigrationsSQLDbClientBeginDeleteOptions struct { + // Optional force delete boolean. If this is provided as true, migration will be deleted even if active. + Force *bool + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseMigrationsSQLDbClientGetOptions contains the optional parameters for the DatabaseMigrationsSQLDbClient.Get method. +type DatabaseMigrationsSQLDbClientGetOptions struct { + // Complete migration details be included in the response. + Expand *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 *string +} + +// DatabaseMigrationsSQLMiClientBeginCancelOptions contains the optional parameters for the DatabaseMigrationsSQLMiClient.BeginCancel +// method. +type DatabaseMigrationsSQLMiClientBeginCancelOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseMigrationsSQLMiClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseMigrationsSQLMiClient.BeginCreateOrUpdate +// method. +type DatabaseMigrationsSQLMiClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseMigrationsSQLMiClientBeginCutoverOptions contains the optional parameters for the DatabaseMigrationsSQLMiClient.BeginCutover +// method. +type DatabaseMigrationsSQLMiClientBeginCutoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseMigrationsSQLMiClientGetOptions contains the optional parameters for the DatabaseMigrationsSQLMiClient.Get method. +type DatabaseMigrationsSQLMiClientGetOptions struct { + // Complete migration details be included in the response. + Expand *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 *string +} + +// DatabaseMigrationsSQLVMClientBeginCancelOptions contains the optional parameters for the DatabaseMigrationsSQLVMClient.BeginCancel +// method. +type DatabaseMigrationsSQLVMClientBeginCancelOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseMigrationsSQLVMClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseMigrationsSQLVMClient.BeginCreateOrUpdate +// method. +type DatabaseMigrationsSQLVMClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseMigrationsSQLVMClientBeginCutoverOptions contains the optional parameters for the DatabaseMigrationsSQLVMClient.BeginCutover +// method. +type DatabaseMigrationsSQLVMClientBeginCutoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseMigrationsSQLVMClientGetOptions contains the optional parameters for the DatabaseMigrationsSQLVMClient.Get method. +type DatabaseMigrationsSQLVMClientGetOptions struct { + // Complete migration details be included in the response. + Expand *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 *string +} + // FilesClientCreateOrUpdateOptions contains the optional parameters for the FilesClient.CreateOrUpdate method. type FilesClientCreateOrUpdateOptions struct { // placeholder for future optional parameters @@ -43,6 +200,50 @@ type FilesClientUpdateOptions struct { // placeholder for future optional parameters } +// MigrationServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the MigrationServicesClient.BeginCreateOrUpdate +// method. +type MigrationServicesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MigrationServicesClientBeginDeleteOptions contains the optional parameters for the MigrationServicesClient.BeginDelete +// method. +type MigrationServicesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MigrationServicesClientBeginUpdateOptions contains the optional parameters for the MigrationServicesClient.BeginUpdate +// method. +type MigrationServicesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MigrationServicesClientGetOptions contains the optional parameters for the MigrationServicesClient.Get method. +type MigrationServicesClientGetOptions struct { + // placeholder for future optional parameters +} + +// MigrationServicesClientListByResourceGroupOptions contains the optional parameters for the MigrationServicesClient.NewListByResourceGroupPager +// method. +type MigrationServicesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// MigrationServicesClientListBySubscriptionOptions contains the optional parameters for the MigrationServicesClient.NewListBySubscriptionPager +// method. +type MigrationServicesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// MigrationServicesClientListMigrationsOptions contains the optional parameters for the MigrationServicesClient.NewListMigrationsPager +// method. +type MigrationServicesClientListMigrationsOptions struct { + // placeholder for future optional parameters +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters @@ -79,6 +280,74 @@ type ResourceSKUsClientListSKUsOptions struct { // placeholder for future optional parameters } +// SQLMigrationServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the SQLMigrationServicesClient.BeginCreateOrUpdate +// method. +type SQLMigrationServicesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SQLMigrationServicesClientBeginDeleteOptions contains the optional parameters for the SQLMigrationServicesClient.BeginDelete +// method. +type SQLMigrationServicesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SQLMigrationServicesClientBeginUpdateOptions contains the optional parameters for the SQLMigrationServicesClient.BeginUpdate +// method. +type SQLMigrationServicesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SQLMigrationServicesClientDeleteNodeOptions contains the optional parameters for the SQLMigrationServicesClient.DeleteNode +// method. +type SQLMigrationServicesClientDeleteNodeOptions struct { + // placeholder for future optional parameters +} + +// SQLMigrationServicesClientGetOptions contains the optional parameters for the SQLMigrationServicesClient.Get method. +type SQLMigrationServicesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SQLMigrationServicesClientListAuthKeysOptions contains the optional parameters for the SQLMigrationServicesClient.ListAuthKeys +// method. +type SQLMigrationServicesClientListAuthKeysOptions struct { + // placeholder for future optional parameters +} + +// SQLMigrationServicesClientListByResourceGroupOptions contains the optional parameters for the SQLMigrationServicesClient.NewListByResourceGroupPager +// method. +type SQLMigrationServicesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// SQLMigrationServicesClientListBySubscriptionOptions contains the optional parameters for the SQLMigrationServicesClient.NewListBySubscriptionPager +// method. +type SQLMigrationServicesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// SQLMigrationServicesClientListMigrationsOptions contains the optional parameters for the SQLMigrationServicesClient.NewListMigrationsPager +// method. +type SQLMigrationServicesClientListMigrationsOptions struct { + // placeholder for future optional parameters +} + +// SQLMigrationServicesClientListMonitoringDataOptions contains the optional parameters for the SQLMigrationServicesClient.ListMonitoringData +// method. +type SQLMigrationServicesClientListMonitoringDataOptions struct { + // placeholder for future optional parameters +} + +// SQLMigrationServicesClientRegenerateAuthKeysOptions contains the optional parameters for the SQLMigrationServicesClient.RegenerateAuthKeys +// method. +type SQLMigrationServicesClientRegenerateAuthKeysOptions struct { + // placeholder for future optional parameters +} + // ServiceTasksClientCancelOptions contains the optional parameters for the ServiceTasksClient.Cancel method. type ServiceTasksClientCancelOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/datamigration/armdatamigration/polymorphic_helpers.go b/sdk/resourcemanager/datamigration/armdatamigration/polymorphic_helpers.go index 47c81a0290b7..ee49002255a1 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/polymorphic_helpers.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/polymorphic_helpers.go @@ -11,7 +11,7 @@ package armdatamigration import "encoding/json" func unmarshalCommandPropertiesClassification(rawMsg json.RawMessage) (CommandPropertiesClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -20,15 +20,15 @@ func unmarshalCommandPropertiesClassification(rawMsg json.RawMessage) (CommandPr } var b CommandPropertiesClassification switch m["commandType"] { - case "Migrate.SqlServer.AzureDbSqlMi.Complete": + case string(CommandTypeMigrateSQLServerAzureDbSQLMiComplete): b = &MigrateMISyncCompleteCommandProperties{} - case "Migrate.Sync.Complete.Database": + case string(CommandTypeMigrateSyncCompleteDatabase): b = &MigrateSyncCompleteCommandProperties{} - case "cancel": + case string(CommandTypeCancel): b = &MongoDbCancelCommand{} - case "finish": + case string(CommandTypeFinish): b = &MongoDbFinishCommand{} - case "restart": + case string(CommandTypeRestart): b = &MongoDbRestartCommand{} default: b = &CommandProperties{} @@ -40,7 +40,7 @@ func unmarshalCommandPropertiesClassification(rawMsg json.RawMessage) (CommandPr } func unmarshalCommandPropertiesClassificationArray(rawMsg json.RawMessage) ([]CommandPropertiesClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages []json.RawMessage @@ -59,7 +59,7 @@ func unmarshalCommandPropertiesClassificationArray(rawMsg json.RawMessage) ([]Co } func unmarshalConnectToSourceSQLServerTaskOutputClassification(rawMsg json.RawMessage) (ConnectToSourceSQLServerTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -86,7 +86,7 @@ func unmarshalConnectToSourceSQLServerTaskOutputClassification(rawMsg json.RawMe } func unmarshalConnectToSourceSQLServerTaskOutputClassificationArray(rawMsg json.RawMessage) ([]ConnectToSourceSQLServerTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages []json.RawMessage @@ -105,7 +105,7 @@ func unmarshalConnectToSourceSQLServerTaskOutputClassificationArray(rawMsg json. } func unmarshalConnectionInfoClassification(rawMsg json.RawMessage) (ConnectionInfoClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -135,8 +135,62 @@ func unmarshalConnectionInfoClassification(rawMsg json.RawMessage) (ConnectionIn return b, nil } +func unmarshalDatabaseMigrationBasePropertiesClassification(rawMsg json.RawMessage) (DatabaseMigrationBasePropertiesClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b DatabaseMigrationBasePropertiesClassification + switch m["kind"] { + case "DatabaseMigrationProperties": + b = &DatabaseMigrationProperties{} + case string(ResourceTypeMongoToCosmosDbMongo): + b = &DatabaseMigrationPropertiesCosmosDbMongo{} + case string(ResourceTypeSQLDb): + b = &DatabaseMigrationPropertiesSQLDb{} + case string(ResourceTypeSQLMi): + b = &DatabaseMigrationPropertiesSQLMi{} + case string(ResourceTypeSQLVM): + b = &DatabaseMigrationPropertiesSQLVM{} + default: + b = &DatabaseMigrationBaseProperties{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalDatabaseMigrationPropertiesClassification(rawMsg json.RawMessage) (DatabaseMigrationPropertiesClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b DatabaseMigrationPropertiesClassification + switch m["kind"] { + case string(ResourceTypeSQLDb): + b = &DatabaseMigrationPropertiesSQLDb{} + case string(ResourceTypeSQLMi): + b = &DatabaseMigrationPropertiesSQLMi{} + case string(ResourceTypeSQLVM): + b = &DatabaseMigrationPropertiesSQLVM{} + default: + b = &DatabaseMigrationProperties{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + func unmarshalMigrateMySQLAzureDbForMySQLOfflineTaskOutputClassification(rawMsg json.RawMessage) (MigrateMySQLAzureDbForMySQLOfflineTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -163,7 +217,7 @@ func unmarshalMigrateMySQLAzureDbForMySQLOfflineTaskOutputClassification(rawMsg } func unmarshalMigrateMySQLAzureDbForMySQLOfflineTaskOutputClassificationArray(rawMsg json.RawMessage) ([]MigrateMySQLAzureDbForMySQLOfflineTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages []json.RawMessage @@ -182,7 +236,7 @@ func unmarshalMigrateMySQLAzureDbForMySQLOfflineTaskOutputClassificationArray(ra } func unmarshalMigrateMySQLAzureDbForMySQLSyncTaskOutputClassification(rawMsg json.RawMessage) (MigrateMySQLAzureDbForMySQLSyncTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -211,7 +265,7 @@ func unmarshalMigrateMySQLAzureDbForMySQLSyncTaskOutputClassification(rawMsg jso } func unmarshalMigrateMySQLAzureDbForMySQLSyncTaskOutputClassificationArray(rawMsg json.RawMessage) ([]MigrateMySQLAzureDbForMySQLSyncTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages []json.RawMessage @@ -230,7 +284,7 @@ func unmarshalMigrateMySQLAzureDbForMySQLSyncTaskOutputClassificationArray(rawMs } func unmarshalMigrateOracleAzureDbPostgreSQLSyncTaskOutputClassification(rawMsg json.RawMessage) (MigrateOracleAzureDbPostgreSQLSyncTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -259,7 +313,7 @@ func unmarshalMigrateOracleAzureDbPostgreSQLSyncTaskOutputClassification(rawMsg } func unmarshalMigrateOracleAzureDbPostgreSQLSyncTaskOutputClassificationArray(rawMsg json.RawMessage) ([]MigrateOracleAzureDbPostgreSQLSyncTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages []json.RawMessage @@ -278,7 +332,7 @@ func unmarshalMigrateOracleAzureDbPostgreSQLSyncTaskOutputClassificationArray(ra } func unmarshalMigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputClassification(rawMsg json.RawMessage) (MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -307,7 +361,7 @@ func unmarshalMigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputClassification( } func unmarshalMigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputClassificationArray(rawMsg json.RawMessage) ([]MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages []json.RawMessage @@ -326,7 +380,7 @@ func unmarshalMigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputClassificationA } func unmarshalMigrateSQLServerSQLDbSyncTaskOutputClassification(rawMsg json.RawMessage) (MigrateSQLServerSQLDbSyncTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -355,7 +409,7 @@ func unmarshalMigrateSQLServerSQLDbSyncTaskOutputClassification(rawMsg json.RawM } func unmarshalMigrateSQLServerSQLDbSyncTaskOutputClassificationArray(rawMsg json.RawMessage) ([]MigrateSQLServerSQLDbSyncTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages []json.RawMessage @@ -374,7 +428,7 @@ func unmarshalMigrateSQLServerSQLDbSyncTaskOutputClassificationArray(rawMsg json } func unmarshalMigrateSQLServerSQLDbTaskOutputClassification(rawMsg json.RawMessage) (MigrateSQLServerSQLDbTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -405,7 +459,7 @@ func unmarshalMigrateSQLServerSQLDbTaskOutputClassification(rawMsg json.RawMessa } func unmarshalMigrateSQLServerSQLDbTaskOutputClassificationArray(rawMsg json.RawMessage) ([]MigrateSQLServerSQLDbTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages []json.RawMessage @@ -424,7 +478,7 @@ func unmarshalMigrateSQLServerSQLDbTaskOutputClassificationArray(rawMsg json.Raw } func unmarshalMigrateSQLServerSQLMISyncTaskOutputClassification(rawMsg json.RawMessage) (MigrateSQLServerSQLMISyncTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -449,7 +503,7 @@ func unmarshalMigrateSQLServerSQLMISyncTaskOutputClassification(rawMsg json.RawM } func unmarshalMigrateSQLServerSQLMISyncTaskOutputClassificationArray(rawMsg json.RawMessage) ([]MigrateSQLServerSQLMISyncTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages []json.RawMessage @@ -468,7 +522,7 @@ func unmarshalMigrateSQLServerSQLMISyncTaskOutputClassificationArray(rawMsg json } func unmarshalMigrateSQLServerSQLMITaskOutputClassification(rawMsg json.RawMessage) (MigrateSQLServerSQLMITaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -497,7 +551,7 @@ func unmarshalMigrateSQLServerSQLMITaskOutputClassification(rawMsg json.RawMessa } func unmarshalMigrateSQLServerSQLMITaskOutputClassificationArray(rawMsg json.RawMessage) ([]MigrateSQLServerSQLMITaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages []json.RawMessage @@ -516,7 +570,7 @@ func unmarshalMigrateSQLServerSQLMITaskOutputClassificationArray(rawMsg json.Raw } func unmarshalMigrateSchemaSQLServerSQLDbTaskOutputClassification(rawMsg json.RawMessage) (MigrateSchemaSQLServerSQLDbTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -543,7 +597,7 @@ func unmarshalMigrateSchemaSQLServerSQLDbTaskOutputClassification(rawMsg json.Ra } func unmarshalMigrateSchemaSQLServerSQLDbTaskOutputClassificationArray(rawMsg json.RawMessage) ([]MigrateSchemaSQLServerSQLDbTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages []json.RawMessage @@ -562,7 +616,7 @@ func unmarshalMigrateSchemaSQLServerSQLDbTaskOutputClassificationArray(rawMsg js } func unmarshalMigrateSsisTaskOutputClassification(rawMsg json.RawMessage) (MigrateSsisTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -585,7 +639,7 @@ func unmarshalMigrateSsisTaskOutputClassification(rawMsg json.RawMessage) (Migra } func unmarshalMigrateSsisTaskOutputClassificationArray(rawMsg json.RawMessage) ([]MigrateSsisTaskOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages []json.RawMessage @@ -604,7 +658,7 @@ func unmarshalMigrateSsisTaskOutputClassificationArray(rawMsg json.RawMessage) ( } func unmarshalMongoDbProgressClassification(rawMsg json.RawMessage) (MongoDbProgressClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -629,7 +683,7 @@ func unmarshalMongoDbProgressClassification(rawMsg json.RawMessage) (MongoDbProg } func unmarshalMongoDbProgressClassificationArray(rawMsg json.RawMessage) ([]MongoDbProgressClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages []json.RawMessage @@ -648,7 +702,7 @@ func unmarshalMongoDbProgressClassificationArray(rawMsg json.RawMessage) ([]Mong } func unmarshalProjectTaskPropertiesClassification(rawMsg json.RawMessage) (ProjectTaskPropertiesClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -657,81 +711,81 @@ func unmarshalProjectTaskPropertiesClassification(rawMsg json.RawMessage) (Proje } var b ProjectTaskPropertiesClassification switch m["taskType"] { - case "Connect.MongoDb": + case string(TaskTypeConnectMongoDb): b = &ConnectToMongoDbTaskProperties{} - case "ConnectToSource.MySql": + case string(TaskTypeConnectToSourceMySQL): b = &ConnectToSourceMySQLTaskProperties{} - case "ConnectToSource.Oracle.Sync": + case string(TaskTypeConnectToSourceOracleSync): b = &ConnectToSourceOracleSyncTaskProperties{} - case "ConnectToSource.PostgreSql.Sync": + case string(TaskTypeConnectToSourcePostgreSQLSync): b = &ConnectToSourcePostgreSQLSyncTaskProperties{} - case "ConnectToSource.SqlServer": + case string(TaskTypeConnectToSourceSQLServer): b = &ConnectToSourceSQLServerTaskProperties{} - case "ConnectToSource.SqlServer.Sync": + case string(TaskTypeConnectToSourceSQLServerSync): b = &ConnectToSourceSQLServerSyncTaskProperties{} - case "ConnectToTarget.AzureDbForMySql": + case string(TaskTypeConnectToTargetAzureDbForMySQL): b = &ConnectToTargetAzureDbForMySQLTaskProperties{} - case "ConnectToTarget.AzureDbForPostgreSql.Sync": + case string(TaskTypeConnectToTargetAzureDbForPostgreSQLSync): b = &ConnectToTargetAzureDbForPostgreSQLSyncTaskProperties{} - case "ConnectToTarget.AzureSqlDbMI": + case string(TaskTypeConnectToTargetAzureSQLDbMI): b = &ConnectToTargetSQLMITaskProperties{} - case "ConnectToTarget.AzureSqlDbMI.Sync.LRS": + case string(TaskTypeConnectToTargetAzureSQLDbMISyncLRS): b = &ConnectToTargetSQLMISyncTaskProperties{} - case "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync": + case string(TaskTypeConnectToTargetOracleAzureDbForPostgreSQLSync): b = &ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskProperties{} - case "ConnectToTarget.SqlDb": + case string(TaskTypeConnectToTargetSQLDb): b = &ConnectToTargetSQLDbTaskProperties{} - case "ConnectToTarget.SqlDb.Sync": + case string(TaskTypeConnectToTargetSQLDbSync): b = &ConnectToTargetSQLDbSyncTaskProperties{} - case "GetTDECertificates.Sql": + case string(TaskTypeGetTDECertificatesSQL): b = &GetTdeCertificatesSQLTaskProperties{} - case "GetUserTables.AzureSqlDb.Sync": + case string(TaskTypeGetUserTablesAzureSQLDbSync): b = &GetUserTablesSQLSyncTaskProperties{} - case "GetUserTables.Sql": + case string(TaskTypeGetUserTablesSQL): b = &GetUserTablesSQLTaskProperties{} - case "GetUserTablesMySql": + case string(TaskTypeGetUserTablesMySQL): b = &GetUserTablesMySQLTaskProperties{} - case "GetUserTablesOracle": + case string(TaskTypeGetUserTablesOracle): b = &GetUserTablesOracleTaskProperties{} - case "GetUserTablesPostgreSql": + case string(TaskTypeGetUserTablesPostgreSQL): b = &GetUserTablesPostgreSQLTaskProperties{} - case "Migrate.MongoDb": + case string(TaskTypeMigrateMongoDb): b = &MigrateMongoDbTaskProperties{} - case "Migrate.MySql.AzureDbForMySql": + case string(TaskTypeMigrateMySQLAzureDbForMySQL): b = &MigrateMySQLAzureDbForMySQLOfflineTaskProperties{} - case "Migrate.MySql.AzureDbForMySql.Sync": + case string(TaskTypeMigrateMySQLAzureDbForMySQLSync): b = &MigrateMySQLAzureDbForMySQLSyncTaskProperties{} - case "Migrate.Oracle.AzureDbForPostgreSql.Sync": + case string(TaskTypeMigrateOracleAzureDbForPostgreSQLSync): b = &MigrateOracleAzureDbForPostgreSQLSyncTaskProperties{} - case "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2": + case string(TaskTypeMigratePostgreSQLAzureDbForPostgreSQLSyncV2): b = &MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties{} - case "Migrate.SqlServer.AzureSqlDb.Sync": + case string(TaskTypeMigrateSQLServerAzureSQLDbSync): b = &MigrateSQLServerSQLDbSyncTaskProperties{} - case "Migrate.SqlServer.AzureSqlDbMI": + case string(TaskTypeMigrateSQLServerAzureSQLDbMI): b = &MigrateSQLServerSQLMITaskProperties{} - case "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS": + case string(TaskTypeMigrateSQLServerAzureSQLDbMISyncLRS): b = &MigrateSQLServerSQLMISyncTaskProperties{} - case "Migrate.SqlServer.SqlDb": + case string(TaskTypeMigrateSQLServerSQLDb): b = &MigrateSQLServerSQLDbTaskProperties{} - case "Migrate.Ssis": + case string(TaskTypeMigrateSsis): b = &MigrateSsisTaskProperties{} - case "MigrateSchemaSqlServerSqlDb": + case string(TaskTypeMigrateSchemaSQLServerSQLDb): b = &MigrateSchemaSQLServerSQLDbTaskProperties{} - case "Service.Check.OCI": + case string(TaskTypeServiceCheckOCI): b = &CheckOCIDriverTaskProperties{} - case "Service.Install.OCI": + case string(TaskTypeServiceInstallOCI): b = &InstallOCIDriverTaskProperties{} - case "Service.Upload.OCI": + case string(TaskTypeServiceUploadOCI): b = &UploadOCIDriverTaskProperties{} - case "Validate.MongoDb": + case string(TaskTypeValidateMongoDb): b = &ValidateMongoDbTaskProperties{} - case "Validate.Oracle.AzureDbPostgreSql.Sync": + case string(TaskTypeValidateOracleAzureDbPostgreSQLSync): b = &ValidateOracleAzureDbForPostgreSQLSyncTaskProperties{} - case "ValidateMigrationInput.SqlServer.AzureSqlDbMI": + case string(TaskTypeValidateMigrationInputSQLServerAzureSQLDbMI): b = &ValidateMigrationInputSQLServerSQLMITaskProperties{} - case "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS": + case string(TaskTypeValidateMigrationInputSQLServerAzureSQLDbMISyncLRS): b = &ValidateMigrationInputSQLServerSQLMISyncTaskProperties{} - case "ValidateMigrationInput.SqlServer.SqlDb.Sync": + case string(TaskTypeValidateMigrationInputSQLServerSQLDbSync): b = &ValidateMigrationInputSQLServerSQLDbSyncTaskProperties{} default: b = &ProjectTaskProperties{} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/projects_client.go b/sdk/resourcemanager/datamigration/armdatamigration/projects_client.go index 519fad8e2aea..4990cb13b7d6 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/projects_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/projects_client.go @@ -29,7 +29,7 @@ type ProjectsClient struct { } // NewProjectsClient creates a new instance of ProjectsClient with the specified values. -// - subscriptionID - Identifier of the subscription +// - subscriptionID - Subscription ID that identifies an Azure subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewProjectsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProjectsClient, error) { @@ -48,7 +48,7 @@ func NewProjectsClient(subscriptionID string, credential azcore.TokenCredential, // a new project or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -100,7 +100,7 @@ func (client *ProjectsClient) createOrUpdateCreateRequest(ctx context.Context, g return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -122,7 +122,7 @@ func (client *ProjectsClient) createOrUpdateHandleResponse(resp *http.Response) // project. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -172,7 +172,7 @@ func (client *ProjectsClient) deleteCreateRequest(ctx context.Context, groupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") if options != nil && options.DeleteRunningTasks != nil { reqQP.Set("deleteRunningTasks", strconv.FormatBool(*options.DeleteRunningTasks)) } @@ -185,7 +185,7 @@ func (client *ProjectsClient) deleteCreateRequest(ctx context.Context, groupName // about a project. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -236,7 +236,7 @@ func (client *ProjectsClient) getCreateRequest(ctx context.Context, groupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *ProjectsClient) getHandleResponse(resp *http.Response) (ProjectsCl // NewListPager - The project resource is a nested resource representing a stored migration project. This method returns a // list of projects owned by a service resource. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - options - ProjectsClientListOptions contains the optional parameters for the ProjectsClient.NewListPager method. @@ -301,7 +301,7 @@ func (client *ProjectsClient) listCreateRequest(ctx context.Context, groupName s return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -320,7 +320,7 @@ func (client *ProjectsClient) listHandleResponse(resp *http.Response) (ProjectsC // existing project. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -372,7 +372,7 @@ func (client *ProjectsClient) updateCreateRequest(ctx context.Context, groupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/datamigration/armdatamigration/projects_client_example_test.go b/sdk/resourcemanager/datamigration/armdatamigration/projects_client_example_test.go deleted file mode 100644 index 965f55f3b12a..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/projects_client_example_test.go +++ /dev/null @@ -1,196 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdatamigration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Projects_List.json -func ExampleProjectsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProjectsClient().NewListPager("DmsSdkRg", "DmsSdkService", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProjectList = armdatamigration.ProjectList{ - // Value: []*armdatamigration.Project{ - // { - // Name: to.Ptr("project1"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/project1"), - // Location: to.Ptr("southcentralus"), - // Properties: &armdatamigration.ProjectProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-14T01:29:56.304Z"); return t}()), - // ProvisioningState: to.Ptr(armdatamigration.ProjectProvisioningStateSucceeded), - // SourcePlatform: to.Ptr(armdatamigration.ProjectSourcePlatformSQL), - // TargetPlatform: to.Ptr(armdatamigration.ProjectTargetPlatformSQLDB), - // }, - // }, - // { - // Name: to.Ptr("project2"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/project2"), - // Location: to.Ptr("southcentralus"), - // Properties: &armdatamigration.ProjectProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-14T01:30:05.618Z"); return t}()), - // ProvisioningState: to.Ptr(armdatamigration.ProjectProvisioningStateSucceeded), - // SourcePlatform: to.Ptr(armdatamigration.ProjectSourcePlatformSQL), - // TargetPlatform: to.Ptr(armdatamigration.ProjectTargetPlatformSQLDB), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Projects_CreateOrUpdate.json -func ExampleProjectsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProjectsClient().CreateOrUpdate(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", armdatamigration.Project{ - Location: to.Ptr("southcentralus"), - Properties: &armdatamigration.ProjectProperties{ - SourcePlatform: to.Ptr(armdatamigration.ProjectSourcePlatformSQL), - TargetPlatform: to.Ptr(armdatamigration.ProjectTargetPlatformSQLDB), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Project = armdatamigration.Project{ - // Name: to.Ptr("DmsSdkProject"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/DmsSdkProject"), - // Location: to.Ptr("southcentralus"), - // Properties: &armdatamigration.ProjectProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-03T09:14:54.245Z"); return t}()), - // ProvisioningState: to.Ptr(armdatamigration.ProjectProvisioningStateSucceeded), - // SourcePlatform: to.Ptr(armdatamigration.ProjectSourcePlatformSQL), - // TargetPlatform: to.Ptr(armdatamigration.ProjectTargetPlatformSQLDB), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Projects_Get.json -func ExampleProjectsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProjectsClient().Get(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Project = armdatamigration.Project{ - // Name: to.Ptr("DmsSdkProject"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/DmsSdkProject"), - // Location: to.Ptr("southcentralus"), - // Properties: &armdatamigration.ProjectProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-03T09:35:11.656Z"); return t}()), - // ProvisioningState: to.Ptr(armdatamigration.ProjectProvisioningStateSucceeded), - // SourcePlatform: to.Ptr(armdatamigration.ProjectSourcePlatformSQL), - // TargetPlatform: to.Ptr(armdatamigration.ProjectTargetPlatformSQLDB), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Projects_Delete.json -func ExampleProjectsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProjectsClient().Delete(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", &armdatamigration.ProjectsClientDeleteOptions{DeleteRunningTasks: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Projects_Update.json -func ExampleProjectsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProjectsClient().Update(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", armdatamigration.Project{ - Location: to.Ptr("southcentralus"), - Properties: &armdatamigration.ProjectProperties{ - SourcePlatform: to.Ptr(armdatamigration.ProjectSourcePlatformSQL), - TargetPlatform: to.Ptr(armdatamigration.ProjectTargetPlatformSQLDB), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Project = armdatamigration.Project{ - // Name: to.Ptr("DmsSdkProject"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/DmsSdkProject"), - // Location: to.Ptr("southcentralus"), - // Properties: &armdatamigration.ProjectProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-03T09:14:54.245Z"); return t}()), - // ProvisioningState: to.Ptr(armdatamigration.ProjectProvisioningStateSucceeded), - // SourcePlatform: to.Ptr(armdatamigration.ProjectSourcePlatformSQL), - // TargetPlatform: to.Ptr(armdatamigration.ProjectTargetPlatformSQLDB), - // }, - // } -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/resourceskus_client.go b/sdk/resourcemanager/datamigration/armdatamigration/resourceskus_client.go index 353c317420b1..d863b7fdf032 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/resourceskus_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/resourceskus_client.go @@ -28,7 +28,7 @@ type ResourceSKUsClient struct { } // NewResourceSKUsClient creates a new instance of ResourceSKUsClient with the specified values. -// - subscriptionID - Identifier of the subscription +// - subscriptionID - Subscription ID that identifies an Azure subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewResourceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceSKUsClient, error) { @@ -43,9 +43,9 @@ func NewResourceSKUsClient(subscriptionID string, credential azcore.TokenCredent return client, nil } -// NewListSKUsPager - The skus action returns the list of SKUs that DMS supports. +// NewListSKUsPager - The skus action returns the list of SKUs that DMS (classic) supports. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - options - ResourceSKUsClientListSKUsOptions contains the optional parameters for the ResourceSKUsClient.NewListSKUsPager // method. func (client *ResourceSKUsClient) NewListSKUsPager(options *ResourceSKUsClientListSKUsOptions) *runtime.Pager[ResourceSKUsClientListSKUsResponse] { @@ -83,7 +83,7 @@ func (client *ResourceSKUsClient) listSKUsCreateRequest(ctx context.Context, opt return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/datamigration/armdatamigration/resourceskus_client_example_test.go b/sdk/resourcemanager/datamigration/armdatamigration/resourceskus_client_example_test.go deleted file mode 100644 index fbfc3af4d7f6..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/resourceskus_client_example_test.go +++ /dev/null @@ -1,82 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdatamigration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/ResourceSkus_ListSkus.json -func ExampleResourceSKUsClient_NewListSKUsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceSKUsClient().NewListSKUsPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceSKUsResult = armdatamigration.ResourceSKUsResult{ - // Value: []*armdatamigration.ResourceSKU{ - // { - // Name: to.Ptr("PP1"), - // Locations: []*string{ - // to.Ptr("East Asia"), - // to.Ptr("Southeast Asia"), - // to.Ptr("Australia East"), - // to.Ptr("Australia Southeast"), - // to.Ptr("Brazil South"), - // to.Ptr("Canada Central"), - // to.Ptr("Canada East"), - // to.Ptr("North Europe"), - // to.Ptr("West Europe"), - // to.Ptr("Central India"), - // to.Ptr("South India"), - // to.Ptr("West India"), - // to.Ptr("Japan East"), - // to.Ptr("Japan West"), - // to.Ptr("Korea South"), - // to.Ptr("Korea Central"), - // to.Ptr("UK South"), - // to.Ptr("UK South 2"), - // to.Ptr("UK North"), - // to.Ptr("UK West"), - // to.Ptr("East US 2 EUAP"), - // to.Ptr("Central US"), - // to.Ptr("East US"), - // to.Ptr("East US 2"), - // to.Ptr("North Central US"), - // to.Ptr("South Central US"), - // to.Ptr("West Central US"), - // to.Ptr("West US"), - // to.Ptr("West US 2")}, - // ResourceType: to.Ptr("services"), - // Restrictions: []*armdatamigration.ResourceSKURestrictions{ - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/response_types.go b/sdk/resourcemanager/datamigration/armdatamigration/response_types.go deleted file mode 100644 index 4797010af06f..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/response_types.go +++ /dev/null @@ -1,252 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatamigration - -// FilesClientCreateOrUpdateResponse contains the response from method FilesClient.CreateOrUpdate. -type FilesClientCreateOrUpdateResponse struct { - // A file resource - ProjectFile -} - -// FilesClientDeleteResponse contains the response from method FilesClient.Delete. -type FilesClientDeleteResponse struct { - // placeholder for future response values -} - -// FilesClientGetResponse contains the response from method FilesClient.Get. -type FilesClientGetResponse struct { - // A file resource - ProjectFile -} - -// FilesClientListResponse contains the response from method FilesClient.NewListPager. -type FilesClientListResponse struct { - // OData page of files - FileList -} - -// FilesClientReadResponse contains the response from method FilesClient.Read. -type FilesClientReadResponse struct { - // File storage information. - FileStorageInfo -} - -// FilesClientReadWriteResponse contains the response from method FilesClient.ReadWrite. -type FilesClientReadWriteResponse struct { - // File storage information. - FileStorageInfo -} - -// FilesClientUpdateResponse contains the response from method FilesClient.Update. -type FilesClientUpdateResponse struct { - // A file resource - ProjectFile -} - -// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. -type OperationsClientListResponse struct { - // OData page of action (operation) objects - ServiceOperationList -} - -// ProjectsClientCreateOrUpdateResponse contains the response from method ProjectsClient.CreateOrUpdate. -type ProjectsClientCreateOrUpdateResponse struct { - // A project resource - Project -} - -// ProjectsClientDeleteResponse contains the response from method ProjectsClient.Delete. -type ProjectsClientDeleteResponse struct { - // placeholder for future response values -} - -// ProjectsClientGetResponse contains the response from method ProjectsClient.Get. -type ProjectsClientGetResponse struct { - // A project resource - Project -} - -// ProjectsClientListResponse contains the response from method ProjectsClient.NewListPager. -type ProjectsClientListResponse struct { - // OData page of project resources - ProjectList -} - -// ProjectsClientUpdateResponse contains the response from method ProjectsClient.Update. -type ProjectsClientUpdateResponse struct { - // A project resource - Project -} - -// ResourceSKUsClientListSKUsResponse contains the response from method ResourceSKUsClient.NewListSKUsPager. -type ResourceSKUsClientListSKUsResponse struct { - // The DMS List SKUs operation response. - ResourceSKUsResult -} - -// ServiceTasksClientCancelResponse contains the response from method ServiceTasksClient.Cancel. -type ServiceTasksClientCancelResponse struct { - // A task resource - ProjectTask -} - -// ServiceTasksClientCreateOrUpdateResponse contains the response from method ServiceTasksClient.CreateOrUpdate. -type ServiceTasksClientCreateOrUpdateResponse struct { - // A task resource - ProjectTask -} - -// ServiceTasksClientDeleteResponse contains the response from method ServiceTasksClient.Delete. -type ServiceTasksClientDeleteResponse struct { - // placeholder for future response values -} - -// ServiceTasksClientGetResponse contains the response from method ServiceTasksClient.Get. -type ServiceTasksClientGetResponse struct { - // A task resource - ProjectTask -} - -// ServiceTasksClientListResponse contains the response from method ServiceTasksClient.NewListPager. -type ServiceTasksClientListResponse struct { - // OData page of tasks - TaskList -} - -// ServiceTasksClientUpdateResponse contains the response from method ServiceTasksClient.Update. -type ServiceTasksClientUpdateResponse struct { - // A task resource - ProjectTask -} - -// ServicesClientCheckChildrenNameAvailabilityResponse contains the response from method ServicesClient.CheckChildrenNameAvailability. -type ServicesClientCheckChildrenNameAvailabilityResponse struct { - // Indicates whether a proposed resource name is available - NameAvailabilityResponse -} - -// ServicesClientCheckNameAvailabilityResponse contains the response from method ServicesClient.CheckNameAvailability. -type ServicesClientCheckNameAvailabilityResponse struct { - // Indicates whether a proposed resource name is available - NameAvailabilityResponse -} - -// ServicesClientCheckStatusResponse contains the response from method ServicesClient.CheckStatus. -type ServicesClientCheckStatusResponse struct { - // Service health status - ServiceStatusResponse -} - -// ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.BeginCreateOrUpdate. -type ServicesClientCreateOrUpdateResponse struct { - // A Database Migration Service resource - Service -} - -// ServicesClientDeleteResponse contains the response from method ServicesClient.BeginDelete. -type ServicesClientDeleteResponse struct { - // placeholder for future response values -} - -// ServicesClientGetResponse contains the response from method ServicesClient.Get. -type ServicesClientGetResponse struct { - // A Database Migration Service resource - Service -} - -// ServicesClientListByResourceGroupResponse contains the response from method ServicesClient.NewListByResourceGroupPager. -type ServicesClientListByResourceGroupResponse struct { - // OData page of service objects - ServiceList -} - -// ServicesClientListResponse contains the response from method ServicesClient.NewListPager. -type ServicesClientListResponse struct { - // OData page of service objects - ServiceList -} - -// ServicesClientListSKUsResponse contains the response from method ServicesClient.NewListSKUsPager. -type ServicesClientListSKUsResponse struct { - // OData page of available SKUs - ServiceSKUList -} - -// ServicesClientStartResponse contains the response from method ServicesClient.BeginStart. -type ServicesClientStartResponse struct { - // placeholder for future response values -} - -// ServicesClientStopResponse contains the response from method ServicesClient.BeginStop. -type ServicesClientStopResponse struct { - // placeholder for future response values -} - -// ServicesClientUpdateResponse contains the response from method ServicesClient.BeginUpdate. -type ServicesClientUpdateResponse struct { - // A Database Migration Service resource - Service -} - -// TasksClientCancelResponse contains the response from method TasksClient.Cancel. -type TasksClientCancelResponse struct { - // A task resource - ProjectTask -} - -// TasksClientCommandResponse contains the response from method TasksClient.Command. -type TasksClientCommandResponse struct { - // Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. - CommandPropertiesClassification -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TasksClientCommandResponse. -func (t *TasksClientCommandResponse) UnmarshalJSON(data []byte) error { - res, err := unmarshalCommandPropertiesClassification(data) - if err != nil { - return err - } - t.CommandPropertiesClassification = res - return nil -} - -// TasksClientCreateOrUpdateResponse contains the response from method TasksClient.CreateOrUpdate. -type TasksClientCreateOrUpdateResponse struct { - // A task resource - ProjectTask -} - -// TasksClientDeleteResponse contains the response from method TasksClient.Delete. -type TasksClientDeleteResponse struct { - // placeholder for future response values -} - -// TasksClientGetResponse contains the response from method TasksClient.Get. -type TasksClientGetResponse struct { - // A task resource - ProjectTask -} - -// TasksClientListResponse contains the response from method TasksClient.NewListPager. -type TasksClientListResponse struct { - // OData page of tasks - TaskList -} - -// TasksClientUpdateResponse contains the response from method TasksClient.Update. -type TasksClientUpdateResponse struct { - // A task resource - ProjectTask -} - -// UsagesClientListResponse contains the response from method UsagesClient.NewListPager. -type UsagesClientListResponse struct { - // OData page of quota objects - QuotaList -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/responses.go b/sdk/resourcemanager/datamigration/armdatamigration/responses.go new file mode 100644 index 000000000000..448a252e11cd --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/responses.go @@ -0,0 +1,471 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdatamigration + +// DatabaseMigrationsMongoToCosmosDbRUMongoClientCreateResponse contains the response from method DatabaseMigrationsMongoToCosmosDbRUMongoClient.BeginCreate. +type DatabaseMigrationsMongoToCosmosDbRUMongoClientCreateResponse struct { + // Database Migration Resource for Mongo to CosmosDb. + DatabaseMigrationCosmosDbMongo +} + +// DatabaseMigrationsMongoToCosmosDbRUMongoClientDeleteResponse contains the response from method DatabaseMigrationsMongoToCosmosDbRUMongoClient.BeginDelete. +type DatabaseMigrationsMongoToCosmosDbRUMongoClientDeleteResponse struct { + // placeholder for future response values +} + +// DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse contains the response from method DatabaseMigrationsMongoToCosmosDbRUMongoClient.NewGetForScopePager. +type DatabaseMigrationsMongoToCosmosDbRUMongoClientGetForScopeResponse struct { + // A list of Database Migrations. + DatabaseMigrationCosmosDbMongoListResult +} + +// DatabaseMigrationsMongoToCosmosDbRUMongoClientGetResponse contains the response from method DatabaseMigrationsMongoToCosmosDbRUMongoClient.Get. +type DatabaseMigrationsMongoToCosmosDbRUMongoClientGetResponse struct { + // Database Migration Resource for Mongo to CosmosDb. + DatabaseMigrationCosmosDbMongo +} + +// DatabaseMigrationsMongoToCosmosDbvCoreMongoClientCreateResponse contains the response from method DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.BeginCreate. +type DatabaseMigrationsMongoToCosmosDbvCoreMongoClientCreateResponse struct { + // Database Migration Resource for Mongo to CosmosDb. + DatabaseMigrationCosmosDbMongo +} + +// DatabaseMigrationsMongoToCosmosDbvCoreMongoClientDeleteResponse contains the response from method DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.BeginDelete. +type DatabaseMigrationsMongoToCosmosDbvCoreMongoClientDeleteResponse struct { + // placeholder for future response values +} + +// DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse contains the response from method DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.NewGetForScopePager. +type DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetForScopeResponse struct { + // A list of Database Migrations. + DatabaseMigrationCosmosDbMongoListResult +} + +// DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetResponse contains the response from method DatabaseMigrationsMongoToCosmosDbvCoreMongoClient.Get. +type DatabaseMigrationsMongoToCosmosDbvCoreMongoClientGetResponse struct { + // Database Migration Resource for Mongo to CosmosDb. + DatabaseMigrationCosmosDbMongo +} + +// DatabaseMigrationsSQLDbClientCancelResponse contains the response from method DatabaseMigrationsSQLDbClient.BeginCancel. +type DatabaseMigrationsSQLDbClientCancelResponse struct { + // placeholder for future response values +} + +// DatabaseMigrationsSQLDbClientCreateOrUpdateResponse contains the response from method DatabaseMigrationsSQLDbClient.BeginCreateOrUpdate. +type DatabaseMigrationsSQLDbClientCreateOrUpdateResponse struct { + // Database Migration Resource for SQL Database. + DatabaseMigrationSQLDb +} + +// DatabaseMigrationsSQLDbClientDeleteResponse contains the response from method DatabaseMigrationsSQLDbClient.BeginDelete. +type DatabaseMigrationsSQLDbClientDeleteResponse struct { + // placeholder for future response values +} + +// DatabaseMigrationsSQLDbClientGetResponse contains the response from method DatabaseMigrationsSQLDbClient.Get. +type DatabaseMigrationsSQLDbClientGetResponse struct { + // Database Migration Resource for SQL Database. + DatabaseMigrationSQLDb +} + +// DatabaseMigrationsSQLMiClientCancelResponse contains the response from method DatabaseMigrationsSQLMiClient.BeginCancel. +type DatabaseMigrationsSQLMiClientCancelResponse struct { + // placeholder for future response values +} + +// DatabaseMigrationsSQLMiClientCreateOrUpdateResponse contains the response from method DatabaseMigrationsSQLMiClient.BeginCreateOrUpdate. +type DatabaseMigrationsSQLMiClientCreateOrUpdateResponse struct { + // Database Migration Resource for SQL Managed Instance. + DatabaseMigrationSQLMi +} + +// DatabaseMigrationsSQLMiClientCutoverResponse contains the response from method DatabaseMigrationsSQLMiClient.BeginCutover. +type DatabaseMigrationsSQLMiClientCutoverResponse struct { + // placeholder for future response values +} + +// DatabaseMigrationsSQLMiClientGetResponse contains the response from method DatabaseMigrationsSQLMiClient.Get. +type DatabaseMigrationsSQLMiClientGetResponse struct { + // Database Migration Resource for SQL Managed Instance. + DatabaseMigrationSQLMi +} + +// DatabaseMigrationsSQLVMClientCancelResponse contains the response from method DatabaseMigrationsSQLVMClient.BeginCancel. +type DatabaseMigrationsSQLVMClientCancelResponse struct { + // placeholder for future response values +} + +// DatabaseMigrationsSQLVMClientCreateOrUpdateResponse contains the response from method DatabaseMigrationsSQLVMClient.BeginCreateOrUpdate. +type DatabaseMigrationsSQLVMClientCreateOrUpdateResponse struct { + // Database Migration Resource for SQL Virtual Machine. + DatabaseMigrationSQLVM +} + +// DatabaseMigrationsSQLVMClientCutoverResponse contains the response from method DatabaseMigrationsSQLVMClient.BeginCutover. +type DatabaseMigrationsSQLVMClientCutoverResponse struct { + // placeholder for future response values +} + +// DatabaseMigrationsSQLVMClientGetResponse contains the response from method DatabaseMigrationsSQLVMClient.Get. +type DatabaseMigrationsSQLVMClientGetResponse struct { + // Database Migration Resource for SQL Virtual Machine. + DatabaseMigrationSQLVM +} + +// FilesClientCreateOrUpdateResponse contains the response from method FilesClient.CreateOrUpdate. +type FilesClientCreateOrUpdateResponse struct { + // A file resource + ProjectFile +} + +// FilesClientDeleteResponse contains the response from method FilesClient.Delete. +type FilesClientDeleteResponse struct { + // placeholder for future response values +} + +// FilesClientGetResponse contains the response from method FilesClient.Get. +type FilesClientGetResponse struct { + // A file resource + ProjectFile +} + +// FilesClientListResponse contains the response from method FilesClient.NewListPager. +type FilesClientListResponse struct { + // OData page of files + FileList +} + +// FilesClientReadResponse contains the response from method FilesClient.Read. +type FilesClientReadResponse struct { + // File storage information. + FileStorageInfo +} + +// FilesClientReadWriteResponse contains the response from method FilesClient.ReadWrite. +type FilesClientReadWriteResponse struct { + // File storage information. + FileStorageInfo +} + +// FilesClientUpdateResponse contains the response from method FilesClient.Update. +type FilesClientUpdateResponse struct { + // A file resource + ProjectFile +} + +// MigrationServicesClientCreateOrUpdateResponse contains the response from method MigrationServicesClient.BeginCreateOrUpdate. +type MigrationServicesClientCreateOrUpdateResponse struct { + // A Migration Service. + MigrationService +} + +// MigrationServicesClientDeleteResponse contains the response from method MigrationServicesClient.BeginDelete. +type MigrationServicesClientDeleteResponse struct { + // placeholder for future response values +} + +// MigrationServicesClientGetResponse contains the response from method MigrationServicesClient.Get. +type MigrationServicesClientGetResponse struct { + // A Migration Service. + MigrationService +} + +// MigrationServicesClientListByResourceGroupResponse contains the response from method MigrationServicesClient.NewListByResourceGroupPager. +type MigrationServicesClientListByResourceGroupResponse struct { + // A list of Migration Service. + MigrationServiceListResult +} + +// MigrationServicesClientListBySubscriptionResponse contains the response from method MigrationServicesClient.NewListBySubscriptionPager. +type MigrationServicesClientListBySubscriptionResponse struct { + // A list of Migration Service. + MigrationServiceListResult +} + +// MigrationServicesClientListMigrationsResponse contains the response from method MigrationServicesClient.NewListMigrationsPager. +type MigrationServicesClientListMigrationsResponse struct { + // A list of Database Migrations. + DatabaseMigrationBaseListResult +} + +// MigrationServicesClientUpdateResponse contains the response from method MigrationServicesClient.BeginUpdate. +type MigrationServicesClientUpdateResponse struct { + // A Migration Service. + MigrationService +} + +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. +type OperationsClientListResponse struct { + // Result of the request to list SQL operations. + OperationListResult +} + +// ProjectsClientCreateOrUpdateResponse contains the response from method ProjectsClient.CreateOrUpdate. +type ProjectsClientCreateOrUpdateResponse struct { + // A project resource + Project +} + +// ProjectsClientDeleteResponse contains the response from method ProjectsClient.Delete. +type ProjectsClientDeleteResponse struct { + // placeholder for future response values +} + +// ProjectsClientGetResponse contains the response from method ProjectsClient.Get. +type ProjectsClientGetResponse struct { + // A project resource + Project +} + +// ProjectsClientListResponse contains the response from method ProjectsClient.NewListPager. +type ProjectsClientListResponse struct { + // OData page of project resources + ProjectList +} + +// ProjectsClientUpdateResponse contains the response from method ProjectsClient.Update. +type ProjectsClientUpdateResponse struct { + // A project resource + Project +} + +// ResourceSKUsClientListSKUsResponse contains the response from method ResourceSKUsClient.NewListSKUsPager. +type ResourceSKUsClientListSKUsResponse struct { + // The DMS (classic) List SKUs operation response. + ResourceSKUsResult +} + +// SQLMigrationServicesClientCreateOrUpdateResponse contains the response from method SQLMigrationServicesClient.BeginCreateOrUpdate. +type SQLMigrationServicesClientCreateOrUpdateResponse struct { + // A SQL Migration Service. + SQLMigrationService +} + +// SQLMigrationServicesClientDeleteNodeResponse contains the response from method SQLMigrationServicesClient.DeleteNode. +type SQLMigrationServicesClientDeleteNodeResponse struct { + // Details of node to be deleted. + DeleteNode +} + +// SQLMigrationServicesClientDeleteResponse contains the response from method SQLMigrationServicesClient.BeginDelete. +type SQLMigrationServicesClientDeleteResponse struct { + // placeholder for future response values +} + +// SQLMigrationServicesClientGetResponse contains the response from method SQLMigrationServicesClient.Get. +type SQLMigrationServicesClientGetResponse struct { + // A SQL Migration Service. + SQLMigrationService +} + +// SQLMigrationServicesClientListAuthKeysResponse contains the response from method SQLMigrationServicesClient.ListAuthKeys. +type SQLMigrationServicesClientListAuthKeysResponse struct { + // An authentication key. + AuthenticationKeys +} + +// SQLMigrationServicesClientListByResourceGroupResponse contains the response from method SQLMigrationServicesClient.NewListByResourceGroupPager. +type SQLMigrationServicesClientListByResourceGroupResponse struct { + // A list of SQL Migration Service. + SQLMigrationListResult +} + +// SQLMigrationServicesClientListBySubscriptionResponse contains the response from method SQLMigrationServicesClient.NewListBySubscriptionPager. +type SQLMigrationServicesClientListBySubscriptionResponse struct { + // A list of SQL Migration Service. + SQLMigrationListResult +} + +// SQLMigrationServicesClientListMigrationsResponse contains the response from method SQLMigrationServicesClient.NewListMigrationsPager. +type SQLMigrationServicesClientListMigrationsResponse struct { + // A list of Database Migrations. + DatabaseMigrationListResult +} + +// SQLMigrationServicesClientListMonitoringDataResponse contains the response from method SQLMigrationServicesClient.ListMonitoringData. +type SQLMigrationServicesClientListMonitoringDataResponse struct { + // Integration Runtime Monitoring Data. + IntegrationRuntimeMonitoringData +} + +// SQLMigrationServicesClientRegenerateAuthKeysResponse contains the response from method SQLMigrationServicesClient.RegenerateAuthKeys. +type SQLMigrationServicesClientRegenerateAuthKeysResponse struct { + // An authentication key to regenerate. + RegenAuthKeys +} + +// SQLMigrationServicesClientUpdateResponse contains the response from method SQLMigrationServicesClient.BeginUpdate. +type SQLMigrationServicesClientUpdateResponse struct { + // A SQL Migration Service. + SQLMigrationService +} + +// ServiceTasksClientCancelResponse contains the response from method ServiceTasksClient.Cancel. +type ServiceTasksClientCancelResponse struct { + // A task resource + ProjectTask +} + +// ServiceTasksClientCreateOrUpdateResponse contains the response from method ServiceTasksClient.CreateOrUpdate. +type ServiceTasksClientCreateOrUpdateResponse struct { + // A task resource + ProjectTask +} + +// ServiceTasksClientDeleteResponse contains the response from method ServiceTasksClient.Delete. +type ServiceTasksClientDeleteResponse struct { + // placeholder for future response values +} + +// ServiceTasksClientGetResponse contains the response from method ServiceTasksClient.Get. +type ServiceTasksClientGetResponse struct { + // A task resource + ProjectTask +} + +// ServiceTasksClientListResponse contains the response from method ServiceTasksClient.NewListPager. +type ServiceTasksClientListResponse struct { + // OData page of tasks + TaskList +} + +// ServiceTasksClientUpdateResponse contains the response from method ServiceTasksClient.Update. +type ServiceTasksClientUpdateResponse struct { + // A task resource + ProjectTask +} + +// ServicesClientCheckChildrenNameAvailabilityResponse contains the response from method ServicesClient.CheckChildrenNameAvailability. +type ServicesClientCheckChildrenNameAvailabilityResponse struct { + // Indicates whether a proposed resource name is available + NameAvailabilityResponse +} + +// ServicesClientCheckNameAvailabilityResponse contains the response from method ServicesClient.CheckNameAvailability. +type ServicesClientCheckNameAvailabilityResponse struct { + // Indicates whether a proposed resource name is available + NameAvailabilityResponse +} + +// ServicesClientCheckStatusResponse contains the response from method ServicesClient.CheckStatus. +type ServicesClientCheckStatusResponse struct { + // Service health status + ServiceStatusResponse +} + +// ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.BeginCreateOrUpdate. +type ServicesClientCreateOrUpdateResponse struct { + // An Azure Database Migration Service (classic) resource + Service +} + +// ServicesClientDeleteResponse contains the response from method ServicesClient.BeginDelete. +type ServicesClientDeleteResponse struct { + // placeholder for future response values +} + +// ServicesClientGetResponse contains the response from method ServicesClient.Get. +type ServicesClientGetResponse struct { + // An Azure Database Migration Service (classic) resource + Service +} + +// ServicesClientListByResourceGroupResponse contains the response from method ServicesClient.NewListByResourceGroupPager. +type ServicesClientListByResourceGroupResponse struct { + // OData page of service objects + ServiceList +} + +// ServicesClientListResponse contains the response from method ServicesClient.NewListPager. +type ServicesClientListResponse struct { + // OData page of service objects + ServiceList +} + +// ServicesClientListSKUsResponse contains the response from method ServicesClient.NewListSKUsPager. +type ServicesClientListSKUsResponse struct { + // OData page of available SKUs + ServiceSKUList +} + +// ServicesClientStartResponse contains the response from method ServicesClient.BeginStart. +type ServicesClientStartResponse struct { + // placeholder for future response values +} + +// ServicesClientStopResponse contains the response from method ServicesClient.BeginStop. +type ServicesClientStopResponse struct { + // placeholder for future response values +} + +// ServicesClientUpdateResponse contains the response from method ServicesClient.BeginUpdate. +type ServicesClientUpdateResponse struct { + // An Azure Database Migration Service (classic) resource + Service +} + +// TasksClientCancelResponse contains the response from method TasksClient.Cancel. +type TasksClientCancelResponse struct { + // A task resource + ProjectTask +} + +// TasksClientCommandResponse contains the response from method TasksClient.Command. +type TasksClientCommandResponse struct { + // Base class for all types of DMS (classic) command properties. If command is not supported by current client, this object + // is returned. + CommandPropertiesClassification +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TasksClientCommandResponse. +func (t *TasksClientCommandResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalCommandPropertiesClassification(data) + if err != nil { + return err + } + t.CommandPropertiesClassification = res + return nil +} + +// TasksClientCreateOrUpdateResponse contains the response from method TasksClient.CreateOrUpdate. +type TasksClientCreateOrUpdateResponse struct { + // A task resource + ProjectTask +} + +// TasksClientDeleteResponse contains the response from method TasksClient.Delete. +type TasksClientDeleteResponse struct { + // placeholder for future response values +} + +// TasksClientGetResponse contains the response from method TasksClient.Get. +type TasksClientGetResponse struct { + // A task resource + ProjectTask +} + +// TasksClientListResponse contains the response from method TasksClient.NewListPager. +type TasksClientListResponse struct { + // OData page of tasks + TaskList +} + +// TasksClientUpdateResponse contains the response from method TasksClient.Update. +type TasksClientUpdateResponse struct { + // A task resource + ProjectTask +} + +// UsagesClientListResponse contains the response from method UsagesClient.NewListPager. +type UsagesClientListResponse struct { + // OData page of quota objects + QuotaList +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/services_client.go b/sdk/resourcemanager/datamigration/armdatamigration/services_client.go index f243a846da08..7a61d1c117e3 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/services_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/services_client.go @@ -29,7 +29,7 @@ type ServicesClient struct { } // NewServicesClient creates a new instance of ServicesClient with the specified values. -// - subscriptionID - Identifier of the subscription +// - subscriptionID - Subscription ID that identifies an Azure subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServicesClient, error) { @@ -47,7 +47,7 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // CheckChildrenNameAvailability - This method checks whether a proposed nested resource name is valid and available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - parameters - Requested name to validate @@ -95,7 +95,7 @@ func (client *ServicesClient) checkChildrenNameAvailabilityCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -116,7 +116,7 @@ func (client *ServicesClient) checkChildrenNameAvailabilityHandleResponse(resp * // CheckNameAvailability - This method checks whether a proposed top-level resource name is valid and available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - location - The Azure region of the operation // - parameters - Requested name to validate // - options - ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability @@ -159,7 +159,7 @@ func (client *ServicesClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -177,11 +177,12 @@ func (client *ServicesClient) checkNameAvailabilityHandleResponse(resp *http.Res return result, nil } -// CheckStatus - 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. +// CheckStatus - The services resource is the top-level resource that represents the Azure Database Migration Service (classic). +// This action performs a health check and returns the status of the service and virtual +// machine size. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - options - ServicesClientCheckStatusOptions contains the optional parameters for the ServicesClient.CheckStatus method. @@ -227,7 +228,7 @@ func (client *ServicesClient) checkStatusCreateRequest(ctx context.Context, grou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,16 +243,16 @@ func (client *ServicesClient) checkStatusHandleResponse(resp *http.Response) (Se return result, nil } -// BeginCreateOrUpdate - 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. +// BeginCreateOrUpdate - The services resource is the top-level resource that represents the Azure Database Migration Service +// (classic). The PUT method creates a new service or updates an existing one. When a service is +// updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers +// to a VM-based service, although other kinds may be added in the future. This +// method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), +// this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will +// reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - parameters - Information about the service @@ -274,16 +275,16 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, groupName } } -// CreateOrUpdate - 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. +// CreateOrUpdate - The services resource is the top-level resource that represents the Azure Database Migration Service (classic). +// The PUT method creates a new service or updates an existing one. When a service is +// updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers +// to a VM-based service, although other kinds may be added in the future. This +// method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), +// this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will +// reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview func (client *ServicesClient) createOrUpdate(ctx context.Context, groupName string, serviceName string, parameters Service, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginCreateOrUpdate" @@ -325,7 +326,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, g return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -334,11 +335,11 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, g return req, nil } -// BeginDelete - 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. +// BeginDelete - The services resource is the top-level resource that represents the Azure Database Migration Service (classic). +// The DELETE method deletes a service. Any running tasks will be canceled. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - options - ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. @@ -359,11 +360,11 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, groupName string, } } -// Delete - 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 services resource is the top-level resource that represents the Azure Database Migration Service (classic). +// The DELETE method deletes a service. Any running tasks will be canceled. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview func (client *ServicesClient) deleteOperation(ctx context.Context, groupName string, serviceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginDelete" @@ -405,7 +406,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, groupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") if options != nil && options.DeleteRunningTasks != nil { reqQP.Set("deleteRunningTasks", strconv.FormatBool(*options.DeleteRunningTasks)) } @@ -414,11 +415,11 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, groupName return req, nil } -// Get - The services resource is the top-level resource that represents the Database Migration Service. The GET method retrieves -// information about a service instance. +// Get - The services resource is the top-level resource that represents the Azure Database Migration Service (classic). The +// GET method retrieves information about a service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. @@ -464,7 +465,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, groupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -479,10 +480,10 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl return result, nil } -// NewListPager - 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. +// NewListPager - The services resource is the top-level resource that represents the Azure Database Migration Service (classic). +// This method returns a list of service resources in a subscription. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - options - ServicesClientListOptions contains the optional parameters for the ServicesClient.NewListPager method. func (client *ServicesClient) NewListPager(options *ServicesClientListOptions) *runtime.Pager[ServicesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServicesClientListResponse]{ @@ -519,7 +520,7 @@ func (client *ServicesClient) listCreateRequest(ctx context.Context, options *Se return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -534,10 +535,10 @@ func (client *ServicesClient) listHandleResponse(resp *http.Response) (ServicesC return result, nil } -// NewListByResourceGroupPager - 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. +// NewListByResourceGroupPager - The Services resource is the top-level resource that represents the Azure Database Migration +// Service (classic). This method returns a list of service resources in a resource group. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - options - ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager // method. @@ -580,7 +581,7 @@ func (client *ServicesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -595,10 +596,10 @@ func (client *ServicesClient) listByResourceGroupHandleResponse(resp *http.Respo return result, nil } -// NewListSKUsPager - 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. +// NewListSKUsPager - The services resource is the top-level resource that represents the Database Migration Service (classic). +// The skus action returns the list of SKUs that a service resource can be updated to. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - options - ServicesClientListSKUsOptions contains the optional parameters for the ServicesClient.NewListSKUsPager method. @@ -645,7 +646,7 @@ func (client *ServicesClient) listSKUsCreateRequest(ctx context.Context, groupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -660,11 +661,11 @@ func (client *ServicesClient) listSKUsHandleResponse(resp *http.Response) (Servi return result, nil } -// BeginStart - 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. +// BeginStart - The services resource is the top-level resource that represents the Azure Database Migration Service (classic). +// This action starts the service and the service can be used for data migration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - options - ServicesClientBeginStartOptions contains the optional parameters for the ServicesClient.BeginStart method. @@ -685,11 +686,11 @@ func (client *ServicesClient) BeginStart(ctx context.Context, groupName string, } } -// Start - 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. +// Start - The services resource is the top-level resource that represents the Azure Database Migration Service (classic). +// This action starts the service and the service can be used for data migration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview func (client *ServicesClient) start(ctx context.Context, groupName string, serviceName string, options *ServicesClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginStart" @@ -731,18 +732,18 @@ func (client *ServicesClient) startCreateRequest(ctx context.Context, groupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginStop - 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. +// BeginStop - The services resource is the top-level resource that represents the Azure Database Migration Service (classic). +// This action stops the service and the service cannot be used for data migration. The +// service owner won't be billed when the service is stopped. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - options - ServicesClientBeginStopOptions contains the optional parameters for the ServicesClient.BeginStop method. @@ -763,12 +764,12 @@ func (client *ServicesClient) BeginStop(ctx context.Context, groupName string, s } } -// Stop - 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 - The services resource is the top-level resource that represents the Azure Database Migration Service (classic). +// This action stops the service and the service cannot be used for data migration. The +// service owner won't be billed when the service is stopped. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview func (client *ServicesClient) stop(ctx context.Context, groupName string, serviceName string, options *ServicesClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginStop" @@ -810,18 +811,19 @@ func (client *ServicesClient) stopCreateRequest(ctx context.Context, groupName s return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginUpdate - 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"). +// BeginUpdate - The services resource is the top-level resource that represents the Azure Database Migration Service (classic). +// The PATCH method updates an existing service. This method can change the kind, SKU, and +// network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request +// ("ServiceIsBusy"). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - parameters - Information about the service @@ -843,12 +845,13 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, groupName string, } } -// Update - 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 - The services resource is the top-level resource that represents the Azure Database Migration Service (classic). +// The PATCH method updates an existing service. This method can change the kind, SKU, and +// network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request +// ("ServiceIsBusy"). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview func (client *ServicesClient) update(ctx context.Context, groupName string, serviceName string, parameters Service, options *ServicesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginUpdate" @@ -890,7 +893,7 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, groupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/datamigration/armdatamigration/services_client_example_test.go b/sdk/resourcemanager/datamigration/armdatamigration/services_client_example_test.go deleted file mode 100644 index 3d96e3cb7557..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/services_client_example_test.go +++ /dev/null @@ -1,442 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdatamigration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Services_CreateOrUpdate.json -func ExampleServicesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "DmsSdkRg", "DmsSdkService", armdatamigration.Service{ - Location: to.Ptr("southcentralus"), - Properties: &armdatamigration.ServiceProperties{ - VirtualSubnetID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkTestNetwork/providers/Microsoft.Network/virtualNetworks/DmsSdkTestNetwork/subnets/default"), - }, - SKU: &armdatamigration.ServiceSKU{ - Name: to.Ptr("Basic_1vCore"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armdatamigration.Service{ - // Name: to.Ptr("DmsSdkService"), - // Type: to.Ptr("Microsoft.DataMigration/services"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService"), - // Location: to.Ptr("southcentralus"), - // Etag: to.Ptr("9QuK/U0GvTJpjIrlOzITXVy68+bmmQ3bFkHudLxmkUw="), - // Properties: &armdatamigration.ServiceProperties{ - // ProvisioningState: to.Ptr(armdatamigration.ServiceProvisioningStateSucceeded), - // VirtualSubnetID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkTestNetwork/providers/Microsoft.Network/virtualNetworks/DmsSdkTestNetwork/subnets/default"), - // }, - // SKU: &armdatamigration.ServiceSKU{ - // Name: to.Ptr("Basic_1vCore"), - // Size: to.Ptr("1 vCore"), - // Tier: to.Ptr("Basic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Services_Get.json -func ExampleServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Get(ctx, "DmsSdkRg", "DmsSdkService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armdatamigration.Service{ - // Name: to.Ptr("DmsSdkService"), - // Type: to.Ptr("Microsoft.DataMigration/services"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService"), - // Location: to.Ptr("southcentralus"), - // Etag: to.Ptr("qt85+bWDN84/6PR8Gllxf63krZcXZX1h3wxAbs6pCjc="), - // Properties: &armdatamigration.ServiceProperties{ - // ProvisioningState: to.Ptr(armdatamigration.ServiceProvisioningStateSucceeded), - // PublicKey: to.Ptr("0;AQAB;sCMXX00QDnuOIEQdXyY96h3VPSk3ccsBeYOGxntqg7y6oXbq4JbQHf8GnUhf5NsmUYBq1rO+6xSumIuLLANIIqNPpHCT8x7W+tcuShlju4fdSKfpyKbJnTJJzGLhRJYG97hDPo9D76qpEYQN66k0IfkKJVDTh7LAxqcE3lxdA98LB2EDM6vYoZ+raKXygYc1UUHDpkfksLk2YRTVCaayTFBh5HT/+CY+48V+rbx/nruvEEEbSg720m5Fc0k8ivM3A+RGkeK9pzQx+TtskSCDXiWL50a8Rrb5ORkBusgY+s0XLyKOuxZCIUOEO8JzUjCeZYdOfLJzx8yfTxEmSlOPqQ=="), - // VirtualSubnetID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkTestNetwork/providers/Microsoft.Network/virtualNetworks/DmsSdkTestNetwork/subnets/default"), - // }, - // SKU: &armdatamigration.ServiceSKU{ - // Name: to.Ptr("Basic_1vCore"), - // Size: to.Ptr("1 vCore"), - // Tier: to.Ptr("Basic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Services_Delete.json -func ExampleServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginDelete(ctx, "DmsSdkRg", "DmsSdkService", &armdatamigration.ServicesClientBeginDeleteOptions{DeleteRunningTasks: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Services_Update.json -func ExampleServicesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginUpdate(ctx, "DmsSdkRg", "DmsSdkService", armdatamigration.Service{ - Location: to.Ptr("southcentralus"), - Properties: &armdatamigration.ServiceProperties{ - VirtualSubnetID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkTestNetwork/providers/Microsoft.Network/virtualNetworks/DmsSdkTestNetwork/subnets/default"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armdatamigration.Service{ - // Name: to.Ptr("DmsSdkService"), - // Type: to.Ptr("Microsoft.DataMigration/services"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService"), - // Location: to.Ptr("southcentralus"), - // Etag: to.Ptr("9QuK/U0GvTJpjIrlOzITXVy68+bmmQ3bFkHudLxmkUw="), - // Properties: &armdatamigration.ServiceProperties{ - // ProvisioningState: to.Ptr(armdatamigration.ServiceProvisioningStateSucceeded), - // VirtualSubnetID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkTestNetwork/providers/Microsoft.Network/virtualNetworks/DmsSdkTestNetwork/subnets/default"), - // }, - // SKU: &armdatamigration.ServiceSKU{ - // Name: to.Ptr("Basic_1vCore"), - // Size: to.Ptr("1 vCore"), - // Tier: to.Ptr("Basic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Services_CheckStatus.json -func ExampleServicesClient_CheckStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().CheckStatus(ctx, "DmsSdkRg", "DmsSdkService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceStatusResponse = armdatamigration.ServiceStatusResponse{ - // AgentVersion: to.Ptr("3.3.3871.6"), - // Status: to.Ptr("Online"), - // SupportedTaskTypes: []*string{ - // to.Ptr("diagnostic.count"), - // to.Ptr("diagnostic.echo"), - // to.Ptr("diagnostic.error"), - // to.Ptr("diagnostic.fastCount"), - // to.Ptr("ConnectToSource.SqlServer.Sync"), - // to.Ptr("SyncMigrationOperationalTelemetry.LogCollector"), - // to.Ptr("GetUserTables.AzureSqlDb.Sync"), - // to.Ptr("ConnectToTarget.SqlDb.Sync"), - // to.Ptr("Migrate.MySql.AzureDbForMySql.Sync"), - // to.Ptr("Migrate.SqlServer.AzureSqlDb.Sync"), - // to.Ptr("ValidateMigrationInput.SqlServer.SqlDb.Sync"), - // to.Ptr("DataMigration.AzureSqlDbPostMigrationValidationScenarioId"), - // to.Ptr("GetTDECertificates.Sql"), - // to.Ptr("Migrate.SqlServer.AzureSqlDbMI"), - // to.Ptr("ValidateMigrationInput.SqlServer.AzureSqlDbMI"), - // to.Ptr("ConnectToTarget.AzureDbForMySql"), - // to.Ptr("ConnectToSource.SqlServer"), - // to.Ptr("GetUserTables.Sql"), - // to.Ptr("ConnectToTarget.AzureSqlDbMI"), - // to.Ptr("ConnectToTarget.SqlDb"), - // to.Ptr("Migrate.SqlServer.SqlDb"), - // to.Ptr("ConnectToSource.MySql")}, - // VMSize: to.Ptr("Standard_A4_v2"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Services_Start.json -func ExampleServicesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginStart(ctx, "DmsSdkRg", "DmsSdkService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Services_Stop.json -func ExampleServicesClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginStop(ctx, "DmsSdkRg", "DmsSdkService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Services_ListSkus.json -func ExampleServicesClient_NewListSKUsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServicesClient().NewListSKUsPager("DmsSdkRg", "DmsSdkService", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceSKUList = armdatamigration.ServiceSKUList{ - // Value: []*armdatamigration.AvailableServiceSKU{ - // { - // ResourceType: to.Ptr("Microsoft.DataMigration/services"), - // SKU: &armdatamigration.AvailableServiceSKUSKU{ - // Name: to.Ptr("Basic_1vCore"), - // Size: to.Ptr("1 vCore"), - // Tier: to.Ptr("Basic"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Services_CheckChildrenNameAvailability.json -func ExampleServicesClient_CheckChildrenNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().CheckChildrenNameAvailability(ctx, "DmsSdkRg", "DmsSdkService", armdatamigration.NameAvailabilityRequest{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NameAvailabilityResponse = armdatamigration.NameAvailabilityResponse{ - // NameAvailable: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Services_ListByResourceGroup.json -func ExampleServicesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServicesClient().NewListByResourceGroupPager("DmsSdkRg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceList = armdatamigration.ServiceList{ - // Value: []*armdatamigration.Service{ - // { - // Name: to.Ptr("DmsSdkService1"), - // Type: to.Ptr("Microsoft.DataMigration/services"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService1"), - // Location: to.Ptr("southcentralus"), - // SKU: &armdatamigration.ServiceSKU{ - // Name: to.Ptr("GeneralPurpose_4vCores"), - // Size: to.Ptr("4 vCores"), - // Tier: to.Ptr("General Purpose"), - // }, - // }, - // { - // Name: to.Ptr("DmsSdkService2"), - // Type: to.Ptr("Microsoft.DataMigration/services"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService2"), - // Location: to.Ptr("southcentralus"), - // SKU: &armdatamigration.ServiceSKU{ - // Name: to.Ptr("Basic_2vCores"), - // Size: to.Ptr("2 vCores"), - // Tier: to.Ptr("Basic"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Services_List.json -func ExampleServicesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServicesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceList = armdatamigration.ServiceList{ - // Value: []*armdatamigration.Service{ - // { - // Name: to.Ptr("DmsSdkService1"), - // Type: to.Ptr("Microsoft.DataMigration/services"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg1/providers/Microsoft.DataMigration/services/DmsSdkService1"), - // Location: to.Ptr("southcentralus"), - // SKU: &armdatamigration.ServiceSKU{ - // Name: to.Ptr("GeneralPurpose_4vCores"), - // Size: to.Ptr("4 vCores"), - // Tier: to.Ptr("General Purpose"), - // }, - // }, - // { - // Name: to.Ptr("DmsSdkService2"), - // Type: to.Ptr("Microsoft.DataMigration/services"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg2/providers/Microsoft.DataMigration/services/DmsSdkService2"), - // Location: to.Ptr("centralus"), - // SKU: &armdatamigration.ServiceSKU{ - // Name: to.Ptr("Basic_2vCores"), - // Size: to.Ptr("2 vCores"), - // Tier: to.Ptr("Basic"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Services_CheckNameAvailability.json -func ExampleServicesClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().CheckNameAvailability(ctx, "eastus", armdatamigration.NameAvailabilityRequest{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NameAvailabilityResponse = armdatamigration.NameAvailabilityResponse{ - // NameAvailable: to.Ptr(true), - // } -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/servicetasks_client.go b/sdk/resourcemanager/datamigration/armdatamigration/servicetasks_client.go index d684f5a183c9..19bc260d9190 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/servicetasks_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/servicetasks_client.go @@ -29,7 +29,7 @@ type ServiceTasksClient struct { } // NewServiceTasksClient creates a new instance of ServiceTasksClient with the specified values. -// - subscriptionID - Identifier of the subscription +// - subscriptionID - Subscription ID that identifies an Azure subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewServiceTasksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceTasksClient, error) { @@ -44,11 +44,11 @@ func NewServiceTasksClient(subscriptionID string, credential azcore.TokenCredent return client, nil } -// Cancel - 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. +// Cancel - The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. +// This method cancels a service task if it's currently queued or running. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - taskName - Name of the Task @@ -99,7 +99,7 @@ func (client *ServiceTasksClient) cancelCreateRequest(ctx context.Context, group return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,12 +114,12 @@ func (client *ServiceTasksClient) cancelHandleResponse(resp *http.Response) (Ser return result, nil } -// CreateOrUpdate - 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. +// CreateOrUpdate - The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) +// instance. The PUT method creates a new service task or updates an existing one, although +// since service tasks have no mutable custom properties, there is little reason to update an existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - taskName - Name of the Task @@ -172,7 +172,7 @@ func (client *ServiceTasksClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -190,11 +190,11 @@ func (client *ServiceTasksClient) createOrUpdateHandleResponse(resp *http.Respon return result, nil } -// Delete - 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 service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. +// The DELETE method deletes a service task, canceling it first if it's running. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - taskName - Name of the Task @@ -244,7 +244,7 @@ func (client *ServiceTasksClient) deleteCreateRequest(ctx context.Context, group return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") if options != nil && options.DeleteRunningTasks != nil { reqQP.Set("deleteRunningTasks", strconv.FormatBool(*options.DeleteRunningTasks)) } @@ -253,11 +253,11 @@ func (client *ServiceTasksClient) deleteCreateRequest(ctx context.Context, group return req, nil } -// Get - 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 - The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. +// The GET method retrieves information about a service task. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - taskName - Name of the Task @@ -308,10 +308,10 @@ func (client *ServiceTasksClient) getCreateRequest(ctx context.Context, groupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,11 +326,11 @@ func (client *ServiceTasksClient) getHandleResponse(resp *http.Response) (Servic return result, nil } -// NewListPager - 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. +// NewListPager - The services resource is the top-level resource that represents the Azure Database Migration Service (classic). +// This method returns a list of service level tasks owned by a service resource. Some +// tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - options - ServiceTasksClientListOptions contains the optional parameters for the ServiceTasksClient.NewListPager method. @@ -377,7 +377,7 @@ func (client *ServiceTasksClient) listCreateRequest(ctx context.Context, groupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") if options != nil && options.TaskType != nil { reqQP.Set("taskType", *options.TaskType) } @@ -395,12 +395,12 @@ func (client *ServiceTasksClient) listHandleResponse(resp *http.Response) (Servi return result, nil } -// Update - 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 - The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. +// The PATCH method updates an existing service task, but since service tasks have no +// mutable custom properties, there is little reason to do so. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - taskName - Name of the Task @@ -452,7 +452,7 @@ func (client *ServiceTasksClient) updateCreateRequest(ctx context.Context, group return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/datamigration/armdatamigration/servicetasks_client_example_test.go b/sdk/resourcemanager/datamigration/armdatamigration/servicetasks_client_example_test.go deleted file mode 100644 index 54e65701dc4b..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/servicetasks_client_example_test.go +++ /dev/null @@ -1,223 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdatamigration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/ServiceTasks_List.json -func ExampleServiceTasksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceTasksClient().NewListPager("DmsSdkRg", "DmsSdkService", &armdatamigration.ServiceTasksClientListOptions{TaskType: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TaskList = armdatamigration.TaskList{ - // Value: []*armdatamigration.ProjectTask{ - // { - // Name: to.Ptr("DmsSdkTask"), - // Type: to.Ptr("Microsoft.DataMigration/services/serviceTasks"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/serviceTasks/DmsSdkTask"), - // Etag: to.Ptr("0vPYxzfnDaDH9yhOJAnqTyTRpa09Kb7pm+LEukDBbw8="), - // Properties: &armdatamigration.CheckOCIDriverTaskProperties{ - // State: to.Ptr(armdatamigration.TaskStateQueued), - // TaskType: to.Ptr("Service.Check.OCI"), - // Input: &armdatamigration.CheckOCIDriverTaskInput{ - // ServerVersion: to.Ptr("NA"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/ServiceTasks_CreateOrUpdate.json -func ExampleServiceTasksClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceTasksClient().CreateOrUpdate(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkTask", armdatamigration.ProjectTask{ - Properties: &armdatamigration.CheckOCIDriverTaskProperties{ - TaskType: to.Ptr("Service.Check.OCI"), - Input: &armdatamigration.CheckOCIDriverTaskInput{ - ServerVersion: to.Ptr("NA"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProjectTask = armdatamigration.ProjectTask{ - // Name: to.Ptr("DmsSdkTask"), - // Type: to.Ptr("Microsoft.DataMigration/services/serviceTasks"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/serviceTasks/DmsSdkTask"), - // Etag: to.Ptr("0vPYxzfnDaDH9yhOJAnqTyTRpa09Kb7pm+LEukDBbw8="), - // Properties: &armdatamigration.CheckOCIDriverTaskProperties{ - // State: to.Ptr(armdatamigration.TaskStateQueued), - // TaskType: to.Ptr("Service.Check.OCI"), - // Input: &armdatamigration.CheckOCIDriverTaskInput{ - // ServerVersion: to.Ptr("NA"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/ServiceTasks_Get.json -func ExampleServiceTasksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceTasksClient().Get(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkTask", &armdatamigration.ServiceTasksClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProjectTask = armdatamigration.ProjectTask{ - // Name: to.Ptr("DmsSdkTask"), - // Type: to.Ptr("Microsoft.DataMigration/services/serviceTasks"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/serviceTasks/DmsSdkTask"), - // Etag: to.Ptr("0vPYxzfnDaDH9yhOJAnqTyTRpa09Kb7pm+LEukDBbw8="), - // Properties: &armdatamigration.CheckOCIDriverTaskProperties{ - // State: to.Ptr(armdatamigration.TaskStateQueued), - // TaskType: to.Ptr("Service.Check.OCI"), - // Input: &armdatamigration.CheckOCIDriverTaskInput{ - // ServerVersion: to.Ptr("NA"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/ServiceTasks_Delete.json -func ExampleServiceTasksClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewServiceTasksClient().Delete(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkTask", &armdatamigration.ServiceTasksClientDeleteOptions{DeleteRunningTasks: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/ServiceTasks_Update.json -func ExampleServiceTasksClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceTasksClient().Update(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkTask", armdatamigration.ProjectTask{ - Properties: &armdatamigration.CheckOCIDriverTaskProperties{ - TaskType: to.Ptr("Service.Check.OCI"), - Input: &armdatamigration.CheckOCIDriverTaskInput{ - ServerVersion: to.Ptr("NA"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProjectTask = armdatamigration.ProjectTask{ - // Name: to.Ptr("DmsSdkTask"), - // Type: to.Ptr("Microsoft.DataMigration/services/serviceTasks"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/serviceTasks/DmsSdkTask"), - // Etag: to.Ptr("0vPYxzfnDaDH9yhOJAnqTyTRpa09Kb7pm+LEukDBbw8="), - // Properties: &armdatamigration.CheckOCIDriverTaskProperties{ - // State: to.Ptr(armdatamigration.TaskStateQueued), - // TaskType: to.Ptr("Service.Check.OCI"), - // Input: &armdatamigration.CheckOCIDriverTaskInput{ - // ServerVersion: to.Ptr("NA"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/ServiceTasks_Cancel.json -func ExampleServiceTasksClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceTasksClient().Cancel(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkTask", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProjectTask = armdatamigration.ProjectTask{ - // Name: to.Ptr("DmsSdkTask"), - // Type: to.Ptr("Microsoft.DataMigration/services/serviceTasks"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/serviceTasks/DmsSdkTask"), - // Etag: to.Ptr("0vPYxzfnDaDH9yhOJAnqTyTRpa09Kb7pm+LEukDBbw8="), - // Properties: &armdatamigration.CheckOCIDriverTaskProperties{ - // State: to.Ptr(armdatamigration.TaskStateQueued), - // TaskType: to.Ptr("Service.Check.OCI"), - // Input: &armdatamigration.CheckOCIDriverTaskInput{ - // ServerVersion: to.Ptr("NA"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/sqlmigrationservices_client.go b/sdk/resourcemanager/datamigration/armdatamigration/sqlmigrationservices_client.go new file mode 100644 index 000000000000..6f35269c704e --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/sqlmigrationservices_client.go @@ -0,0 +1,803 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdatamigration + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// SQLMigrationServicesClient contains the methods for the SQLMigrationServices group. +// Don't use this type directly, use NewSQLMigrationServicesClient() instead. +type SQLMigrationServicesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSQLMigrationServicesClient creates a new instance of SQLMigrationServicesClient with the specified values. +// - subscriptionID - Subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSQLMigrationServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SQLMigrationServicesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SQLMigrationServicesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or Update Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - sqlMigrationServiceName - Name of the SQL Migration Service. +// - parameters - Details of SqlMigrationService resource. +// - options - SQLMigrationServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the SQLMigrationServicesClient.BeginCreateOrUpdate +// method. +func (client *SQLMigrationServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters SQLMigrationService, options *SQLMigrationServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SQLMigrationServicesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, sqlMigrationServiceName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SQLMigrationServicesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SQLMigrationServicesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or Update Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *SQLMigrationServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters SQLMigrationService, options *SQLMigrationServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "SQLMigrationServicesClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SQLMigrationServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters SQLMigrationService, options *SQLMigrationServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlMigrationServiceName == "" { + return nil, errors.New("parameter sqlMigrationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlMigrationServiceName}", url.PathEscape(sqlMigrationServiceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - sqlMigrationServiceName - Name of the SQL Migration Service. +// - options - SQLMigrationServicesClientBeginDeleteOptions contains the optional parameters for the SQLMigrationServicesClient.BeginDelete +// method. +func (client *SQLMigrationServicesClient) BeginDelete(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *SQLMigrationServicesClientBeginDeleteOptions) (*runtime.Poller[SQLMigrationServicesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, sqlMigrationServiceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SQLMigrationServicesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SQLMigrationServicesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *SQLMigrationServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *SQLMigrationServicesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "SQLMigrationServicesClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SQLMigrationServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *SQLMigrationServicesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlMigrationServiceName == "" { + return nil, errors.New("parameter sqlMigrationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlMigrationServiceName}", url.PathEscape(sqlMigrationServiceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// DeleteNode - Delete the integration runtime node. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - sqlMigrationServiceName - Name of the SQL Migration Service. +// - parameters - Details of SqlMigrationService resource. +// - options - SQLMigrationServicesClientDeleteNodeOptions contains the optional parameters for the SQLMigrationServicesClient.DeleteNode +// method. +func (client *SQLMigrationServicesClient) DeleteNode(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters DeleteNode, options *SQLMigrationServicesClientDeleteNodeOptions) (SQLMigrationServicesClientDeleteNodeResponse, error) { + var err error + const operationName = "SQLMigrationServicesClient.DeleteNode" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteNodeCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, parameters, options) + if err != nil { + return SQLMigrationServicesClientDeleteNodeResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SQLMigrationServicesClientDeleteNodeResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLMigrationServicesClientDeleteNodeResponse{}, err + } + resp, err := client.deleteNodeHandleResponse(httpResp) + return resp, err +} + +// deleteNodeCreateRequest creates the DeleteNode request. +func (client *SQLMigrationServicesClient) deleteNodeCreateRequest(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters DeleteNode, options *SQLMigrationServicesClientDeleteNodeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/deleteNode" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlMigrationServiceName == "" { + return nil, errors.New("parameter sqlMigrationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlMigrationServiceName}", url.PathEscape(sqlMigrationServiceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// deleteNodeHandleResponse handles the DeleteNode response. +func (client *SQLMigrationServicesClient) deleteNodeHandleResponse(resp *http.Response) (SQLMigrationServicesClientDeleteNodeResponse, error) { + result := SQLMigrationServicesClientDeleteNodeResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DeleteNode); err != nil { + return SQLMigrationServicesClientDeleteNodeResponse{}, err + } + return result, nil +} + +// Get - Retrieve the Database Migration Service +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - sqlMigrationServiceName - Name of the SQL Migration Service. +// - options - SQLMigrationServicesClientGetOptions contains the optional parameters for the SQLMigrationServicesClient.Get +// method. +func (client *SQLMigrationServicesClient) Get(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *SQLMigrationServicesClientGetOptions) (SQLMigrationServicesClientGetResponse, error) { + var err error + const operationName = "SQLMigrationServicesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, options) + if err != nil { + return SQLMigrationServicesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SQLMigrationServicesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLMigrationServicesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SQLMigrationServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *SQLMigrationServicesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlMigrationServiceName == "" { + return nil, errors.New("parameter sqlMigrationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlMigrationServiceName}", url.PathEscape(sqlMigrationServiceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SQLMigrationServicesClient) getHandleResponse(resp *http.Response) (SQLMigrationServicesClientGetResponse, error) { + result := SQLMigrationServicesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SQLMigrationService); err != nil { + return SQLMigrationServicesClientGetResponse{}, err + } + return result, nil +} + +// ListAuthKeys - Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - sqlMigrationServiceName - Name of the SQL Migration Service. +// - options - SQLMigrationServicesClientListAuthKeysOptions contains the optional parameters for the SQLMigrationServicesClient.ListAuthKeys +// method. +func (client *SQLMigrationServicesClient) ListAuthKeys(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *SQLMigrationServicesClientListAuthKeysOptions) (SQLMigrationServicesClientListAuthKeysResponse, error) { + var err error + const operationName = "SQLMigrationServicesClient.ListAuthKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.listAuthKeysCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, options) + if err != nil { + return SQLMigrationServicesClientListAuthKeysResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SQLMigrationServicesClientListAuthKeysResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLMigrationServicesClientListAuthKeysResponse{}, err + } + resp, err := client.listAuthKeysHandleResponse(httpResp) + return resp, err +} + +// listAuthKeysCreateRequest creates the ListAuthKeys request. +func (client *SQLMigrationServicesClient) listAuthKeysCreateRequest(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *SQLMigrationServicesClientListAuthKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listAuthKeys" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlMigrationServiceName == "" { + return nil, errors.New("parameter sqlMigrationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlMigrationServiceName}", url.PathEscape(sqlMigrationServiceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAuthKeysHandleResponse handles the ListAuthKeys response. +func (client *SQLMigrationServicesClient) listAuthKeysHandleResponse(resp *http.Response) (SQLMigrationServicesClientListAuthKeysResponse, error) { + result := SQLMigrationServicesClientListAuthKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AuthenticationKeys); err != nil { + return SQLMigrationServicesClientListAuthKeysResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Retrieve all SQL migration services in the resource group. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - options - SQLMigrationServicesClientListByResourceGroupOptions contains the optional parameters for the SQLMigrationServicesClient.NewListByResourceGroupPager +// method. +func (client *SQLMigrationServicesClient) NewListByResourceGroupPager(resourceGroupName string, options *SQLMigrationServicesClientListByResourceGroupOptions) *runtime.Pager[SQLMigrationServicesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[SQLMigrationServicesClientListByResourceGroupResponse]{ + More: func(page SQLMigrationServicesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SQLMigrationServicesClientListByResourceGroupResponse) (SQLMigrationServicesClientListByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SQLMigrationServicesClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return SQLMigrationServicesClientListByResourceGroupResponse{}, err + } + return client.listByResourceGroupHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *SQLMigrationServicesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SQLMigrationServicesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *SQLMigrationServicesClient) listByResourceGroupHandleResponse(resp *http.Response) (SQLMigrationServicesClientListByResourceGroupResponse, error) { + result := SQLMigrationServicesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SQLMigrationListResult); err != nil { + return SQLMigrationServicesClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Retrieve all SQL migration services in the subscriptions. +// +// Generated from API version 2023-07-15-preview +// - options - SQLMigrationServicesClientListBySubscriptionOptions contains the optional parameters for the SQLMigrationServicesClient.NewListBySubscriptionPager +// method. +func (client *SQLMigrationServicesClient) NewListBySubscriptionPager(options *SQLMigrationServicesClientListBySubscriptionOptions) *runtime.Pager[SQLMigrationServicesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[SQLMigrationServicesClientListBySubscriptionResponse]{ + More: func(page SQLMigrationServicesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SQLMigrationServicesClientListBySubscriptionResponse) (SQLMigrationServicesClientListBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SQLMigrationServicesClient.NewListBySubscriptionPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, nil) + if err != nil { + return SQLMigrationServicesClientListBySubscriptionResponse{}, err + } + return client.listBySubscriptionHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *SQLMigrationServicesClient) listBySubscriptionCreateRequest(ctx context.Context, options *SQLMigrationServicesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/sqlMigrationServices" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *SQLMigrationServicesClient) listBySubscriptionHandleResponse(resp *http.Response) (SQLMigrationServicesClientListBySubscriptionResponse, error) { + result := SQLMigrationServicesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SQLMigrationListResult); err != nil { + return SQLMigrationServicesClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// NewListMigrationsPager - Retrieve the List of database migrations attached to the service. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - sqlMigrationServiceName - Name of the SQL Migration Service. +// - options - SQLMigrationServicesClientListMigrationsOptions contains the optional parameters for the SQLMigrationServicesClient.NewListMigrationsPager +// method. +func (client *SQLMigrationServicesClient) NewListMigrationsPager(resourceGroupName string, sqlMigrationServiceName string, options *SQLMigrationServicesClientListMigrationsOptions) *runtime.Pager[SQLMigrationServicesClientListMigrationsResponse] { + return runtime.NewPager(runtime.PagingHandler[SQLMigrationServicesClientListMigrationsResponse]{ + More: func(page SQLMigrationServicesClientListMigrationsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SQLMigrationServicesClientListMigrationsResponse) (SQLMigrationServicesClientListMigrationsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SQLMigrationServicesClient.NewListMigrationsPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listMigrationsCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, options) + }, nil) + if err != nil { + return SQLMigrationServicesClientListMigrationsResponse{}, err + } + return client.listMigrationsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listMigrationsCreateRequest creates the ListMigrations request. +func (client *SQLMigrationServicesClient) listMigrationsCreateRequest(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *SQLMigrationServicesClientListMigrationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listMigrations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlMigrationServiceName == "" { + return nil, errors.New("parameter sqlMigrationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlMigrationServiceName}", url.PathEscape(sqlMigrationServiceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listMigrationsHandleResponse handles the ListMigrations response. +func (client *SQLMigrationServicesClient) listMigrationsHandleResponse(resp *http.Response) (SQLMigrationServicesClientListMigrationsResponse, error) { + result := SQLMigrationServicesClientListMigrationsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseMigrationListResult); err != nil { + return SQLMigrationServicesClientListMigrationsResponse{}, err + } + return result, nil +} + +// ListMonitoringData - Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration +// Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - sqlMigrationServiceName - Name of the SQL Migration Service. +// - options - SQLMigrationServicesClientListMonitoringDataOptions contains the optional parameters for the SQLMigrationServicesClient.ListMonitoringData +// method. +func (client *SQLMigrationServicesClient) ListMonitoringData(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *SQLMigrationServicesClientListMonitoringDataOptions) (SQLMigrationServicesClientListMonitoringDataResponse, error) { + var err error + const operationName = "SQLMigrationServicesClient.ListMonitoringData" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.listMonitoringDataCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, options) + if err != nil { + return SQLMigrationServicesClientListMonitoringDataResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SQLMigrationServicesClientListMonitoringDataResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLMigrationServicesClientListMonitoringDataResponse{}, err + } + resp, err := client.listMonitoringDataHandleResponse(httpResp) + return resp, err +} + +// listMonitoringDataCreateRequest creates the ListMonitoringData request. +func (client *SQLMigrationServicesClient) listMonitoringDataCreateRequest(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *SQLMigrationServicesClientListMonitoringDataOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listMonitoringData" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlMigrationServiceName == "" { + return nil, errors.New("parameter sqlMigrationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlMigrationServiceName}", url.PathEscape(sqlMigrationServiceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listMonitoringDataHandleResponse handles the ListMonitoringData response. +func (client *SQLMigrationServicesClient) listMonitoringDataHandleResponse(resp *http.Response) (SQLMigrationServicesClientListMonitoringDataResponse, error) { + result := SQLMigrationServicesClientListMonitoringDataResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.IntegrationRuntimeMonitoringData); err != nil { + return SQLMigrationServicesClientListMonitoringDataResponse{}, err + } + return result, nil +} + +// RegenerateAuthKeys - Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - sqlMigrationServiceName - Name of the SQL Migration Service. +// - parameters - Details of SqlMigrationService resource. +// - options - SQLMigrationServicesClientRegenerateAuthKeysOptions contains the optional parameters for the SQLMigrationServicesClient.RegenerateAuthKeys +// method. +func (client *SQLMigrationServicesClient) RegenerateAuthKeys(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters RegenAuthKeys, options *SQLMigrationServicesClientRegenerateAuthKeysOptions) (SQLMigrationServicesClientRegenerateAuthKeysResponse, error) { + var err error + const operationName = "SQLMigrationServicesClient.RegenerateAuthKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.regenerateAuthKeysCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, parameters, options) + if err != nil { + return SQLMigrationServicesClientRegenerateAuthKeysResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SQLMigrationServicesClientRegenerateAuthKeysResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLMigrationServicesClientRegenerateAuthKeysResponse{}, err + } + resp, err := client.regenerateAuthKeysHandleResponse(httpResp) + return resp, err +} + +// regenerateAuthKeysCreateRequest creates the RegenerateAuthKeys request. +func (client *SQLMigrationServicesClient) regenerateAuthKeysCreateRequest(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters RegenAuthKeys, options *SQLMigrationServicesClientRegenerateAuthKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/regenerateAuthKeys" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlMigrationServiceName == "" { + return nil, errors.New("parameter sqlMigrationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlMigrationServiceName}", url.PathEscape(sqlMigrationServiceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// regenerateAuthKeysHandleResponse handles the RegenerateAuthKeys response. +func (client *SQLMigrationServicesClient) regenerateAuthKeysHandleResponse(resp *http.Response) (SQLMigrationServicesClientRegenerateAuthKeysResponse, error) { + result := SQLMigrationServicesClientRegenerateAuthKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RegenAuthKeys); err != nil { + return SQLMigrationServicesClientRegenerateAuthKeysResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +// - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - sqlMigrationServiceName - Name of the SQL Migration Service. +// - parameters - Details of SqlMigrationService resource. +// - options - SQLMigrationServicesClientBeginUpdateOptions contains the optional parameters for the SQLMigrationServicesClient.BeginUpdate +// method. +func (client *SQLMigrationServicesClient) BeginUpdate(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters SQLMigrationServiceUpdate, options *SQLMigrationServicesClientBeginUpdateOptions) (*runtime.Poller[SQLMigrationServicesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, sqlMigrationServiceName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SQLMigrationServicesClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SQLMigrationServicesClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Update Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-15-preview +func (client *SQLMigrationServicesClient) update(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters SQLMigrationServiceUpdate, options *SQLMigrationServicesClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "SQLMigrationServicesClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *SQLMigrationServicesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters SQLMigrationServiceUpdate, options *SQLMigrationServicesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if sqlMigrationServiceName == "" { + return nil, errors.New("parameter sqlMigrationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlMigrationServiceName}", url.PathEscape(sqlMigrationServiceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/tasks_client.go b/sdk/resourcemanager/datamigration/armdatamigration/tasks_client.go index a2896a70bc5e..21e7deac904b 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/tasks_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/tasks_client.go @@ -29,7 +29,7 @@ type TasksClient struct { } // NewTasksClient creates a new instance of TasksClient with the specified values. -// - subscriptionID - Identifier of the subscription +// - subscriptionID - Subscription ID that identifies an Azure subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewTasksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TasksClient, error) { @@ -44,11 +44,11 @@ func NewTasksClient(subscriptionID string, credential azcore.TokenCredential, op return client, nil } -// Cancel - 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. +// Cancel - The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This +// method cancels a task if it's currently queued or running. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -104,7 +104,7 @@ func (client *TasksClient) cancelCreateRequest(ctx context.Context, groupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,11 +119,11 @@ func (client *TasksClient) cancelHandleResponse(resp *http.Response) (TasksClien return result, nil } -// Command - 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 - The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. +// This method executes a command on a running task. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -180,7 +180,7 @@ func (client *TasksClient) commandCreateRequest(ctx context.Context, groupName s return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -198,12 +198,12 @@ func (client *TasksClient) commandHandleResponse(resp *http.Response) (TasksClie return result, nil } -// CreateOrUpdate - 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. +// CreateOrUpdate - The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. +// The PUT method creates a new task or updates an existing one, although since tasks have no +// mutable custom properties, there is little reason to update an existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -260,7 +260,7 @@ func (client *TasksClient) createOrUpdateCreateRequest(ctx context.Context, grou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -278,11 +278,11 @@ func (client *TasksClient) createOrUpdateHandleResponse(resp *http.Response) (Ta return result, nil } -// Delete - 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 tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The +// DELETE method deletes a task, canceling it first if it's running. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -337,7 +337,7 @@ func (client *TasksClient) deleteCreateRequest(ctx context.Context, groupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") if options != nil && options.DeleteRunningTasks != nil { reqQP.Set("deleteRunningTasks", strconv.FormatBool(*options.DeleteRunningTasks)) } @@ -346,11 +346,11 @@ func (client *TasksClient) deleteCreateRequest(ctx context.Context, groupName st return req, nil } -// Get - 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 - The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The +// GET method retrieves information about a task. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -406,10 +406,10 @@ func (client *TasksClient) getCreateRequest(ctx context.Context, groupName strin return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -424,11 +424,11 @@ func (client *TasksClient) getHandleResponse(resp *http.Response) (TasksClientGe return result, nil } -// NewListPager - 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. +// NewListPager - The services resource is the top-level resource that represents the Azure Database Migration Service (classic). +// This method returns a list of tasks owned by a service resource. Some tasks may have a +// status of Unknown, which indicates that an error occurred while querying the status of that task. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -480,7 +480,7 @@ func (client *TasksClient) listCreateRequest(ctx context.Context, groupName stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") if options != nil && options.TaskType != nil { reqQP.Set("taskType", *options.TaskType) } @@ -498,12 +498,12 @@ func (client *TasksClient) listHandleResponse(resp *http.Response) (TasksClientL return result, nil } -// Update - 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. +// Update - The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The +// PATCH method updates an existing task, but since tasks have no mutable custom +// properties, there is little reason to do so. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - groupName - Name of the resource group // - serviceName - Name of the service // - projectName - Name of the project @@ -560,7 +560,7 @@ func (client *TasksClient) updateCreateRequest(ctx context.Context, groupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/datamigration/armdatamigration/tasks_client_example_test.go b/sdk/resourcemanager/datamigration/armdatamigration/tasks_client_example_test.go deleted file mode 100644 index dbf9977e497f..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/tasks_client_example_test.go +++ /dev/null @@ -1,308 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdatamigration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Tasks_List.json -func ExampleTasksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTasksClient().NewListPager("DmsSdkRg", "DmsSdkService", "DmsSdkProject", &armdatamigration.TasksClientListOptions{TaskType: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TaskList = armdatamigration.TaskList{ - // Value: []*armdatamigration.ProjectTask{ - // { - // Name: to.Ptr("DmsSdkTask"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects/tasks"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/DmsSdkProject/tasks/DmsSdkTask"), - // Etag: to.Ptr("0vPYxzfnDaDH9yhOJAnqTyTRpa09Kb7pm+LEukDBbw8="), - // Properties: &armdatamigration.ConnectToTargetSQLDbTaskProperties{ - // State: to.Ptr(armdatamigration.TaskStateQueued), - // TaskType: to.Ptr("ConnectToTarget.SqlDb"), - // Input: &armdatamigration.ConnectToTargetSQLDbTaskInput{ - // TargetConnectionInfo: &armdatamigration.SQLConnectionInfo{ - // Type: to.Ptr("SqlConnectionInfo"), - // UserName: to.Ptr("testuser"), - // Authentication: to.Ptr(armdatamigration.AuthenticationTypeSQLAuthentication), - // DataSource: to.Ptr("ssma-test-server.database.windows.net"), - // EncryptConnection: to.Ptr(true), - // TrustServerCertificate: to.Ptr(true), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Tasks_CreateOrUpdate.json -func ExampleTasksClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTasksClient().CreateOrUpdate(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", armdatamigration.ProjectTask{ - Properties: &armdatamigration.ConnectToTargetSQLDbTaskProperties{ - TaskType: to.Ptr("ConnectToTarget.SqlDb"), - Input: &armdatamigration.ConnectToTargetSQLDbTaskInput{ - TargetConnectionInfo: &armdatamigration.SQLConnectionInfo{ - Type: to.Ptr("SqlConnectionInfo"), - Password: to.Ptr("testpassword"), - UserName: to.Ptr("testuser"), - Authentication: to.Ptr(armdatamigration.AuthenticationTypeSQLAuthentication), - DataSource: to.Ptr("ssma-test-server.database.windows.net"), - EncryptConnection: to.Ptr(true), - TrustServerCertificate: to.Ptr(true), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProjectTask = armdatamigration.ProjectTask{ - // Name: to.Ptr("DmsSdkTask"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects/tasks"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/DmsSdkProject/tasks/DmsSdkTask"), - // Etag: to.Ptr("0vPYxzfnDaDH9yhOJAnqTyTRpa09Kb7pm+LEukDBbw8="), - // Properties: &armdatamigration.ConnectToTargetSQLDbTaskProperties{ - // State: to.Ptr(armdatamigration.TaskStateQueued), - // TaskType: to.Ptr("ConnectToTarget.SqlDb"), - // Input: &armdatamigration.ConnectToTargetSQLDbTaskInput{ - // TargetConnectionInfo: &armdatamigration.SQLConnectionInfo{ - // Type: to.Ptr("SqlConnectionInfo"), - // UserName: to.Ptr("testuser"), - // Authentication: to.Ptr(armdatamigration.AuthenticationTypeSQLAuthentication), - // DataSource: to.Ptr("ssma-test-server.database.windows.net"), - // EncryptConnection: to.Ptr(true), - // TrustServerCertificate: to.Ptr(true), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Tasks_Get.json -func ExampleTasksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTasksClient().Get(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", &armdatamigration.TasksClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProjectTask = armdatamigration.ProjectTask{ - // Name: to.Ptr("DmsSdkTask"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects/tasks"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/DmsSdkProject/tasks/DmsSdkTask"), - // Etag: to.Ptr("0vPYxzfnDaDH9yhOJAnqTyTRpa09Kb7pm+LEukDBbw8="), - // Properties: &armdatamigration.ConnectToTargetSQLDbTaskProperties{ - // State: to.Ptr(armdatamigration.TaskStateQueued), - // TaskType: to.Ptr("ConnectToTarget.SqlDb"), - // Input: &armdatamigration.ConnectToTargetSQLDbTaskInput{ - // TargetConnectionInfo: &armdatamigration.SQLConnectionInfo{ - // Type: to.Ptr("SqlConnectionInfo"), - // UserName: to.Ptr("testuser"), - // Authentication: to.Ptr(armdatamigration.AuthenticationTypeSQLAuthentication), - // DataSource: to.Ptr("ssma-test-server.database.windows.net"), - // EncryptConnection: to.Ptr(true), - // TrustServerCertificate: to.Ptr(true), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Tasks_Delete.json -func ExampleTasksClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewTasksClient().Delete(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", &armdatamigration.TasksClientDeleteOptions{DeleteRunningTasks: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Tasks_Update.json -func ExampleTasksClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTasksClient().Update(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", armdatamigration.ProjectTask{ - Properties: &armdatamigration.ConnectToTargetSQLDbTaskProperties{ - TaskType: to.Ptr("ConnectToTarget.SqlDb"), - Input: &armdatamigration.ConnectToTargetSQLDbTaskInput{ - TargetConnectionInfo: &armdatamigration.SQLConnectionInfo{ - Type: to.Ptr("SqlConnectionInfo"), - Password: to.Ptr("testpassword"), - UserName: to.Ptr("testuser"), - Authentication: to.Ptr(armdatamigration.AuthenticationTypeSQLAuthentication), - DataSource: to.Ptr("ssma-test-server.database.windows.net"), - EncryptConnection: to.Ptr(true), - TrustServerCertificate: to.Ptr(true), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProjectTask = armdatamigration.ProjectTask{ - // Name: to.Ptr("DmsSdkTask"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects/tasks"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/DmsSdkProject/tasks/DmsSdkTask"), - // Etag: to.Ptr("0vPYxzfnDaDH9yhOJAnqTyTRpa09Kb7pm+LEukDBbw8="), - // Properties: &armdatamigration.ConnectToTargetSQLDbTaskProperties{ - // State: to.Ptr(armdatamigration.TaskStateQueued), - // TaskType: to.Ptr("ConnectToTarget.SqlDb"), - // Input: &armdatamigration.ConnectToTargetSQLDbTaskInput{ - // TargetConnectionInfo: &armdatamigration.SQLConnectionInfo{ - // Type: to.Ptr("SqlConnectionInfo"), - // UserName: to.Ptr("testuser"), - // Authentication: to.Ptr(armdatamigration.AuthenticationTypeSQLAuthentication), - // DataSource: to.Ptr("ssma-test-server.database.windows.net"), - // EncryptConnection: to.Ptr(true), - // TrustServerCertificate: to.Ptr(true), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Tasks_Cancel.json -func ExampleTasksClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTasksClient().Cancel(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProjectTask = armdatamigration.ProjectTask{ - // Name: to.Ptr("DmsSdkTask"), - // Type: to.Ptr("Microsoft.DataMigration/services/projects/tasks"), - // ID: to.Ptr("/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkRg/providers/Microsoft.DataMigration/services/DmsSdkService/projects/DmsSdkProject/tasks/DmsSdkTask"), - // Etag: to.Ptr("0vPYxzfnDaDH9yhOJAnqTyTRpa09Kb7pm+LEukDBbw8="), - // Properties: &armdatamigration.ConnectToTargetSQLDbTaskProperties{ - // State: to.Ptr(armdatamigration.TaskStateQueued), - // TaskType: to.Ptr("ConnectToTarget.SqlDb"), - // Input: &armdatamigration.ConnectToTargetSQLDbTaskInput{ - // TargetConnectionInfo: &armdatamigration.SQLConnectionInfo{ - // Type: to.Ptr("SqlConnectionInfo"), - // UserName: to.Ptr("testuser"), - // Authentication: to.Ptr(armdatamigration.AuthenticationTypeSQLAuthentication), - // DataSource: to.Ptr("ssma-test-server.database.windows.net"), - // EncryptConnection: to.Ptr(true), - // TrustServerCertificate: to.Ptr(true), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Tasks_Command.json -func ExampleTasksClient_Command() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTasksClient().Command(ctx, "DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", &armdatamigration.MigrateSyncCompleteCommandProperties{ - CommandType: to.Ptr("Migrate.Sync.Complete.Database"), - Input: &armdatamigration.MigrateSyncCompleteCommandInput{ - DatabaseName: to.Ptr("TestDatabase"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armdatamigration.TasksClientCommandResponse{ - // CommandPropertiesClassification: &armdatamigration.MigrateSyncCompleteCommandProperties{ - // CommandType: to.Ptr("Migrate.Sync.Complete.Database"), - // State: to.Ptr(armdatamigration.CommandStateAccepted), - // Input: &armdatamigration.MigrateSyncCompleteCommandInput{ - // DatabaseName: to.Ptr("TestDatabase"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/time_rfc3339.go b/sdk/resourcemanager/datamigration/armdatamigration/time_rfc3339.go index c4509d97f817..2baed17b377f 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/time_rfc3339.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/datamigration/armdatamigration/usages_client.go b/sdk/resourcemanager/datamigration/armdatamigration/usages_client.go index d680219e1b23..f483feeb4474 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/usages_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/usages_client.go @@ -28,7 +28,7 @@ type UsagesClient struct { } // NewUsagesClient creates a new instance of UsagesClient with the specified values. -// - subscriptionID - Identifier of the subscription +// - subscriptionID - Subscription ID that identifies an Azure subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsagesClient, error) { @@ -43,9 +43,10 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o return client, nil } -// NewListPager - This method returns region-specific quotas and resource usage information for the Database Migration Service. +// NewListPager - This method returns region-specific quotas and resource usage information for the Azure Database Migration +// Service (classic). // -// Generated from API version 2021-06-30 +// Generated from API version 2023-07-15-preview // - location - The Azure region of the operation // - options - UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. func (client *UsagesClient) NewListPager(location string, options *UsagesClientListOptions) *runtime.Pager[UsagesClientListResponse] { @@ -87,7 +88,7 @@ func (client *UsagesClient) listCreateRequest(ctx context.Context, location stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2023-07-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/datamigration/armdatamigration/usages_client_example_test.go b/sdk/resourcemanager/datamigration/armdatamigration/usages_client_example_test.go deleted file mode 100644 index dfd5ac16b6b8..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/usages_client_example_test.go +++ /dev/null @@ -1,56 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdatamigration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2021-06-30/examples/Usages_List.json -func ExampleUsagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatamigration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsagesClient().NewListPager("westus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.QuotaList = armdatamigration.QuotaList{ - // Value: []*armdatamigration.Quota{ - // { - // Name: &armdatamigration.QuotaName{ - // LocalizedValue: to.Ptr("DMS service instances per region"), - // Value: to.Ptr("Services"), - // }, - // CurrentValue: to.Ptr[float64](1), - // ID: to.Ptr("/subscriptions/90fb80a6-0f71-4761-8f03-921e7396f3c0/providers/Microsoft.DataMigration/locations/westus/usages/Services"), - // Limit: to.Ptr[float64](2), - // Unit: to.Ptr("Count"), - // }}, - // } - } -}