diff --git a/sdk/resourcemanager/datamigration/armdatamigration/CHANGELOG.md b/sdk/resourcemanager/datamigration/armdatamigration/CHANGELOG.md index 89f16225b0c0..76794c4b1046 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/CHANGELOG.md +++ b/sdk/resourcemanager/datamigration/armdatamigration/CHANGELOG.md @@ -1,5 +1,226 @@ # Release History +## 2.0.0-beta.1 (2023-01-17) +### Breaking Changes + +- 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 `ProjectTaskProperties.TaskType` has been changed from `*string` to `*TaskType` +- 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 type alias `ServerLevelPermissionsGroup` +- New type alias `CommandType` with values `CommandTypeCancel`, `CommandTypeFinish`, `CommandTypeMigrateSQLServerAzureDbSQLMiComplete`, `CommandTypeMigrateSyncCompleteDatabase`, `CommandTypeRestart` +- New type alias `OperationOrigin` with values `OperationOriginSystem`, `OperationOriginUser` +- New type alias `ResourceType` with values `ResourceTypeSQLDb`, `ResourceTypeSQLMi`, `ResourceTypeSQLVM` +- New type alias `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 `*DatabaseMigrationProperties.GetDatabaseMigrationProperties() *DatabaseMigrationProperties` +- New function `*DatabaseMigrationPropertiesSQLDb.GetDatabaseMigrationProperties() *DatabaseMigrationProperties` +- New function `*DatabaseMigrationPropertiesSQLMi.GetDatabaseMigrationProperties() *DatabaseMigrationProperties` +- New function `*DatabaseMigrationPropertiesSQLVM.GetDatabaseMigrationProperties() *DatabaseMigrationProperties` +- 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 `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 `DatabaseMigrationListResult` +- New struct `DatabaseMigrationPropertiesSQLDb` +- New struct `DatabaseMigrationPropertiesSQLMi` +- New struct `DatabaseMigrationPropertiesSQLVM` +- New struct `DatabaseMigrationSQLDb` +- New struct `DatabaseMigrationSQLMi` +- New struct `DatabaseMigrationSQLVM` +- New struct `DatabaseMigrationsSQLDbClient` +- New struct `DatabaseMigrationsSQLDbClientCancelResponse` +- New struct `DatabaseMigrationsSQLDbClientCreateOrUpdateResponse` +- New struct `DatabaseMigrationsSQLDbClientDeleteResponse` +- New struct `DatabaseMigrationsSQLMiClient` +- New struct `DatabaseMigrationsSQLMiClientCancelResponse` +- New struct `DatabaseMigrationsSQLMiClientCreateOrUpdateResponse` +- New struct `DatabaseMigrationsSQLMiClientCutoverResponse` +- New struct `DatabaseMigrationsSQLVMClient` +- New struct `DatabaseMigrationsSQLVMClientCancelResponse` +- New struct `DatabaseMigrationsSQLVMClientCreateOrUpdateResponse` +- New struct `DatabaseMigrationsSQLVMClientCutoverResponse` +- New struct `DeleteNode` +- New struct `ErrorInfo` +- New struct `IntegrationRuntimeMonitoringData` +- New struct `MigrationOperationInput` +- New struct `MigrationStatusDetails` +- New struct `NodeMonitoringData` +- New struct `OfflineConfiguration` +- New struct `OperationListResult` +- New struct `OperationsDefinition` +- New struct `OperationsDisplayDefinition` +- New struct `ProxyResource` +- New struct `RegenAuthKeys` +- 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 `SQLMigrationServicesClient` +- New struct `SQLMigrationServicesClientCreateOrUpdateResponse` +- New struct `SQLMigrationServicesClientDeleteResponse` +- New struct `SQLMigrationServicesClientListByResourceGroupResponse` +- New struct `SQLMigrationServicesClientListBySubscriptionResponse` +- New struct `SQLMigrationServicesClientListMigrationsResponse` +- New struct `SQLMigrationServicesClientUpdateResponse` +- New struct `SourceLocation` +- New struct `TargetLocation` +- 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` in struct `MigrateMySQLAzureDbForMySQLOfflineTaskProperties` +- New field `TaskID` in struct `MigrateMySQLAzureDbForMySQLOfflineTaskProperties` +- New field `ID` in struct `MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput` +- New field `EncryptedKeyForSecureFields` in struct `MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput` +- New field `StartedOn` in struct `MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput` +- New field `Events` in struct `MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError` +- New field `DatabaseCount` in struct `MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel` +- New field `CreatedOn` in struct `MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties` +- New field `IsCloneable` in struct `MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties` +- New field `TaskID` in struct `MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties` +- New field `ID` in struct `MigrateSQLServerSQLDbDatabaseInput` +- New field `SchemaSetting` in struct `MigrateSQLServerSQLDbDatabaseInput` +- New field `EncryptedKeyForSecureFields` in struct `MigrateSQLServerSQLDbTaskInput` +- New field `StartedOn` in struct `MigrateSQLServerSQLDbTaskInput` +- New field `CreatedOn` in struct `MigrateSQLServerSQLDbTaskProperties` +- New field `IsCloneable` in struct `MigrateSQLServerSQLDbTaskProperties` +- New field `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` in struct `MigrateSQLServerSQLMITaskInput` +- New field `StartedOn` in struct `MigrateSQLServerSQLMITaskInput` +- New field `CreatedOn` in struct `MigrateSQLServerSQLMITaskProperties` +- New field `IsCloneable` in struct `MigrateSQLServerSQLMITaskProperties` +- New field `ParentTaskID` in struct `MigrateSQLServerSQLMITaskProperties` +- New field `TaskID` in struct `MigrateSQLServerSQLMITaskProperties` +- New field `ID` in struct `MigrateSchemaSQLServerSQLDbDatabaseInput` +- New field `EncryptedKeyForSecureFields` in struct `MigrateSchemaSQLServerSQLDbTaskInput` +- New field `StartedOn` in struct `MigrateSchemaSQLServerSQLDbTaskInput` +- New field `CreatedOn` in struct `MigrateSchemaSQLServerSQLDbTaskProperties` +- New field `IsCloneable` in struct `MigrateSchemaSQLServerSQLDbTaskProperties` +- New field `TaskID` in struct `MigrateSchemaSQLServerSQLDbTaskProperties` +- New field `CommandID` in struct `MigrateSyncCompleteCommandProperties` +- New field `AdditionalSettings` in struct `MongoDbConnectionInfo` +- New field `Authentication` in struct `MongoDbConnectionInfo` +- New field `DataSource` in struct `MongoDbConnectionInfo` +- New field `EncryptConnection` in struct `MongoDbConnectionInfo` +- New field `EnforceSSL` in struct `MongoDbConnectionInfo` +- New field `Port` in struct `MongoDbConnectionInfo` +- New field `ServerBrandVersion` in struct `MongoDbConnectionInfo` +- New field `ServerName` in struct `MongoDbConnectionInfo` +- New field `ServerVersion` in struct `MongoDbConnectionInfo` +- New field `TrustServerCertificate` in struct `MongoDbConnectionInfo` +- New field `AdditionalSettings` in struct `MySQLConnectionInfo` +- New field `Authentication` in struct `MySQLConnectionInfo` +- New field `DataSource` in struct `MySQLConnectionInfo` +- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` +- New field `Authentication` in struct `OracleConnectionInfo` +- New field `Port` in struct `OracleConnectionInfo` +- New field `ServerName` in struct `OracleConnectionInfo` +- New field `ServerVersion` in struct `OracleConnectionInfo` +- New field `AdditionalSettings` in struct `PostgreSQLConnectionInfo` +- New field `Authentication` in struct `PostgreSQLConnectionInfo` +- New field `DataSource` in struct `PostgreSQLConnectionInfo` +- New field `ServerBrandVersion` in struct `PostgreSQLConnectionInfo` +- New field `ServerVersion` in struct `PostgreSQLConnectionInfo` +- New field `Etag` in struct `Project` +- New field `AzureAuthenticationInfo` in struct `ProjectProperties` +- New field `Port` in struct `SQLConnectionInfo` +- New field `ResourceID` in struct `SQLConnectionInfo` +- New field `ServerBrandVersion` in struct `SQLConnectionInfo` +- New field `ServerName` in struct `SQLConnectionInfo` +- New field `ServerVersion` in struct `SQLConnectionInfo` +- New field `FileName` in struct `SchemaMigrationSetting` +- New field `AutoStopDelay` in struct `ServiceProperties` +- New field `DeleteResourcesOnStop` in struct `ServiceProperties` +- New field `AgentConfiguration` in struct `ServiceStatusResponse` + + ## 1.0.0 (2022-06-10) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datamigration/armdatamigration` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/datamigration/armdatamigration/autorest.md b/sdk/resourcemanager/datamigration/armdatamigration/autorest.md index 7827d952dbd9..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.0.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/zz_generated_constants.go b/sdk/resourcemanager/datamigration/armdatamigration/constants.go similarity index 85% rename from sdk/resourcemanager/datamigration/armdatamigration/zz_generated_constants.go rename to sdk/resourcemanager/datamigration/armdatamigration/constants.go index 4b85399e5431..56bc0817ae24 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_constants.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/constants.go @@ -5,12 +5,13 @@ // Licensed under the MIT License. See License.txt in the project root for 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 const ( moduleName = "armdatamigration" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0-beta.1" ) // AuthenticationType - An enumeration of possible authentication types when connecting @@ -125,7 +126,28 @@ func PossibleCommandStateValues() []CommandState { } } -// CreatedByType - The type of identity that created the resource. +// 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, + } +} + type CreatedByType string const ( @@ -612,6 +634,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 @@ -746,6 +783,23 @@ func PossibleResourceSKURestrictionsTypeValues() []ResourceSKURestrictionsType { } } +type ResourceType string + +const ( + ResourceTypeSQLDb ResourceType = "SqlDb" + ResourceTypeSQLMi ResourceType = "SqlMi" + ResourceTypeSQLVM ResourceType = "SqlVm" +) + +// PossibleResourceTypeValues returns the possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{ + ResourceTypeSQLDb, + ResourceTypeSQLMi, + ResourceTypeSQLVM, + } +} + // SQLSourcePlatform - An enumeration of source platform types type SQLSourcePlatform string @@ -879,6 +933,7 @@ const ( ServerLevelPermissionsGroupMigrationFromSQLServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" ServerLevelPermissionsGroupMigrationFromSQLServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSQLServerToAzureVM ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureVM" ) // PossibleServerLevelPermissionsGroupValues returns the possible values for the ServerLevelPermissionsGroup const type. @@ -888,6 +943,7 @@ func PossibleServerLevelPermissionsGroupValues() []ServerLevelPermissionsGroup { ServerLevelPermissionsGroupMigrationFromSQLServerToAzureDB, ServerLevelPermissionsGroupMigrationFromSQLServerToAzureMI, ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + ServerLevelPermissionsGroupMigrationFromSQLServerToAzureVM, } } @@ -1110,6 +1166,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/databasemigrationssqldb_client.go b/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationssqldb_client.go new file mode 100644 index 000000000000..9ebd3c594901 --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationssqldb_client.go @@ -0,0 +1,339 @@ +//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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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 { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DatabaseMigrationsSQLDbClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + 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 2022-03-30-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 + } + return runtime.NewPoller[DatabaseMigrationsSQLDbClientCancelResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DatabaseMigrationsSQLDbClientCancelResponse](options.ResumeToken, client.pl, nil) + } +} + +// Cancel - Stop on going migration for the database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-30-preview +func (client *DatabaseMigrationsSQLDbClient) cancel(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLDbClientBeginCancelOptions) (*http.Response, error) { + req, err := client.cancelCreateRequest(ctx, resourceGroupName, sqlDbInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginCreateOrUpdate - Create or Update Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-30-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 + } + return runtime.NewPoller[DatabaseMigrationsSQLDbClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DatabaseMigrationsSQLDbClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create or Update Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-30-preview +func (client *DatabaseMigrationsSQLDbClient) createOrUpdate(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, parameters DatabaseMigrationSQLDb, options *DatabaseMigrationsSQLDbClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, sqlDbInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Delete Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-30-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 + } + return runtime.NewPoller[DatabaseMigrationsSQLDbClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DatabaseMigrationsSQLDbClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete Database Migration resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-30-preview +func (client *DatabaseMigrationsSQLDbClient) deleteOperation(ctx context.Context, resourceGroupName string, sqlDbInstanceName string, targetDbName string, options *DatabaseMigrationsSQLDbClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, sqlDbInstanceName, targetDbName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Force != nil { + reqQP.Set("force", strconv.FormatBool(*options.Force)) + } + reqQP.Set("api-version", "2022-03-30-preview") + 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 2022-03-30-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) { + req, err := client.getCreateRequest(ctx, resourceGroupName, sqlDbInstanceName, targetDbName, options) + if err != nil { + return DatabaseMigrationsSQLDbClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseMigrationsSQLDbClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseMigrationsSQLDbClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.MigrationOperationID != nil { + reqQP.Set("migrationOperationId", *options.MigrationOperationID) + } + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + reqQP.Set("api-version", "2022-03-30-preview") + 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..eba1ae66dcc4 --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationssqlmi_client.go @@ -0,0 +1,336 @@ +//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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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 { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DatabaseMigrationsSQLMiClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + 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 2022-03-30-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 + } + return runtime.NewPoller[DatabaseMigrationsSQLMiClientCancelResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DatabaseMigrationsSQLMiClientCancelResponse](options.ResumeToken, client.pl, nil) + } +} + +// Cancel - Stop in-progress database migration to SQL Managed Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-30-preview +func (client *DatabaseMigrationsSQLMiClient) cancel(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLMiClientBeginCancelOptions) (*http.Response, error) { + req, err := client.cancelCreateRequest(ctx, resourceGroupName, managedInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, runtime.MarshalAsJSON(req, parameters) +} + +// 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 2022-03-30-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 + } + return runtime.NewPoller[DatabaseMigrationsSQLMiClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DatabaseMigrationsSQLMiClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// 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 2022-03-30-preview +func (client *DatabaseMigrationsSQLMiClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters DatabaseMigrationSQLMi, options *DatabaseMigrationsSQLMiClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// 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 2022-03-30-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 + } + return runtime.NewPoller[DatabaseMigrationsSQLMiClientCutoverResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DatabaseMigrationsSQLMiClientCutoverResponse](options.ResumeToken, client.pl, nil) + } +} + +// 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 2022-03-30-preview +func (client *DatabaseMigrationsSQLMiClient) cutover(ctx context.Context, resourceGroupName string, managedInstanceName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLMiClientBeginCutoverOptions) (*http.Response, error) { + req, err := client.cutoverCreateRequest(ctx, resourceGroupName, managedInstanceName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, runtime.MarshalAsJSON(req, parameters) +} + +// 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 2022-03-30-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) { + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, targetDbName, options) + if err != nil { + return DatabaseMigrationsSQLMiClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseMigrationsSQLMiClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseMigrationsSQLMiClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.MigrationOperationID != nil { + reqQP.Set("migrationOperationId", *options.MigrationOperationID) + } + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + reqQP.Set("api-version", "2022-03-30-preview") + 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..12b22c3d992f --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/databasemigrationssqlvm_client.go @@ -0,0 +1,334 @@ +//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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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 { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DatabaseMigrationsSQLVMClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + 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 2022-03-30-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 + } + return runtime.NewPoller[DatabaseMigrationsSQLVMClientCancelResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DatabaseMigrationsSQLVMClientCancelResponse](options.ResumeToken, client.pl, nil) + } +} + +// Cancel - Stop in-progress database migration to SQL VM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-30-preview +func (client *DatabaseMigrationsSQLVMClient) cancel(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLVMClientBeginCancelOptions) (*http.Response, error) { + req, err := client.cancelCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, runtime.MarshalAsJSON(req, parameters) +} + +// 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 2022-03-30-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 + } + return runtime.NewPoller[DatabaseMigrationsSQLVMClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DatabaseMigrationsSQLVMClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// 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 2022-03-30-preview +func (client *DatabaseMigrationsSQLVMClient) createOrUpdate(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters DatabaseMigrationSQLVM, options *DatabaseMigrationsSQLVMClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// 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 2022-03-30-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 + } + return runtime.NewPoller[DatabaseMigrationsSQLVMClientCutoverResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DatabaseMigrationsSQLVMClientCutoverResponse](options.ResumeToken, client.pl, nil) + } +} + +// 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 2022-03-30-preview +func (client *DatabaseMigrationsSQLVMClient) cutover(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, targetDbName string, parameters MigrationOperationInput, options *DatabaseMigrationsSQLVMClientBeginCutoverOptions) (*http.Response, error) { + req, err := client.cutoverCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, runtime.MarshalAsJSON(req, parameters) +} + +// 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 2022-03-30-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) { + req, err := client.getCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, targetDbName, options) + if err != nil { + return DatabaseMigrationsSQLVMClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseMigrationsSQLVMClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseMigrationsSQLVMClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.MigrationOperationID != nil { + reqQP.Set("migrationOperationId", *options.MigrationOperationID) + } + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + reqQP.Set("api-version", "2022-03-30-preview") + 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/zz_generated_files_client.go b/sdk/resourcemanager/datamigration/armdatamigration/files_client.go similarity index 87% rename from sdk/resourcemanager/datamigration/armdatamigration/zz_generated_files_client.go rename to sdk/resourcemanager/datamigration/armdatamigration/files_client.go index fdce869b6d82..fb62c9c4274c 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_files_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/files_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 @@ -31,9 +32,9 @@ type FilesClient struct { } // NewFilesClient creates a new instance of FilesClient with the specified values. -// subscriptionID - Identifier of the subscription -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default 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 NewFilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FilesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// fileName - Name of the File -// parameters - Information about the file -// options - FilesClientCreateOrUpdateOptions contains the optional parameters for the FilesClient.CreateOrUpdate method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - fileName - Name of the File +// - parameters - Information about the file +// - options - FilesClientCreateOrUpdateOptions contains the optional parameters for the FilesClient.CreateOrUpdate method. func (client *FilesClient) CreateOrUpdate(ctx context.Context, groupName string, serviceName string, projectName string, fileName string, parameters ProjectFile, options *FilesClientCreateOrUpdateOptions) (FilesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, groupName, serviceName, projectName, fileName, parameters, options) if err != nil { @@ -106,7 +108,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -123,12 +125,13 @@ 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// fileName - Name of the File -// options - FilesClientDeleteOptions contains the optional parameters for the FilesClient.Delete method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - fileName - Name of the File +// - options - FilesClientDeleteOptions contains the optional parameters for the FilesClient.Delete method. func (client *FilesClient) Delete(ctx context.Context, groupName string, serviceName string, projectName string, fileName string, options *FilesClientDeleteOptions) (FilesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, groupName, serviceName, projectName, fileName, options) if err != nil { @@ -172,7 +175,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,12 +184,13 @@ func (client *FilesClient) deleteCreateRequest(ctx context.Context, groupName st // Get - The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method // retrieves information about a file. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// fileName - Name of the File -// options - FilesClientGetOptions contains the optional parameters for the FilesClient.Get method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - fileName - Name of the File +// - options - FilesClientGetOptions contains the optional parameters for the FilesClient.Get method. func (client *FilesClient) Get(ctx context.Context, groupName string, serviceName string, projectName string, fileName string, options *FilesClientGetOptions) (FilesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, groupName, serviceName, projectName, fileName, options) if err != nil { @@ -230,7 +234,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,12 +251,12 @@ 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// options - FilesClientListOptions contains the optional parameters for the FilesClient.List method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - options - FilesClientListOptions contains the optional parameters for the FilesClient.NewListPager method. func (client *FilesClient) NewListPager(groupName string, serviceName string, projectName string, options *FilesClientListOptions) *runtime.Pager[FilesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[FilesClientListResponse]{ More: func(page FilesClientListResponse) bool { @@ -305,7 +309,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,12 +326,13 @@ 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// fileName - Name of the File -// options - FilesClientReadOptions contains the optional parameters for the FilesClient.Read method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - fileName - Name of the File +// - options - FilesClientReadOptions contains the optional parameters for the FilesClient.Read method. func (client *FilesClient) Read(ctx context.Context, groupName string, serviceName string, projectName string, fileName string, options *FilesClientReadOptions) (FilesClientReadResponse, error) { req, err := client.readCreateRequest(ctx, groupName, serviceName, projectName, fileName, options) if err != nil { @@ -371,7 +376,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -388,12 +393,13 @@ 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// fileName - Name of the File -// options - FilesClientReadWriteOptions contains the optional parameters for the FilesClient.ReadWrite method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - fileName - Name of the File +// - options - FilesClientReadWriteOptions contains the optional parameters for the FilesClient.ReadWrite method. func (client *FilesClient) ReadWrite(ctx context.Context, groupName string, serviceName string, projectName string, fileName string, options *FilesClientReadWriteOptions) (FilesClientReadWriteResponse, error) { req, err := client.readWriteCreateRequest(ctx, groupName, serviceName, projectName, fileName, options) if err != nil { @@ -437,7 +443,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -454,13 +460,14 @@ 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// fileName - Name of the File -// parameters - Information about the file -// options - FilesClientUpdateOptions contains the optional parameters for the FilesClient.Update method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - fileName - Name of the File +// - parameters - Information about the file +// - options - FilesClientUpdateOptions contains the optional parameters for the FilesClient.Update method. func (client *FilesClient) Update(ctx context.Context, groupName string, serviceName string, projectName string, fileName string, parameters ProjectFile, options *FilesClientUpdateOptions) (FilesClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, groupName, serviceName, projectName, fileName, parameters, options) if err != nil { @@ -504,7 +511,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/datamigration/armdatamigration/go.mod b/sdk/resourcemanager/datamigration/armdatamigration/go.mod index b662af6a3265..193ac4dbdd98 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/go.mod +++ b/sdk/resourcemanager/datamigration/armdatamigration/go.mod @@ -1,21 +1,13 @@ -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.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/datamigration/armdatamigration/go.sum b/sdk/resourcemanager/datamigration/armdatamigration/go.sum index 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/go.sum +++ b/sdk/resourcemanager/datamigration/armdatamigration/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/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/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_models.go b/sdk/resourcemanager/datamigration/armdatamigration/models.go similarity index 85% rename from sdk/resourcemanager/datamigration/armdatamigration/zz_generated_models.go rename to sdk/resourcemanager/datamigration/armdatamigration/models.go index 00b18a1fe4ec..73eaa51d73a2 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_models.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/models.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 @@ -19,6 +20,15 @@ type APIError struct { SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` } +// AuthenticationKeys - An authentication key. +type AuthenticationKeys struct { + // The first authentication key. + AuthKey1 *string `json:"authKey1,omitempty"` + + // The second authentication key. + AuthKey2 *string `json:"authKey2,omitempty"` +} + // AvailableServiceSKU - Describes the available service SKU. type AvailableServiceSKU struct { // A description of the scaling capacities of the SKU @@ -63,16 +73,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 `json:"appKey,omitempty"` - // REQUIRED; Application ID of the Azure Active Directory Application + // Application ID of the Azure Active Directory Application ApplicationID *string `json:"applicationId,omitempty"` - // REQUIRED; Tenant id of the customer + // Ignore checking azure permissions on the AAD app + IgnoreAzurePermissions *bool `json:"ignoreAzurePermissions,omitempty"` + + // Tenant id of the customer TenantID *string `json:"tenantId,omitempty"` } +// AzureBlob - Azure Blob Details +type AzureBlob struct { + // Storage Account Key. + AccountKey *string `json:"accountKey,omitempty"` + + // Blob container name where backups are stored. + BlobContainerName *string `json:"blobContainerName,omitempty"` + + // Resource Id of the storage account where backups are stored. + StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` +} + +// BackupConfiguration - Backup Configuration +type BackupConfiguration struct { + // Source location of backups. + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` + + // Target location for copying backups. + TargetLocation *TargetLocation `json:"targetLocation,omitempty"` +} + // BackupFileInfo - Information of the backup file type BackupFileInfo struct { // Sequence number of the backup file in the backup set @@ -120,7 +154,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 `json:"sasUri,omitempty"` } @@ -142,7 +176,7 @@ type CheckOCIDriverTaskOutput struct { // CheckOCIDriverTaskProperties - Properties for the task that checks for OCI drivers. type CheckOCIDriverTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -188,7 +222,7 @@ type CommandPropertiesClassification interface { // this object is returned. type CommandProperties struct { // REQUIRED; Command type. - CommandType *string `json:"commandType,omitempty"` + CommandType *CommandType `json:"commandType,omitempty"` // READ-ONLY; Array of errors. This is ignored if submitted. Errors []*ODataError `json:"errors,omitempty" azure:"ro"` @@ -204,7 +238,7 @@ func (c *CommandProperties) GetCommandProperties() *CommandProperties { return c // a MongoDB server type ConnectToMongoDbTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -254,7 +288,7 @@ type ConnectToSourceMySQLTaskInput struct { // ConnectToSourceMySQLTaskProperties - Properties for the task that validates MySQL database connection type ConnectToSourceMySQLTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -328,7 +362,7 @@ type ConnectToSourceOracleSyncTaskOutput struct { // ConnectToSourceOracleSyncTaskProperties - Properties for the task that validates Oracle database connection type ConnectToSourceOracleSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -389,7 +423,7 @@ type ConnectToSourcePostgreSQLSyncTaskOutput struct { // source server requirements for online migration type ConnectToSourcePostgreSQLSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -425,7 +459,7 @@ func (c *ConnectToSourcePostgreSQLSyncTaskProperties) GetProjectTaskProperties() // server requirements for online migration type ConnectToSourceSQLServerSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -478,6 +512,9 @@ type ConnectToSourceSQLServerTaskInput struct { // Flag for whether to collect TDE Certificate names from source server. CollectTdeCertificateInfo *bool `json:"collectTdeCertificateInfo,omitempty"` + // encrypted key for secure fields + EncryptedKeyForSecureFields *string `json:"encryptedKeyForSecureFields,omitempty"` + // Flag for whether to validate SSIS catalog is reachable on the source server. ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` } @@ -660,7 +697,7 @@ func (c *ConnectToSourceSQLServerTaskOutputTaskLevel) GetConnectToSourceSQLServe // source server requirements type ConnectToSourceSQLServerTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -668,6 +705,9 @@ type ConnectToSourceSQLServerTaskProperties struct { // Task input Input *ConnectToSourceSQLServerTaskInput `json:"input,omitempty"` + // Task id + TaskID *string `json:"taskId,omitempty"` + // READ-ONLY; Array of command properties. Commands []CommandPropertiesClassification `json:"commands,omitempty" azure:"ro"` @@ -728,7 +768,7 @@ type ConnectToTargetAzureDbForMySQLTaskOutput struct { // MySQL and target server requirements type ConnectToTargetAzureDbForMySQLTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -793,7 +833,7 @@ type ConnectToTargetAzureDbForPostgreSQLSyncTaskOutput struct { // For PostgreSQL server and target server requirements for online migration type ConnectToTargetAzureDbForPostgreSQLSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -860,7 +900,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 `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -905,7 +945,7 @@ type ConnectToTargetSQLDbSyncTaskInput struct { // requirements for online migration type ConnectToTargetSQLDbSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -941,6 +981,9 @@ func (c *ConnectToTargetSQLDbSyncTaskProperties) GetProjectTaskProperties() *Pro type ConnectToTargetSQLDbTaskInput struct { // REQUIRED; Connection information for target SQL DB TargetConnectionInfo *SQLConnectionInfo `json:"targetConnectionInfo,omitempty"` + + // Boolean flag indicating whether to query object counts for each database on the target server + QueryObjectCounts *bool `json:"queryObjectCounts,omitempty"` } // ConnectToTargetSQLDbTaskOutput - Output for the task that validates connection to SQL DB and target server requirements @@ -961,11 +1004,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 `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` + // DateTime in UTC when the task was created + CreatedOn *string `json:"createdOn,omitempty"` + // Task input Input *ConnectToTargetSQLDbTaskInput `json:"input,omitempty"` @@ -1020,7 +1066,7 @@ type ConnectToTargetSQLMISyncTaskOutput struct { // Instance type ConnectToTargetSQLMISyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -1091,7 +1137,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 `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -1148,6 +1194,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 `json:"copyDuration,omitempty" azure:"ro"` + + // READ-ONLY; Copy Start + CopyStart *time.Time `json:"copyStart,omitempty" azure:"ro"` + + // READ-ONLY; Copy throughput in KBps + CopyThroughput *float64 `json:"copyThroughput,omitempty" azure:"ro"` + + // READ-ONLY; Bytes read + DataRead *int64 `json:"dataRead,omitempty" azure:"ro"` + + // READ-ONLY; Bytes written + DataWritten *int64 `json:"dataWritten,omitempty" azure:"ro"` + + // READ-ONLY; Type of parallel copy (Dynamic range, Physical partition, none). + ParallelCopyType *string `json:"parallelCopyType,omitempty" azure:"ro"` + + // READ-ONLY; Rows Copied + RowsCopied *int64 `json:"rowsCopied,omitempty" azure:"ro"` + + // READ-ONLY; Rows read + RowsRead *int64 `json:"rowsRead,omitempty" azure:"ro"` + + // READ-ONLY; Status of the Copy activity (InProgress, Succeeded, Failed, Canceled). + Status *string `json:"status,omitempty" azure:"ro"` + + // READ-ONLY; Table Name + TableName *string `json:"tableName,omitempty" azure:"ro"` + + // READ-ONLY; The degree of parallelization. + UsedParallelCopies *int32 `json:"usedParallelCopies,omitempty" azure:"ro"` +} + // DataIntegrityValidationResult - Results for checksum based Data Integrity validation results type DataIntegrityValidationResult struct { // List of failed table names of source and target pair @@ -1316,6 +1398,470 @@ type DatabaseInfo struct { SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` } +// DatabaseMigration - Database Migration Resource. +type DatabaseMigration struct { + // Database Migration Resource properties. + Properties DatabaseMigrationPropertiesClassification `json:"properties,omitempty"` + + // READ-ONLY + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY + Type *string `json:"type,omitempty" azure:"ro"` +} + +// DatabaseMigrationListResult - A list of Database Migrations. +type DatabaseMigrationListResult struct { + // READ-ONLY + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY + Value []*DatabaseMigration `json:"value,omitempty" azure:"ro"` +} + +// 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 { + // GetDatabaseMigrationProperties returns the DatabaseMigrationProperties content of the underlying type. + GetDatabaseMigrationProperties() *DatabaseMigrationProperties +} + +// DatabaseMigrationProperties - Database Migration Resource properties. +type DatabaseMigrationProperties struct { + // REQUIRED + Kind *ResourceType `json:"kind,omitempty"` + + // ID tracking current migration operation. + MigrationOperationID *string `json:"migrationOperationId,omitempty"` + + // Resource Id of the Migration Service. + MigrationService *string `json:"migrationService,omitempty"` + + // Error message for migration provisioning failure, if any. + ProvisioningError *string `json:"provisioningError,omitempty"` + + // Resource Id of the target resource (SQL VM or SQL Managed Instance). + Scope *string `json:"scope,omitempty"` + + // Name of the source database. + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + + // Source SQL Server connection details. + SourceSQLConnection *SQLConnectionInformation `json:"sourceSqlConnection,omitempty"` + + // Database collation to be used for the target database. + TargetDatabaseCollation *string `json:"targetDatabaseCollation,omitempty"` + + // READ-ONLY; Database migration end time. + EndedOn *time.Time `json:"endedOn,omitempty" azure:"ro"` + + // READ-ONLY; Error details in case of migration failure. + MigrationFailureError *ErrorInfo `json:"migrationFailureError,omitempty" azure:"ro"` + + // READ-ONLY; Migration status. + MigrationStatus *string `json:"migrationStatus,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed + // and migration has started. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; Name of the source sql server. + SourceServerName *string `json:"sourceServerName,omitempty" azure:"ro"` + + // READ-ONLY; Database migration start time. + StartedOn *time.Time `json:"startedOn,omitempty" azure:"ro"` +} + +// GetDatabaseMigrationProperties implements the DatabaseMigrationPropertiesClassification interface for type DatabaseMigrationProperties. +func (d *DatabaseMigrationProperties) GetDatabaseMigrationProperties() *DatabaseMigrationProperties { + return d +} + +// DatabaseMigrationPropertiesSQLDb - Database Migration Resource properties for SQL database. +type DatabaseMigrationPropertiesSQLDb struct { + // REQUIRED + Kind *ResourceType `json:"kind,omitempty"` + + // ID tracking current migration operation. + MigrationOperationID *string `json:"migrationOperationId,omitempty"` + + // Resource Id of the Migration Service. + MigrationService *string `json:"migrationService,omitempty"` + + // Error message for migration provisioning failure, if any. + ProvisioningError *string `json:"provisioningError,omitempty"` + + // Resource Id of the target resource (SQL VM or SQL Managed Instance). + Scope *string `json:"scope,omitempty"` + + // Name of the source database. + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + + // Source SQL Server connection details. + SourceSQLConnection *SQLConnectionInformation `json:"sourceSqlConnection,omitempty"` + + // List of tables to copy. + TableList []*string `json:"tableList,omitempty"` + + // Database collation to be used for the target database. + TargetDatabaseCollation *string `json:"targetDatabaseCollation,omitempty"` + + // Target SQL DB connection details. + TargetSQLConnection *SQLConnectionInformation `json:"targetSqlConnection,omitempty"` + + // READ-ONLY; Database migration end time. + EndedOn *time.Time `json:"endedOn,omitempty" azure:"ro"` + + // READ-ONLY; Error details in case of migration failure. + MigrationFailureError *ErrorInfo `json:"migrationFailureError,omitempty" azure:"ro"` + + // READ-ONLY; Migration status. + MigrationStatus *string `json:"migrationStatus,omitempty" azure:"ro"` + + // READ-ONLY; Detailed migration status. Not included by default. + MigrationStatusDetails *SQLDbMigrationStatusDetails `json:"migrationStatusDetails,omitempty" azure:"ro"` + + // READ-ONLY; Offline configuration. + OfflineConfiguration *SQLDbOfflineConfiguration `json:"offlineConfiguration,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed + // and migration has started. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; Name of the source sql server. + SourceServerName *string `json:"sourceServerName,omitempty" azure:"ro"` + + // READ-ONLY; Database migration start time. + StartedOn *time.Time `json:"startedOn,omitempty" azure:"ro"` +} + +// GetDatabaseMigrationProperties implements the DatabaseMigrationPropertiesClassification interface for type DatabaseMigrationPropertiesSQLDb. +func (d *DatabaseMigrationPropertiesSQLDb) GetDatabaseMigrationProperties() *DatabaseMigrationProperties { + return &DatabaseMigrationProperties{ + Kind: d.Kind, + Scope: d.Scope, + ProvisioningState: d.ProvisioningState, + MigrationStatus: d.MigrationStatus, + StartedOn: d.StartedOn, + EndedOn: d.EndedOn, + SourceSQLConnection: d.SourceSQLConnection, + SourceDatabaseName: d.SourceDatabaseName, + SourceServerName: d.SourceServerName, + MigrationService: d.MigrationService, + MigrationOperationID: d.MigrationOperationID, + MigrationFailureError: d.MigrationFailureError, + TargetDatabaseCollation: d.TargetDatabaseCollation, + ProvisioningError: d.ProvisioningError, + } +} + +// DatabaseMigrationPropertiesSQLMi - Database Migration Resource properties for SQL Managed Instance. +type DatabaseMigrationPropertiesSQLMi struct { + // REQUIRED + Kind *ResourceType `json:"kind,omitempty"` + + // Backup configuration info. + BackupConfiguration *BackupConfiguration `json:"backupConfiguration,omitempty"` + + // ID tracking current migration operation. + MigrationOperationID *string `json:"migrationOperationId,omitempty"` + + // Resource Id of the Migration Service. + MigrationService *string `json:"migrationService,omitempty"` + + // Offline configuration. + OfflineConfiguration *OfflineConfiguration `json:"offlineConfiguration,omitempty"` + + // Error message for migration provisioning failure, if any. + ProvisioningError *string `json:"provisioningError,omitempty"` + + // Resource Id of the target resource (SQL VM or SQL Managed Instance). + Scope *string `json:"scope,omitempty"` + + // Name of the source database. + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + + // Source SQL Server connection details. + SourceSQLConnection *SQLConnectionInformation `json:"sourceSqlConnection,omitempty"` + + // Database collation to be used for the target database. + TargetDatabaseCollation *string `json:"targetDatabaseCollation,omitempty"` + + // READ-ONLY; Database migration end time. + EndedOn *time.Time `json:"endedOn,omitempty" azure:"ro"` + + // READ-ONLY; Error details in case of migration failure. + MigrationFailureError *ErrorInfo `json:"migrationFailureError,omitempty" azure:"ro"` + + // READ-ONLY; Migration status. + MigrationStatus *string `json:"migrationStatus,omitempty" azure:"ro"` + + // READ-ONLY; Detailed migration status. Not included by default. + MigrationStatusDetails *MigrationStatusDetails `json:"migrationStatusDetails,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed + // and migration has started. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; Name of the source sql server. + SourceServerName *string `json:"sourceServerName,omitempty" azure:"ro"` + + // READ-ONLY; Database migration start time. + StartedOn *time.Time `json:"startedOn,omitempty" azure:"ro"` +} + +// GetDatabaseMigrationProperties implements the DatabaseMigrationPropertiesClassification interface for type DatabaseMigrationPropertiesSQLMi. +func (d *DatabaseMigrationPropertiesSQLMi) GetDatabaseMigrationProperties() *DatabaseMigrationProperties { + return &DatabaseMigrationProperties{ + Kind: d.Kind, + Scope: d.Scope, + ProvisioningState: d.ProvisioningState, + MigrationStatus: d.MigrationStatus, + StartedOn: d.StartedOn, + EndedOn: d.EndedOn, + SourceSQLConnection: d.SourceSQLConnection, + SourceDatabaseName: d.SourceDatabaseName, + SourceServerName: d.SourceServerName, + MigrationService: d.MigrationService, + MigrationOperationID: d.MigrationOperationID, + MigrationFailureError: d.MigrationFailureError, + TargetDatabaseCollation: d.TargetDatabaseCollation, + ProvisioningError: d.ProvisioningError, + } +} + +// DatabaseMigrationPropertiesSQLVM - Database Migration Resource properties for SQL Virtual Machine. +type DatabaseMigrationPropertiesSQLVM struct { + // REQUIRED + Kind *ResourceType `json:"kind,omitempty"` + + // Backup configuration info. + BackupConfiguration *BackupConfiguration `json:"backupConfiguration,omitempty"` + + // ID tracking current migration operation. + MigrationOperationID *string `json:"migrationOperationId,omitempty"` + + // Resource Id of the Migration Service. + MigrationService *string `json:"migrationService,omitempty"` + + // Offline configuration. + OfflineConfiguration *OfflineConfiguration `json:"offlineConfiguration,omitempty"` + + // Error message for migration provisioning failure, if any. + ProvisioningError *string `json:"provisioningError,omitempty"` + + // Resource Id of the target resource (SQL VM or SQL Managed Instance). + Scope *string `json:"scope,omitempty"` + + // Name of the source database. + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + + // Source SQL Server connection details. + SourceSQLConnection *SQLConnectionInformation `json:"sourceSqlConnection,omitempty"` + + // Database collation to be used for the target database. + TargetDatabaseCollation *string `json:"targetDatabaseCollation,omitempty"` + + // READ-ONLY; Database migration end time. + EndedOn *time.Time `json:"endedOn,omitempty" azure:"ro"` + + // READ-ONLY; Error details in case of migration failure. + MigrationFailureError *ErrorInfo `json:"migrationFailureError,omitempty" azure:"ro"` + + // READ-ONLY; Migration status. + MigrationStatus *string `json:"migrationStatus,omitempty" azure:"ro"` + + // READ-ONLY; Detailed migration status. Not included by default. + MigrationStatusDetails *MigrationStatusDetails `json:"migrationStatusDetails,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed + // and migration has started. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; Name of the source sql server. + SourceServerName *string `json:"sourceServerName,omitempty" azure:"ro"` + + // READ-ONLY; Database migration start time. + StartedOn *time.Time `json:"startedOn,omitempty" azure:"ro"` +} + +// GetDatabaseMigrationProperties implements the DatabaseMigrationPropertiesClassification interface for type DatabaseMigrationPropertiesSQLVM. +func (d *DatabaseMigrationPropertiesSQLVM) GetDatabaseMigrationProperties() *DatabaseMigrationProperties { + return &DatabaseMigrationProperties{ + Kind: d.Kind, + Scope: d.Scope, + ProvisioningState: d.ProvisioningState, + MigrationStatus: d.MigrationStatus, + StartedOn: d.StartedOn, + EndedOn: d.EndedOn, + SourceSQLConnection: d.SourceSQLConnection, + SourceDatabaseName: d.SourceDatabaseName, + SourceServerName: d.SourceServerName, + MigrationService: d.MigrationService, + MigrationOperationID: d.MigrationOperationID, + MigrationFailureError: d.MigrationFailureError, + TargetDatabaseCollation: d.TargetDatabaseCollation, + ProvisioningError: d.ProvisioningError, + } +} + +// DatabaseMigrationSQLDb - Database Migration Resource for SQL Database. +type DatabaseMigrationSQLDb struct { + // Database Migration Resource properties for SQL database. + Properties *DatabaseMigrationPropertiesSQLDb `json:"properties,omitempty"` + + // READ-ONLY + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY + Type *string `json:"type,omitempty" azure:"ro"` +} + +// DatabaseMigrationSQLMi - Database Migration Resource for SQL Managed Instance. +type DatabaseMigrationSQLMi struct { + // Database Migration Resource properties for SQL Managed Instance. + Properties *DatabaseMigrationPropertiesSQLMi `json:"properties,omitempty"` + + // READ-ONLY + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY + Type *string `json:"type,omitempty" azure:"ro"` +} + +// DatabaseMigrationSQLVM - Database Migration Resource for SQL Virtual Machine. +type DatabaseMigrationSQLVM struct { + // Database Migration Resource properties for SQL Virtual Machine. + Properties *DatabaseMigrationPropertiesSQLVM `json:"properties,omitempty"` + + // READ-ONLY + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY + Type *string `json:"type,omitempty" azure:"ro"` +} + +// 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 +} + // DatabaseObjectName - A representation of the name of an object in a database type DatabaseObjectName struct { // Type of the object in the database @@ -1373,6 +1919,15 @@ type DatabaseTable struct { Name *string `json:"name,omitempty" azure:"ro"` } +// DeleteNode - Details of node to be deleted. +type DeleteNode struct { + // The name of integration runtime. + IntegrationRuntimeName *string `json:"integrationRuntimeName,omitempty"` + + // The name of node to delete. + NodeName *string `json:"nodeName,omitempty"` +} + // Error - Migration Task errors type Error struct { // Error type @@ -1382,6 +1937,15 @@ type Error struct { Message *string `json:"message,omitempty" azure:"ro"` } +// ErrorInfo - Error details +type ErrorInfo struct { + // READ-ONLY; Error code. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; Error message. + Message *string `json:"message,omitempty" azure:"ro"` +} + // ExecutionStatistics - Description about the errors happen while performing migration validation type ExecutionStatistics struct { // CPU Time in millisecond(s) for the query execution @@ -1448,7 +2012,7 @@ type FilesClientGetOptions struct { // placeholder for future optional parameters } -// FilesClientListOptions contains the optional parameters for the FilesClient.List method. +// FilesClientListOptions contains the optional parameters for the FilesClient.NewListPager method. type FilesClientListOptions struct { // placeholder for future optional parameters } @@ -1501,7 +2065,7 @@ type GetTdeCertificatesSQLTaskOutput struct { // GetTdeCertificatesSQLTaskProperties - Properties for the task that gets TDE certificates in Base64 encoded format. type GetTdeCertificatesSQLTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -1557,7 +2121,7 @@ type GetUserTablesMySQLTaskOutput struct { // GetUserTablesMySQLTaskProperties - Properties for the task that collects user tables for the given list of databases type GetUserTablesMySQLTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -1615,7 +2179,7 @@ type GetUserTablesOracleTaskOutput struct { // GetUserTablesOracleTaskProperties - Properties for the task that collects user tables for the given list of Oracle schemas type GetUserTablesOracleTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -1672,7 +2236,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 `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -1737,7 +2301,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 `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -1776,6 +2340,9 @@ type GetUserTablesSQLTaskInput struct { // REQUIRED; List of database names to collect tables for SelectedDatabases []*string `json:"selectedDatabases,omitempty"` + + // encrypted key for secure fields + EncryptedKeyForSecureFields *string `json:"encryptedKeyForSecureFields,omitempty"` } // GetUserTablesSQLTaskOutput - Output of the task that collects user tables for the given list of databases @@ -1793,7 +2360,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 `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -1801,6 +2368,9 @@ type GetUserTablesSQLTaskProperties struct { // Task input Input *GetUserTablesSQLTaskInput `json:"input,omitempty"` + // Task id + TaskID *string `json:"taskId,omitempty"` + // READ-ONLY; Array of command properties. Commands []CommandPropertiesClassification `json:"commands,omitempty" azure:"ro"` @@ -1840,7 +2410,7 @@ type InstallOCIDriverTaskOutput struct { // InstallOCIDriverTaskProperties - Properties for the task that installs an OCI driver. type InstallOCIDriverTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -1872,6 +2442,15 @@ func (i *InstallOCIDriverTaskProperties) GetProjectTaskProperties() *ProjectTask } } +// IntegrationRuntimeMonitoringData - Integration Runtime Monitoring Data. +type IntegrationRuntimeMonitoringData struct { + // READ-ONLY; The name of Integration Runtime. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Integration Runtime node monitoring data. + Nodes []*NodeMonitoringData `json:"nodes,omitempty" azure:"ro"` +} + // 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 @@ -1914,7 +2493,7 @@ type MigrateMISyncCompleteCommandOutput struct { // Managed Instance. type MigrateMISyncCompleteCommandProperties struct { // REQUIRED; Command type. - CommandType *string `json:"commandType,omitempty"` + CommandType *CommandType `json:"commandType,omitempty"` // Command input Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` @@ -1941,7 +2520,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 `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -1998,6 +2577,9 @@ type MigrateMySQLAzureDbForMySQLOfflineTaskInput struct { // REQUIRED; Connection information for target Azure Database for MySQL TargetConnectionInfo *MySQLConnectionInfo `json:"targetConnectionInfo,omitempty"` + // encrypted key for secure fields + EncryptedKeyForSecureFields *string `json:"encryptedKeyForSecureFields,omitempty"` + // Setting to set the source server read only MakeSourceServerReadOnly *bool `json:"makeSourceServerReadOnly,omitempty"` @@ -2229,7 +2811,7 @@ func (m *MigrateMySQLAzureDbForMySQLOfflineTaskOutputTableLevel) GetMigrateMySQL // for MySQL for offline migrations type MigrateMySQLAzureDbForMySQLOfflineTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -2237,6 +2819,12 @@ type MigrateMySQLAzureDbForMySQLOfflineTaskProperties struct { // Task input Input *MigrateMySQLAzureDbForMySQLOfflineTaskInput `json:"input,omitempty"` + // whether the task can be cloned or not + IsCloneable *bool `json:"isCloneable,omitempty"` + + // Task id + TaskID *string `json:"taskId,omitempty"` + // READ-ONLY; Array of command properties. Commands []CommandPropertiesClassification `json:"commands,omitempty" azure:"ro"` @@ -2522,7 +3110,7 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskOutputTableLevel) GetMigrateMySQLAzu // for MySQL for online migrations type MigrateMySQLAzureDbForMySQLSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -2558,7 +3146,7 @@ func (m *MigrateMySQLAzureDbForMySQLSyncTaskProperties) GetProjectTaskProperties // PostgreSQL for online migrations type MigrateOracleAzureDbForPostgreSQLSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -2857,7 +3445,7 @@ func (m *MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel) GetMigrateOracl // for PostgreSQL migration task inputs type MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput struct { // Migration settings which tune the migration behavior - MigrationSetting map[string]*string `json:"migrationSetting,omitempty"` + MigrationSetting map[string]any `json:"migrationSetting,omitempty"` // Name of the database Name *string `json:"name,omitempty"` @@ -2873,6 +3461,9 @@ type MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput struct { // Target settings to tune target endpoint migration behavior TargetSetting map[string]*string `json:"targetSetting,omitempty"` + + // READ-ONLY; Result identifier + ID *string `json:"id,omitempty" azure:"ro"` } // MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseTableInput - Selected tables for the migration @@ -2892,6 +3483,12 @@ type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput struct { // REQUIRED; Connection information for target Azure Database for PostgreSQL TargetConnectionInfo *PostgreSQLConnectionInfo `json:"targetConnectionInfo,omitempty"` + + // encrypted key for secure fields + EncryptedKeyForSecureFields *string `json:"encryptedKeyForSecureFields,omitempty"` + + // READ-ONLY; Migration start time + StartedOn *time.Time `json:"startedOn,omitempty" azure:"ro"` } // MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputClassification provides polymorphic access to related types. @@ -3010,6 +3607,9 @@ type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError struct { // REQUIRED; Result type ResultType *string `json:"resultType,omitempty"` + // List of error events + Events []*SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + // READ-ONLY; Migration error Error *ReportableException `json:"error,omitempty" azure:"ro"` @@ -3030,6 +3630,9 @@ type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel struct { // REQUIRED; Result type ResultType *string `json:"resultType,omitempty"` + // Number of databases to include + DatabaseCount *float32 `json:"databaseCount,omitempty"` + // READ-ONLY; Migration end time EndedOn *time.Time `json:"endedOn,omitempty" azure:"ro"` @@ -3130,14 +3733,23 @@ func (m *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputTableLevel) GetMigra // Azure Database for PostgreSQL for online migrations type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` + // DateTime in UTC when the task was created + CreatedOn *string `json:"createdOn,omitempty"` + // Task input Input *MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput `json:"input,omitempty"` + // whether the task can be cloned or not + IsCloneable *bool `json:"isCloneable,omitempty"` + + // task id + TaskID *string `json:"taskId,omitempty"` + // READ-ONLY; Array of command properties. Commands []CommandPropertiesClassification `json:"commands,omitempty" azure:"ro"` @@ -3179,12 +3791,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 `json:"id,omitempty"` + // Whether to set database read only before migration MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` // Name of the database Name *string `json:"name,omitempty"` + // Settings selected for DB schema migration. + SchemaSetting any `json:"schemaSetting,omitempty"` + // Mapping of source to target tables TableMap map[string]*string `json:"tableMap,omitempty"` @@ -3464,7 +4082,7 @@ func (m *MigrateSQLServerSQLDbSyncTaskOutputTableLevel) GetMigrateSQLServerSQLDb // Database for online migrations type MigrateSQLServerSQLDbSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -3507,6 +4125,12 @@ type MigrateSQLServerSQLDbTaskInput struct { // REQUIRED; Information for connecting to target TargetConnectionInfo *SQLConnectionInfo `json:"targetConnectionInfo,omitempty"` + // encrypted key for secure fields + EncryptedKeyForSecureFields *string `json:"encryptedKeyForSecureFields,omitempty"` + + // Date and time relative to UTC when the migration was started on + StartedOn *string `json:"startedOn,omitempty"` + // 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 @@ -3795,14 +4419,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 `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` + // DateTime in UTC when the task was created + CreatedOn *string `json:"createdOn,omitempty"` + // Task input Input *MigrateSQLServerSQLDbTaskInput `json:"input,omitempty"` + // whether the task can be cloned or not + IsCloneable *bool `json:"isCloneable,omitempty"` + + // task id + TaskID *string `json:"taskId,omitempty"` + // READ-ONLY; Array of command properties. Commands []CommandPropertiesClassification `json:"commands,omitempty" azure:"ro"` @@ -3841,6 +4474,9 @@ type MigrateSQLServerSQLMIDatabaseInput struct { // Backup file share information for backing up this database. BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + + // id of the database + ID *string `json:"id,omitempty"` } // MigrateSQLServerSQLMISyncTaskInput - Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance @@ -3864,6 +4500,9 @@ type MigrateSQLServerSQLMISyncTaskInput struct { // Backup file share information for all selected databases. BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + + // Number of database migrations to start in parallel + NumberOfParallelDatabaseMigrations *float32 `json:"numberOfParallelDatabaseMigrations,omitempty"` } // MigrateSQLServerSQLMISyncTaskOutputClassification provides polymorphic access to related types. @@ -4016,11 +4655,14 @@ func (m *MigrateSQLServerSQLMISyncTaskOutputMigrationLevel) GetMigrateSQLServerS // Managed Instance sync scenario type MigrateSQLServerSQLMISyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` + // DateTime in UTC when the task was created + CreatedOn *string `json:"createdOn,omitempty"` + // Task input Input *MigrateSQLServerSQLMISyncTaskInput `json:"input,omitempty"` @@ -4073,11 +4715,17 @@ type MigrateSQLServerSQLMITaskInput struct { // are required to be provided in selectedDatabases. BackupMode *BackupMode `json:"backupMode,omitempty"` + // encrypted key for secure fields + EncryptedKeyForSecureFields *string `json:"encryptedKeyForSecureFields,omitempty"` + // Agent Jobs to migrate. SelectedAgentJobs []*string `json:"selectedAgentJobs,omitempty"` // Logins to migrate. SelectedLogins []*string `json:"selectedLogins,omitempty"` + + // Date and time relative to UTC when the migration was started on + StartedOn *string `json:"startedOn,omitempty"` } // MigrateSQLServerSQLMITaskOutputClassification provides polymorphic access to related types. @@ -4302,14 +4950,26 @@ func (m *MigrateSQLServerSQLMITaskOutputMigrationLevel) GetMigrateSQLServerSQLMI // Instance type MigrateSQLServerSQLMITaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` + // DateTime in UTC when the task was created + CreatedOn *string `json:"createdOn,omitempty"` + // Task input Input *MigrateSQLServerSQLMITaskInput `json:"input,omitempty"` + // whether the task can be cloned or not + IsCloneable *bool `json:"isCloneable,omitempty"` + + // parent task id + ParentTaskID *string `json:"parentTaskId,omitempty"` + + // task id + TaskID *string `json:"taskId,omitempty"` + // READ-ONLY; Array of command properties. Commands []CommandPropertiesClassification `json:"commands,omitempty" azure:"ro"` @@ -4336,6 +4996,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 `json:"id,omitempty"` + // Name of source database Name *string `json:"name,omitempty"` @@ -4356,6 +5019,12 @@ type MigrateSchemaSQLServerSQLDbTaskInput struct { // REQUIRED; Information for connecting to target TargetConnectionInfo *SQLConnectionInfo `json:"targetConnectionInfo,omitempty"` + + // encrypted key for secure fields + EncryptedKeyForSecureFields *string `json:"encryptedKeyForSecureFields,omitempty"` + + // Migration start time + StartedOn *string `json:"startedOn,omitempty"` } // MigrateSchemaSQLServerSQLDbTaskOutputClassification provides polymorphic access to related types. @@ -4496,14 +5165,23 @@ func (m *MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel) GetMigrateSchemaSQ // SQL databases type MigrateSchemaSQLServerSQLDbTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` + // DateTime in UTC when the task was created + CreatedOn *string `json:"createdOn,omitempty"` + // Task input Input *MigrateSchemaSQLServerSQLDbTaskInput `json:"input,omitempty"` + // whether the task can be cloned or not + IsCloneable *bool `json:"isCloneable,omitempty"` + + // Task id + TaskID *string `json:"taskId,omitempty"` + // READ-ONLY; Array of command properties. Commands []CommandPropertiesClassification `json:"commands,omitempty" azure:"ro"` @@ -4671,7 +5349,7 @@ func (m *MigrateSsisTaskOutputProjectLevel) GetMigrateSsisTaskOutput() *MigrateS // Managed Instance. type MigrateSsisTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -4724,7 +5402,10 @@ type MigrateSyncCompleteCommandOutput struct { // MigrateSyncCompleteCommandProperties - Properties for the command that completes sync migration for a database. type MigrateSyncCompleteCommandProperties struct { // REQUIRED; Command type. - CommandType *string `json:"commandType,omitempty"` + CommandType *CommandType `json:"commandType,omitempty"` + + // Command id + CommandID *string `json:"commandId,omitempty"` // Command input Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` @@ -4757,6 +5438,12 @@ type MigrationEligibilityInfo struct { ValidationMessages []*string `json:"validationMessages,omitempty" azure:"ro"` } +// MigrationOperationInput - Migration Operation Input +type MigrationOperationInput struct { + // ID tracking migration operation. + MigrationOperationID *string `json:"migrationOperationId,omitempty"` +} + // MigrationReportResult - Migration validation report result, contains the url for downloading the generated report. type MigrationReportResult struct { // Migration validation result identifier @@ -4766,6 +5453,48 @@ type MigrationReportResult struct { ReportURL *string `json:"reportUrl,omitempty"` } +// MigrationStatusDetails - Detailed status of current migration. +type MigrationStatusDetails struct { + // READ-ONLY; Backup sets that are currently active. + ActiveBackupSets []*SQLBackupSetInfo `json:"activeBackupSets,omitempty" azure:"ro"` + + // READ-ONLY; Name of blob container. + BlobContainerName *string `json:"blobContainerName,omitempty" azure:"ro"` + + // READ-ONLY; Complete restore error message, if any + CompleteRestoreErrorMessage *string `json:"completeRestoreErrorMessage,omitempty" azure:"ro"` + + // READ-ONLY; File name that is currently being restored. + CurrentRestoringFilename *string `json:"currentRestoringFilename,omitempty" azure:"ro"` + + // READ-ONLY; File upload blocking errors, if any. + FileUploadBlockingErrors []*string `json:"fileUploadBlockingErrors,omitempty" azure:"ro"` + + // READ-ONLY; Details of full backup set. + FullBackupSetInfo *SQLBackupSetInfo `json:"fullBackupSetInfo,omitempty" azure:"ro"` + + // READ-ONLY; Files that are not valid backup files. + InvalidFiles []*string `json:"invalidFiles,omitempty" azure:"ro"` + + // READ-ONLY; Whether full backup has been applied to the target database or not. + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty" azure:"ro"` + + // READ-ONLY; Last applied backup set information. + LastRestoredBackupSetInfo *SQLBackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty" azure:"ro"` + + // READ-ONLY; Last restored file name. + LastRestoredFilename *string `json:"lastRestoredFilename,omitempty" azure:"ro"` + + // READ-ONLY; Current State of Migration. + MigrationState *string `json:"migrationState,omitempty" azure:"ro"` + + // READ-ONLY; Total pending log backups. + PendingLogBackupsCount *int32 `json:"pendingLogBackupsCount,omitempty" azure:"ro"` + + // READ-ONLY; Restore blocking reason, if any + RestoreBlockingReason *string `json:"restoreBlockingReason,omitempty" azure:"ro"` +} + // MigrationTableMetadata - Metadata for tables selected in migration project type MigrationTableMetadata struct { // READ-ONLY; Source table name @@ -4866,7 +5595,7 @@ type MigrationValidationResult struct { // MongoDbCancelCommand - Properties for the command that cancels a migration in whole or in part type MongoDbCancelCommand struct { // REQUIRED; Command type. - CommandType *string `json:"commandType,omitempty"` + CommandType *CommandType `json:"commandType,omitempty"` // Command input Input *MongoDbCommandInput `json:"input,omitempty"` @@ -5039,9 +5768,37 @@ type MongoDbConnectionInfo struct { // REQUIRED; Type of connection info Type *string `json:"type,omitempty"` + // Additional connection settings + AdditionalSettings *string `json:"additionalSettings,omitempty"` + + // Authentication type to use for connection + Authentication *AuthenticationType `json:"authentication,omitempty"` + + // Data source + DataSource *string `json:"dataSource,omitempty"` + + // Whether to encrypt the connection + EncryptConnection *bool `json:"encryptConnection,omitempty"` + EnforceSSL *bool `json:"enforceSSL,omitempty"` + // Password credential. Password *string `json:"password,omitempty"` + // port for server + Port *int32 `json:"port,omitempty"` + + // server brand version + ServerBrandVersion *string `json:"serverBrandVersion,omitempty"` + + // name of the server + ServerName *string `json:"serverName,omitempty"` + + // server version + ServerVersion *string `json:"serverVersion,omitempty"` + + // Whether to trust the server certificate + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + // User name UserName *string `json:"userName,omitempty"` } @@ -5180,7 +5937,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 `json:"commandType,omitempty"` + CommandType *CommandType `json:"commandType,omitempty"` // Command input Input *MongoDbFinishCommandInput `json:"input,omitempty"` @@ -5388,7 +6145,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 `json:"commandType,omitempty"` + CommandType *CommandType `json:"commandType,omitempty"` // Command input Input *MongoDbCommandInput `json:"input,omitempty"` @@ -5432,7 +6189,7 @@ type MongoDbShardKeySetting struct { // REQUIRED; The fields within the shard key Fields []*MongoDbShardKeyField `json:"fields,omitempty"` - // REQUIRED; Whether the shard key is unique + // Whether the shard key is unique IsUnique *bool `json:"isUnique,omitempty"` } @@ -5459,6 +6216,15 @@ type MySQLConnectionInfo struct { // REQUIRED; Type of connection info Type *string `json:"type,omitempty"` + // Additional connection settings + AdditionalSettings *string `json:"additionalSettings,omitempty"` + + // Authentication type to use for connection + Authentication *AuthenticationType `json:"authentication,omitempty"` + + // Data source + DataSource *string `json:"dataSource,omitempty"` + // Whether to encrypt the connection EncryptConnection *bool `json:"encryptConnection,omitempty"` @@ -5499,6 +6265,35 @@ type NameAvailabilityResponse struct { Reason *NameCheckFailureReason `json:"reason,omitempty"` } +type NodeMonitoringData struct { + // READ-ONLY; Unmatched properties from the message are deserialized in this collection. + AdditionalProperties map[string]any `json:"additionalProperties,omitempty" azure:"ro"` + + // READ-ONLY; Available memory (MB) on the integration runtime node. + AvailableMemoryInMB *int32 `json:"availableMemoryInMB,omitempty" azure:"ro"` + + // READ-ONLY; CPU percentage on the integration runtime node. + CPUUtilization *int32 `json:"cpuUtilization,omitempty" azure:"ro"` + + // READ-ONLY; Maximum concurrent jobs on the integration runtime node. + ConcurrentJobsLimit *int32 `json:"concurrentJobsLimit,omitempty" azure:"ro"` + + // READ-ONLY; The number of jobs currently running on the integration runtime node. + ConcurrentJobsRunning *int32 `json:"concurrentJobsRunning,omitempty" azure:"ro"` + + // READ-ONLY; The maximum concurrent jobs in this integration runtime. + MaxConcurrentJobs *int32 `json:"maxConcurrentJobs,omitempty" azure:"ro"` + + // READ-ONLY; Name of the integration runtime node. + NodeName *string `json:"nodeName,omitempty" azure:"ro"` + + // READ-ONLY; Received bytes on the integration runtime node. + ReceivedBytes *float64 `json:"receivedBytes,omitempty" azure:"ro"` + + // READ-ONLY; Sent bytes on the integration runtime node. + SentBytes *float64 `json:"sentBytes,omitempty" azure:"ro"` +} + // NonSQLDataMigrationTable - Defines metadata for table to be migrated type NonSQLDataMigrationTable struct { // Source table name @@ -5586,11 +6381,62 @@ type ODataError struct { Message *string `json:"message,omitempty"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// 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 `json:"lastBackupName,omitempty"` + + // Offline migration + Offline *bool `json:"offline,omitempty"` +} + +// OperationListResult - Result of the request to list SQL operations. +type OperationListResult struct { + // READ-ONLY + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY + Value []*OperationsDefinition `json:"value,omitempty" azure:"ro"` +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } +type OperationsDefinition struct { + // Indicates whether the operation is a data action + IsDataAction *bool `json:"isDataAction,omitempty"` + + // READ-ONLY + Display *OperationsDisplayDefinition `json:"display,omitempty" azure:"ro"` + + // READ-ONLY + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY + Origin *OperationOrigin `json:"origin,omitempty" azure:"ro"` + + // READ-ONLY; Dictionary of + Properties map[string]any `json:"properties,omitempty" azure:"ro"` +} + +type OperationsDisplayDefinition struct { + // READ-ONLY + Description *string `json:"description,omitempty" azure:"ro"` + + // READ-ONLY + Operation *string `json:"operation,omitempty" azure:"ro"` + + // READ-ONLY + Provider *string `json:"provider,omitempty" azure:"ro"` + + // READ-ONLY + Resource *string `json:"resource,omitempty" azure:"ro"` +} + // OracleConnectionInfo - Information for connecting to Oracle server type OracleConnectionInfo struct { // REQUIRED; EZConnect or TNSName connection string. @@ -5599,9 +6445,21 @@ type OracleConnectionInfo struct { // REQUIRED; Type of connection info Type *string `json:"type,omitempty"` + // Authentication type to use for connection + Authentication *AuthenticationType `json:"authentication,omitempty"` + // Password credential. Password *string `json:"password,omitempty"` + // port for server + Port *int32 `json:"port,omitempty"` + + // name of the server + ServerName *string `json:"serverName,omitempty"` + + // server version + ServerVersion *string `json:"serverVersion,omitempty"` + // User name UserName *string `json:"userName,omitempty"` } @@ -5656,6 +6514,15 @@ type PostgreSQLConnectionInfo struct { // REQUIRED; Type of connection info Type *string `json:"type,omitempty"` + // Additional connection settings + AdditionalSettings *string `json:"additionalSettings,omitempty"` + + // Authentication type to use for connection + Authentication *AuthenticationType `json:"authentication,omitempty"` + + // Data source + DataSource *string `json:"dataSource,omitempty"` + // Name of the database DatabaseName *string `json:"databaseName,omitempty"` @@ -5665,6 +6532,12 @@ type PostgreSQLConnectionInfo struct { // Password credential. Password *string `json:"password,omitempty"` + // server brand version + ServerBrandVersion *string `json:"serverBrandVersion,omitempty"` + + // server version + ServerVersion *string `json:"serverVersion,omitempty"` + // Whether to trust the server certificate TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` @@ -5683,25 +6556,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 `json:"etag,omitempty"` Location *string `json:"location,omitempty"` // Project properties Properties *ProjectProperties `json:"properties,omitempty"` - // Resource tags. + // Dictionary of Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; Resource ID. + // READ-ONLY ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; Resource name. + // READ-ONLY Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - // READ-ONLY; Resource type. + // READ-ONLY Type *string `json:"type,omitempty" azure:"ro"` } @@ -5788,6 +6662,9 @@ type ProjectProperties struct { // REQUIRED; Target platform for the project TargetPlatform *ProjectTargetPlatform `json:"targetPlatform,omitempty"` + // Field that defines the Azure active directory application info, used to connect to the target Azure resource + AzureAuthenticationInfo *AzureActiveDirectoryApp `json:"azureAuthenticationInfo,omitempty"` + // List of DatabaseInfo DatabasesInfo []*DatabaseInfo `json:"databasesInfo,omitempty"` @@ -5849,7 +6726,7 @@ type ProjectTaskPropertiesClassification interface { // object is returned. type ProjectTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -5883,7 +6760,7 @@ type ProjectsClientGetOptions struct { // placeholder for future optional parameters } -// ProjectsClientListOptions contains the optional parameters for the ProjectsClient.List method. +// ProjectsClientListOptions contains the optional parameters for the ProjectsClient.NewListPager method. type ProjectsClientListOptions struct { // placeholder for future optional parameters } @@ -5893,6 +6770,17 @@ type ProjectsClientUpdateOptions struct { // placeholder for future optional parameters } +type ProxyResource struct { + // READ-ONLY + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY + Type *string `json:"type,omitempty" azure:"ro"` +} + // 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 @@ -5953,6 +6841,18 @@ type QuotaName struct { Value *string `json:"value,omitempty"` } +// RegenAuthKeys - An authentication key to regenerate. +type RegenAuthKeys struct { + // The first authentication key. + AuthKey1 *string `json:"authKey1,omitempty"` + + // The second authentication key. + AuthKey2 *string `json:"authKey2,omitempty"` + + // The name of authentication key to generate. + KeyName *string `json:"keyName,omitempty"` +} + // ReportableException - Exception object for all custom exceptions type ReportableException struct { // Actionable steps for this exception @@ -6074,7 +6974,7 @@ type ResourceSKURestrictions struct { Values []*string `json:"values,omitempty" azure:"ro"` } -// ResourceSKUsClientListSKUsOptions contains the optional parameters for the ResourceSKUsClient.ListSKUs method. +// ResourceSKUsClientListSKUsOptions contains the optional parameters for the ResourceSKUsClient.NewListSKUsPager method. type ResourceSKUsClientListSKUsOptions struct { // placeholder for future optional parameters } @@ -6088,6 +6988,69 @@ type ResourceSKUsResult struct { NextLink *string `json:"nextLink,omitempty"` } +// SQLBackupFileInfo - Information of backup file +type SQLBackupFileInfo struct { + // READ-ONLY; Copy Duration in seconds + CopyDuration *int32 `json:"copyDuration,omitempty" azure:"ro"` + + // READ-ONLY; Copy throughput in KBps + CopyThroughput *float64 `json:"copyThroughput,omitempty" azure:"ro"` + + // READ-ONLY; Bytes read + DataRead *int64 `json:"dataRead,omitempty" azure:"ro"` + + // READ-ONLY; Bytes written + DataWritten *int64 `json:"dataWritten,omitempty" azure:"ro"` + + // READ-ONLY; Media family sequence number + FamilySequenceNumber *int32 `json:"familySequenceNumber,omitempty" azure:"ro"` + + // READ-ONLY; File name. + FileName *string `json:"fileName,omitempty" azure:"ro"` + + // READ-ONLY; Status of the file. (Initial, Uploading, Uploaded, Restoring, Restored or Skipped) + Status *string `json:"status,omitempty" azure:"ro"` + + // READ-ONLY; File size in bytes + TotalSize *int64 `json:"totalSize,omitempty" azure:"ro"` +} + +// SQLBackupSetInfo - Information of backup set +type SQLBackupSetInfo struct { + // READ-ONLY; Backup end time. + BackupFinishDate *time.Time `json:"backupFinishDate,omitempty" azure:"ro"` + + // READ-ONLY; Backup set id. + BackupSetID *string `json:"backupSetId,omitempty" azure:"ro"` + + // READ-ONLY; Backup start date. + BackupStartDate *time.Time `json:"backupStartDate,omitempty" azure:"ro"` + + // READ-ONLY; Backup type. + BackupType *string `json:"backupType,omitempty" azure:"ro"` + + // READ-ONLY; Media family count + FamilyCount *int32 `json:"familyCount,omitempty" azure:"ro"` + + // READ-ONLY; First LSN of the backup set. + FirstLSN *string `json:"firstLSN,omitempty" azure:"ro"` + + // READ-ONLY; Has Backup Checksums + HasBackupChecksums *bool `json:"hasBackupChecksums,omitempty" azure:"ro"` + + // READ-ONLY; The reasons why the backup set is ignored + IgnoreReasons []*string `json:"ignoreReasons,omitempty" azure:"ro"` + + // READ-ONLY; Whether this backup set has been restored or not. + IsBackupRestored *bool `json:"isBackupRestored,omitempty" azure:"ro"` + + // READ-ONLY; Last LSN of the backup set. + LastLSN *string `json:"lastLSN,omitempty" azure:"ro"` + + // READ-ONLY; List of files in the backup set. + ListOfBackupFiles []*SQLBackupFileInfo `json:"listOfBackupFiles,omitempty" azure:"ro"` +} + // SQLConnectionInfo - Information for connecting to SQL database server type SQLConnectionInfo struct { // REQUIRED; Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber @@ -6111,6 +7074,21 @@ type SQLConnectionInfo struct { // Server platform type for connection Platform *SQLSourcePlatform `json:"platform,omitempty"` + // Port for Server + Port *int32 `json:"port,omitempty"` + + // Represents the ID of an HTTP resource represented by an Azure resource provider. + ResourceID *string `json:"resourceId,omitempty"` + + // server brand version + ServerBrandVersion *string `json:"serverBrandVersion,omitempty"` + + // name of the server + ServerName *string `json:"serverName,omitempty"` + + // server version + ServerVersion *string `json:"serverVersion,omitempty"` + // Whether to trust the server certificate TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` @@ -6127,6 +7105,172 @@ func (s *SQLConnectionInfo) GetConnectionInfo() *ConnectionInfo { } } +// SQLConnectionInformation - Source SQL Connection +type SQLConnectionInformation struct { + // Authentication type. + Authentication *string `json:"authentication,omitempty"` + + // Data source. + DataSource *string `json:"dataSource,omitempty"` + + // Whether to encrypt connection or not. + EncryptConnection *bool `json:"encryptConnection,omitempty"` + + // Password to connect to source SQL. + Password *string `json:"password,omitempty"` + + // Whether to trust server certificate or not. + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // User name to connect to source SQL. + UserName *string `json:"userName,omitempty"` +} + +// SQLDbMigrationStatusDetails - Detailed status of current Sql Db migration. +type SQLDbMigrationStatusDetails struct { + // READ-ONLY; Details on progress of ADF copy activities. + ListOfCopyProgressDetails []*CopyProgressDetails `json:"listOfCopyProgressDetails,omitempty" azure:"ro"` + + // READ-ONLY; Current State of Migration. + MigrationState *string `json:"migrationState,omitempty" azure:"ro"` + + // READ-ONLY; Sql Data Copy errors, if any. + SQLDataCopyErrors []*string `json:"sqlDataCopyErrors,omitempty" azure:"ro"` +} + +// SQLDbOfflineConfiguration - Offline configuration +type SQLDbOfflineConfiguration struct { + // READ-ONLY; Offline migration + Offline *bool `json:"offline,omitempty" azure:"ro"` +} + +// SQLFileShare - File share +type SQLFileShare struct { + // Password for username to access file share location. + Password *string `json:"password,omitempty"` + + // Location as SMB share or local drive where backups are placed. + Path *string `json:"path,omitempty"` + + // Username to access the file share location for backups. + Username *string `json:"username,omitempty"` +} + +// SQLMigrationListResult - A list of SQL Migration Service. +type SQLMigrationListResult struct { + // READ-ONLY + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY + Value []*SQLMigrationService `json:"value,omitempty" azure:"ro"` +} + +// SQLMigrationService - A SQL Migration Service. +type SQLMigrationService struct { + Location *string `json:"location,omitempty"` + + // The SQL Migration Service properties. + Properties *SQLMigrationServiceProperties `json:"properties,omitempty"` + + // Dictionary of + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY + Type *string `json:"type,omitempty" azure:"ro"` +} + +// SQLMigrationServiceProperties - The SQL Migration Service properties. +type SQLMigrationServiceProperties struct { + // READ-ONLY; Current state of the Integration runtime. + IntegrationRuntimeState *string `json:"integrationRuntimeState,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state to track the async operation status. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` +} + +// SQLMigrationServiceUpdate - An update to a SQL Migration Service. +type SQLMigrationServiceUpdate struct { + // Dictionary of + Tags map[string]*string `json:"tags,omitempty"` +} + +// 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 +} + // SQLMigrationTaskInput - Base class for migration task input type SQLMigrationTaskInput struct { // REQUIRED; Information for connecting to source @@ -6191,6 +7335,9 @@ type SchemaMigrationSetting struct { // Resource Identifier of a file resource containing the uploaded schema file FileID *string `json:"fileId,omitempty"` + // Name of the file resource containing the uploaded schema file + FileName *string `json:"fileName,omitempty"` + // Option on how to migrate the schema SchemaOption *SchemaMigrationOption `json:"schemaOption,omitempty"` } @@ -6227,14 +7374,12 @@ type ServerProperties struct { // Service - A Database Migration Service resource type Service struct { - // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` - // HTTP strong entity tag value. Ignored if submitted Etag *string `json:"etag,omitempty"` // The resource kind. Only 'vm' (the default) is supported. - Kind *string `json:"kind,omitempty"` + Kind *string `json:"kind,omitempty"` + Location *string `json:"location,omitempty"` // Custom service properties Properties *ServiceProperties `json:"properties,omitempty"` @@ -6242,19 +7387,19 @@ type Service struct { // Service SKU SKU *ServiceSKU `json:"sku,omitempty"` - // Resource tags. + // Dictionary of Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; Resource ID. + // READ-ONLY ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; Resource name. + // READ-ONLY Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - // READ-ONLY; Resource type. + // READ-ONLY Type *string `json:"type,omitempty" azure:"ro"` } @@ -6302,8 +7447,11 @@ type ServiceOperationList struct { // ServiceProperties - Properties of the Database Migration Service instance type ServiceProperties struct { - // REQUIRED; The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined - VirtualSubnetID *string `json:"virtualSubnetId,omitempty"` + // The time delay before the service is auto-stopped when idle. + AutoStopDelay *string `json:"autoStopDelay,omitempty"` + + // Whether service resources should be deleted when stopped. (Turned on by default) + DeleteResourcesOnStop *bool `json:"deleteResourcesOnStop,omitempty"` // The public key of the service, used to encrypt secrets sent to the service PublicKey *string `json:"publicKey,omitempty"` @@ -6311,6 +7459,9 @@ type ServiceProperties struct { // The ID of the Microsoft.Network/networkInterfaces resource which the service have VirtualNicID *string `json:"virtualNicId,omitempty"` + // The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + VirtualSubnetID *string `json:"virtualSubnetId,omitempty"` + // READ-ONLY; The resource's provisioning state ProvisioningState *ServiceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } @@ -6346,6 +7497,9 @@ type ServiceSKUList struct { // ServiceStatusResponse - Service health status type ServiceStatusResponse struct { + // Agent Configuration + AgentConfiguration any `json:"agentConfiguration,omitempty"` + // The DMS instance agent version AgentVersion *string `json:"agentVersion,omitempty"` @@ -6382,7 +7536,7 @@ type ServiceTasksClientGetOptions struct { Expand *string } -// ServiceTasksClientListOptions contains the optional parameters for the ServiceTasksClient.List method. +// ServiceTasksClientListOptions contains the optional parameters for the ServiceTasksClient.NewListPager method. type ServiceTasksClientListOptions struct { // Filter tasks by task type TaskType *string @@ -6447,21 +7601,34 @@ type ServicesClientGetOptions struct { // placeholder for future optional parameters } -// ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.ListByResourceGroup method. +// ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager +// method. type ServicesClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// ServicesClientListOptions contains the optional parameters for the ServicesClient.List method. +// ServicesClientListOptions contains the optional parameters for the ServicesClient.NewListPager method. type ServicesClientListOptions struct { // placeholder for future optional parameters } -// ServicesClientListSKUsOptions contains the optional parameters for the ServicesClient.ListSKUs method. +// ServicesClientListSKUsOptions contains the optional parameters for the ServicesClient.NewListSKUsPager method. type ServicesClientListSKUsOptions struct { // placeholder for future optional parameters } +// SourceLocation - Source Location details of backups. +type SourceLocation struct { + // Source Azure Blob. + AzureBlob *AzureBlob `json:"azureBlob,omitempty"` + + // Source File share. + FileShare *SQLFileShare `json:"fileShare,omitempty"` + + // READ-ONLY; Backup storage Type. + FileStorageType *string `json:"fileStorageType,omitempty" azure:"ro"` +} + // SsisMigrationInfo - SSIS migration info with SSIS store type, overwrite policy. type SsisMigrationInfo struct { // The overwrite option for the SSIS environment migration @@ -6498,25 +7665,22 @@ type SyncMigrationDatabaseErrorEvent struct { TimestampString *string `json:"timestampString,omitempty" azure:"ro"` } -// SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { - // The timestamp of resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` - - // The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` - - // The type of identity that created the resource. - CreatedByType *CreatedByType `json:"createdByType,omitempty"` - - // The timestamp of resource last modification (UTC) - LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByType *CreatedByType `json:"createdByType,omitempty"` + LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` +} - // The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` +// TargetLocation - Target Location details for optional copy of backups +type TargetLocation struct { + // Storage Account Key. + AccountKey *string `json:"accountKey,omitempty"` - // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` + // Resource Id of the storage account copying backups. + StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` } // TaskList - OData page of tasks @@ -6555,7 +7719,7 @@ type TasksClientGetOptions struct { Expand *string } -// TasksClientListOptions contains the optional parameters for the TasksClient.List method. +// TasksClientListOptions contains the optional parameters for the TasksClient.NewListPager method. type TasksClientListOptions struct { // Filter tasks by task type TaskType *string @@ -6566,24 +7730,22 @@ type TasksClientUpdateOptions struct { // placeholder for future optional parameters } -// TrackedResource - ARM tracked top level resource. type TrackedResource struct { - // REQUIRED; Resource location. Location *string `json:"location,omitempty"` - // Resource tags. + // Dictionary of Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; Resource ID. + // READ-ONLY ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; Resource name. + // READ-ONLY Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - // READ-ONLY; Resource type. + // READ-ONLY Type *string `json:"type,omitempty" azure:"ro"` } @@ -6605,7 +7767,7 @@ type UploadOCIDriverTaskOutput struct { // UploadOCIDriverTaskProperties - Properties for the task that uploads an OCI driver. type UploadOCIDriverTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -6637,7 +7799,7 @@ func (u *UploadOCIDriverTaskProperties) GetProjectTaskProperties() *ProjectTaskP } } -// UsagesClientListOptions contains the optional parameters for the UsagesClient.List method. +// UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. type UsagesClientListOptions struct { // placeholder for future optional parameters } @@ -6646,7 +7808,7 @@ type UsagesClientListOptions struct { // Azure SQL DB sync migrations type ValidateMigrationInputSQLServerSQLDbSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -6718,7 +7880,7 @@ type ValidateMigrationInputSQLServerSQLMISyncTaskOutput struct { // Azure SQL Database Managed Instance sync scenario type ValidateMigrationInputSQLServerSQLMISyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -6807,7 +7969,7 @@ type ValidateMigrationInputSQLServerSQLMITaskOutput struct { // SQL Database Managed Instance type ValidateMigrationInputSQLServerSQLMITaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -6842,7 +8004,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 `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` @@ -6878,7 +8040,7 @@ func (v *ValidateMongoDbTaskProperties) GetProjectTaskProperties() *ProjectTaskP // Azure Database for PostgreSQL for online migrations type ValidateOracleAzureDbForPostgreSQLSyncTaskProperties struct { // REQUIRED; Task type. - TaskType *string `json:"taskType,omitempty"` + TaskType *TaskType `json:"taskType,omitempty"` // Key value pairs of client data to attach meta data information to task ClientData map[string]*string `json:"clientData,omitempty"` diff --git a/sdk/resourcemanager/datamigration/armdatamigration/models_serde.go b/sdk/resourcemanager/datamigration/armdatamigration/models_serde.go new file mode 100644 index 000000000000..7845842bcd43 --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/models_serde.go @@ -0,0 +1,14629 @@ +//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 + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type APIError. +func (a APIError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", a.Error) + populate(objectMap, "systemData", a.SystemData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIError. +func (a *APIError) 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 "error": + err = unpopulate(val, "Error", &a.Error) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + 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 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) + populate(objectMap, "capacity", a.Capacity) + populate(objectMap, "resourceType", a.ResourceType) + populate(objectMap, "sku", a.SKU) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableServiceSKU. +func (a *AvailableServiceSKU) 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 "capacity": + err = unpopulate(val, "Capacity", &a.Capacity) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &a.ResourceType) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &a.SKU) + 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 AvailableServiceSKUCapacity. +func (a AvailableServiceSKUCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "default", a.Default) + populate(objectMap, "maximum", a.Maximum) + populate(objectMap, "minimum", a.Minimum) + populate(objectMap, "scaleType", a.ScaleType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableServiceSKUCapacity. +func (a *AvailableServiceSKUCapacity) 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 "default": + err = unpopulate(val, "Default", &a.Default) + delete(rawMsg, key) + case "maximum": + err = unpopulate(val, "Maximum", &a.Maximum) + delete(rawMsg, key) + case "minimum": + err = unpopulate(val, "Minimum", &a.Minimum) + delete(rawMsg, key) + case "scaleType": + err = unpopulate(val, "ScaleType", &a.ScaleType) + 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 AvailableServiceSKUSKU. +func (a AvailableServiceSKUSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "family", a.Family) + populate(objectMap, "name", a.Name) + populate(objectMap, "size", a.Size) + populate(objectMap, "tier", a.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableServiceSKUSKU. +func (a *AvailableServiceSKUSKU) 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 "family": + err = unpopulate(val, "Family", &a.Family) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &a.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &a.Tier) + 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 AzureActiveDirectoryApp. +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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureActiveDirectoryApp. +func (a *AzureActiveDirectoryApp) 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 "appKey": + err = unpopulate(val, "AppKey", &a.AppKey) + delete(rawMsg, key) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + 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) + populate(objectMap, "familySequenceNumber", b.FamilySequenceNumber) + populate(objectMap, "fileLocation", b.FileLocation) + populate(objectMap, "status", b.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupFileInfo. +func (b *BackupFileInfo) 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 "familySequenceNumber": + err = unpopulate(val, "FamilySequenceNumber", &b.FamilySequenceNumber) + delete(rawMsg, key) + case "fileLocation": + err = unpopulate(val, "FileLocation", &b.FileLocation) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &b.Status) + 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 BackupSetInfo. +func (b BackupSetInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "backupFinishedDate", b.BackupFinishedDate) + populate(objectMap, "backupSetId", b.BackupSetID) + populateTimeRFC3339(objectMap, "backupStartDate", b.BackupStartDate) + populate(objectMap, "backupType", b.BackupType) + populate(objectMap, "databaseName", b.DatabaseName) + populate(objectMap, "firstLsn", b.FirstLsn) + populate(objectMap, "isBackupRestored", b.IsBackupRestored) + populate(objectMap, "lastLsn", b.LastLsn) + populateTimeRFC3339(objectMap, "lastModifiedTime", b.LastModifiedTime) + populate(objectMap, "listOfBackupFiles", b.ListOfBackupFiles) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupSetInfo. +func (b *BackupSetInfo) 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 "backupFinishedDate": + err = unpopulateTimeRFC3339(val, "BackupFinishedDate", &b.BackupFinishedDate) + delete(rawMsg, key) + case "backupSetId": + err = unpopulate(val, "BackupSetID", &b.BackupSetID) + delete(rawMsg, key) + case "backupStartDate": + err = unpopulateTimeRFC3339(val, "BackupStartDate", &b.BackupStartDate) + delete(rawMsg, key) + case "backupType": + err = unpopulate(val, "BackupType", &b.BackupType) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &b.DatabaseName) + delete(rawMsg, key) + case "firstLsn": + err = unpopulate(val, "FirstLsn", &b.FirstLsn) + delete(rawMsg, key) + case "isBackupRestored": + err = unpopulate(val, "IsBackupRestored", &b.IsBackupRestored) + delete(rawMsg, key) + case "lastLsn": + err = unpopulate(val, "LastLsn", &b.LastLsn) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulateTimeRFC3339(val, "LastModifiedTime", &b.LastModifiedTime) + delete(rawMsg, key) + case "listOfBackupFiles": + err = unpopulate(val, "ListOfBackupFiles", &b.ListOfBackupFiles) + 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 BlobShare. +func (b BlobShare) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sasUri", b.SasURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobShare. +func (b *BlobShare) 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 "sasUri": + err = unpopulate(val, "SasURI", &b.SasURI) + 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 CheckOCIDriverTaskInput. +func (c CheckOCIDriverTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serverVersion", c.ServerVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckOCIDriverTaskInput. +func (c *CheckOCIDriverTaskInput) 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 "serverVersion": + err = unpopulate(val, "ServerVersion", &c.ServerVersion) + 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 CheckOCIDriverTaskOutput. +func (c CheckOCIDriverTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "installedDriver", c.InstalledDriver) + populate(objectMap, "validationErrors", c.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckOCIDriverTaskOutput. +func (c *CheckOCIDriverTaskOutput) 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 "installedDriver": + err = unpopulate(val, "InstalledDriver", &c.InstalledDriver) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &c.ValidationErrors) + 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 CheckOCIDriverTaskProperties. +func (c CheckOCIDriverTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", c.ClientData) + populate(objectMap, "commands", c.Commands) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "input", c.Input) + populate(objectMap, "output", c.Output) + populate(objectMap, "state", c.State) + objectMap["taskType"] = TaskTypeServiceCheckOCI + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckOCIDriverTaskProperties. +func (c *CheckOCIDriverTaskProperties) 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 "clientData": + err = unpopulate(val, "ClientData", &c.ClientData) + delete(rawMsg, key) + case "commands": + c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &c.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &c.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &c.TaskType) + 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 CommandProperties. +func (c CommandProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["commandType"] = c.CommandType + populate(objectMap, "errors", c.Errors) + populate(objectMap, "state", c.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommandProperties. +func (c *CommandProperties) 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 "commandType": + err = unpopulate(val, "CommandType", &c.CommandType) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + 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 ConnectToMongoDbTaskProperties. +func (c ConnectToMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", c.ClientData) + populate(objectMap, "commands", c.Commands) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "input", c.Input) + populate(objectMap, "output", c.Output) + populate(objectMap, "state", c.State) + objectMap["taskType"] = TaskTypeConnectMongoDb + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToMongoDbTaskProperties. +func (c *ConnectToMongoDbTaskProperties) 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 "clientData": + err = unpopulate(val, "ClientData", &c.ClientData) + delete(rawMsg, key) + case "commands": + c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &c.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &c.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &c.TaskType) + 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 ConnectToSourceMySQLTaskInput. +func (c ConnectToSourceMySQLTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "checkPermissionsGroup", c.CheckPermissionsGroup) + populate(objectMap, "isOfflineMigration", c.IsOfflineMigration) + populate(objectMap, "sourceConnectionInfo", c.SourceConnectionInfo) + populate(objectMap, "targetPlatform", c.TargetPlatform) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceMySQLTaskInput. +func (c *ConnectToSourceMySQLTaskInput) 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 "checkPermissionsGroup": + err = unpopulate(val, "CheckPermissionsGroup", &c.CheckPermissionsGroup) + delete(rawMsg, key) + case "isOfflineMigration": + err = unpopulate(val, "IsOfflineMigration", &c.IsOfflineMigration) + delete(rawMsg, key) + case "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &c.SourceConnectionInfo) + delete(rawMsg, key) + case "targetPlatform": + err = unpopulate(val, "TargetPlatform", &c.TargetPlatform) + 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 ConnectToSourceMySQLTaskProperties. +func (c ConnectToSourceMySQLTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", c.ClientData) + populate(objectMap, "commands", c.Commands) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "input", c.Input) + populate(objectMap, "output", c.Output) + populate(objectMap, "state", c.State) + objectMap["taskType"] = TaskTypeConnectToSourceMySQL + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceMySQLTaskProperties. +func (c *ConnectToSourceMySQLTaskProperties) 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 "clientData": + err = unpopulate(val, "ClientData", &c.ClientData) + delete(rawMsg, key) + case "commands": + c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &c.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &c.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &c.TaskType) + 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 ConnectToSourceNonSQLTaskOutput. +func (c ConnectToSourceNonSQLTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databases", c.Databases) + populate(objectMap, "id", c.ID) + populate(objectMap, "serverProperties", c.ServerProperties) + populate(objectMap, "sourceServerBrandVersion", c.SourceServerBrandVersion) + populate(objectMap, "validationErrors", c.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceNonSQLTaskOutput. +func (c *ConnectToSourceNonSQLTaskOutput) 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 "databases": + err = unpopulate(val, "Databases", &c.Databases) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "serverProperties": + err = unpopulate(val, "ServerProperties", &c.ServerProperties) + delete(rawMsg, key) + case "sourceServerBrandVersion": + err = unpopulate(val, "SourceServerBrandVersion", &c.SourceServerBrandVersion) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &c.ValidationErrors) + 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 ConnectToSourceOracleSyncTaskInput. +func (c ConnectToSourceOracleSyncTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceConnectionInfo", c.SourceConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceOracleSyncTaskInput. +func (c *ConnectToSourceOracleSyncTaskInput) 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 "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &c.SourceConnectionInfo) + 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 ConnectToSourceOracleSyncTaskOutput. +func (c ConnectToSourceOracleSyncTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databases", c.Databases) + populate(objectMap, "sourceServerBrandVersion", c.SourceServerBrandVersion) + populate(objectMap, "sourceServerVersion", c.SourceServerVersion) + populate(objectMap, "validationErrors", c.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceOracleSyncTaskOutput. +func (c *ConnectToSourceOracleSyncTaskOutput) 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 "databases": + err = unpopulate(val, "Databases", &c.Databases) + delete(rawMsg, key) + case "sourceServerBrandVersion": + err = unpopulate(val, "SourceServerBrandVersion", &c.SourceServerBrandVersion) + delete(rawMsg, key) + case "sourceServerVersion": + err = unpopulate(val, "SourceServerVersion", &c.SourceServerVersion) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &c.ValidationErrors) + 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 ConnectToSourceOracleSyncTaskProperties. +func (c ConnectToSourceOracleSyncTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", c.ClientData) + populate(objectMap, "commands", c.Commands) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "input", c.Input) + populate(objectMap, "output", c.Output) + populate(objectMap, "state", c.State) + objectMap["taskType"] = TaskTypeConnectToSourceOracleSync + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceOracleSyncTaskProperties. +func (c *ConnectToSourceOracleSyncTaskProperties) 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 "clientData": + err = unpopulate(val, "ClientData", &c.ClientData) + delete(rawMsg, key) + case "commands": + c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &c.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &c.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &c.TaskType) + 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 ConnectToSourcePostgreSQLSyncTaskInput. +func (c ConnectToSourcePostgreSQLSyncTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceConnectionInfo", c.SourceConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourcePostgreSQLSyncTaskInput. +func (c *ConnectToSourcePostgreSQLSyncTaskInput) 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 "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &c.SourceConnectionInfo) + 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 ConnectToSourcePostgreSQLSyncTaskOutput. +func (c ConnectToSourcePostgreSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databases", c.Databases) + populate(objectMap, "id", c.ID) + populate(objectMap, "sourceServerBrandVersion", c.SourceServerBrandVersion) + populate(objectMap, "sourceServerVersion", c.SourceServerVersion) + populate(objectMap, "validationErrors", c.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourcePostgreSQLSyncTaskOutput. +func (c *ConnectToSourcePostgreSQLSyncTaskOutput) 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 "databases": + err = unpopulate(val, "Databases", &c.Databases) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "sourceServerBrandVersion": + err = unpopulate(val, "SourceServerBrandVersion", &c.SourceServerBrandVersion) + delete(rawMsg, key) + case "sourceServerVersion": + err = unpopulate(val, "SourceServerVersion", &c.SourceServerVersion) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &c.ValidationErrors) + 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 ConnectToSourcePostgreSQLSyncTaskProperties. +func (c ConnectToSourcePostgreSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", c.ClientData) + populate(objectMap, "commands", c.Commands) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "input", c.Input) + populate(objectMap, "output", c.Output) + populate(objectMap, "state", c.State) + objectMap["taskType"] = TaskTypeConnectToSourcePostgreSQLSync + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourcePostgreSQLSyncTaskProperties. +func (c *ConnectToSourcePostgreSQLSyncTaskProperties) 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 "clientData": + err = unpopulate(val, "ClientData", &c.ClientData) + delete(rawMsg, key) + case "commands": + c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &c.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &c.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &c.TaskType) + 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 ConnectToSourceSQLServerSyncTaskProperties. +func (c ConnectToSourceSQLServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", c.ClientData) + populate(objectMap, "commands", c.Commands) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "input", c.Input) + populate(objectMap, "output", c.Output) + populate(objectMap, "state", c.State) + objectMap["taskType"] = TaskTypeConnectToSourceSQLServerSync + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceSQLServerSyncTaskProperties. +func (c *ConnectToSourceSQLServerSyncTaskProperties) 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 "clientData": + err = unpopulate(val, "ClientData", &c.ClientData) + delete(rawMsg, key) + case "commands": + c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &c.Input) + delete(rawMsg, key) + case "output": + c.Output, err = unmarshalConnectToSourceSQLServerTaskOutputClassificationArray(val) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &c.TaskType) + 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 ConnectToSourceSQLServerTaskInput. +func (c ConnectToSourceSQLServerTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "checkPermissionsGroup", c.CheckPermissionsGroup) + populate(objectMap, "collectAgentJobs", c.CollectAgentJobs) + 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceSQLServerTaskInput. +func (c *ConnectToSourceSQLServerTaskInput) 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 "checkPermissionsGroup": + err = unpopulate(val, "CheckPermissionsGroup", &c.CheckPermissionsGroup) + delete(rawMsg, key) + case "collectAgentJobs": + err = unpopulate(val, "CollectAgentJobs", &c.CollectAgentJobs) + delete(rawMsg, key) + case "collectDatabases": + err = unpopulate(val, "CollectDatabases", &c.CollectDatabases) + delete(rawMsg, key) + case "collectLogins": + err = unpopulate(val, "CollectLogins", &c.CollectLogins) + delete(rawMsg, key) + 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) + case "validateSsisCatalogOnly": + err = unpopulate(val, "ValidateSsisCatalogOnly", &c.ValidateSsisCatalogOnly) + 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 ConnectToSourceSQLServerTaskOutput. +func (c ConnectToSourceSQLServerTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + objectMap["resultType"] = c.ResultType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceSQLServerTaskOutput. +func (c *ConnectToSourceSQLServerTaskOutput) 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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &c.ResultType) + 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 ConnectToSourceSQLServerTaskOutputAgentJobLevel. +func (c ConnectToSourceSQLServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "isEnabled", c.IsEnabled) + populate(objectMap, "jobCategory", c.JobCategory) + populate(objectMap, "jobOwner", c.JobOwner) + populateTimeRFC3339(objectMap, "lastExecutedOn", c.LastExecutedOn) + populate(objectMap, "migrationEligibility", c.MigrationEligibility) + populate(objectMap, "name", c.Name) + objectMap["resultType"] = "AgentJobLevelOutput" + populate(objectMap, "validationErrors", c.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceSQLServerTaskOutputAgentJobLevel. +func (c *ConnectToSourceSQLServerTaskOutputAgentJobLevel) 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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &c.IsEnabled) + delete(rawMsg, key) + case "jobCategory": + err = unpopulate(val, "JobCategory", &c.JobCategory) + delete(rawMsg, key) + case "jobOwner": + err = unpopulate(val, "JobOwner", &c.JobOwner) + delete(rawMsg, key) + case "lastExecutedOn": + err = unpopulateTimeRFC3339(val, "LastExecutedOn", &c.LastExecutedOn) + delete(rawMsg, key) + case "migrationEligibility": + err = unpopulate(val, "MigrationEligibility", &c.MigrationEligibility) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &c.ResultType) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &c.ValidationErrors) + 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 ConnectToSourceSQLServerTaskOutputDatabaseLevel. +func (c ConnectToSourceSQLServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "compatibilityLevel", c.CompatibilityLevel) + populate(objectMap, "databaseFiles", c.DatabaseFiles) + populate(objectMap, "databaseState", c.DatabaseState) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + objectMap["resultType"] = "DatabaseLevelOutput" + populate(objectMap, "sizeMB", c.SizeMB) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceSQLServerTaskOutputDatabaseLevel. +func (c *ConnectToSourceSQLServerTaskOutputDatabaseLevel) 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 "compatibilityLevel": + err = unpopulate(val, "CompatibilityLevel", &c.CompatibilityLevel) + delete(rawMsg, key) + case "databaseFiles": + err = unpopulate(val, "DatabaseFiles", &c.DatabaseFiles) + delete(rawMsg, key) + case "databaseState": + err = unpopulate(val, "DatabaseState", &c.DatabaseState) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &c.ResultType) + delete(rawMsg, key) + case "sizeMB": + err = unpopulate(val, "SizeMB", &c.SizeMB) + 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 ConnectToSourceSQLServerTaskOutputLoginLevel. +func (c ConnectToSourceSQLServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultDatabase", c.DefaultDatabase) + populate(objectMap, "id", c.ID) + populate(objectMap, "isEnabled", c.IsEnabled) + populate(objectMap, "loginType", c.LoginType) + populate(objectMap, "migrationEligibility", c.MigrationEligibility) + populate(objectMap, "name", c.Name) + objectMap["resultType"] = "LoginLevelOutput" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceSQLServerTaskOutputLoginLevel. +func (c *ConnectToSourceSQLServerTaskOutputLoginLevel) 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 "defaultDatabase": + err = unpopulate(val, "DefaultDatabase", &c.DefaultDatabase) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &c.IsEnabled) + delete(rawMsg, key) + case "loginType": + err = unpopulate(val, "LoginType", &c.LoginType) + delete(rawMsg, key) + case "migrationEligibility": + err = unpopulate(val, "MigrationEligibility", &c.MigrationEligibility) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &c.ResultType) + 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 ConnectToSourceSQLServerTaskOutputTaskLevel. +func (c ConnectToSourceSQLServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "agentJobs", c.AgentJobs) + populate(objectMap, "databaseTdeCertificateMapping", c.DatabaseTdeCertificateMapping) + populate(objectMap, "databases", c.Databases) + populate(objectMap, "id", c.ID) + populate(objectMap, "logins", c.Logins) + objectMap["resultType"] = "TaskLevelOutput" + populate(objectMap, "sourceServerBrandVersion", c.SourceServerBrandVersion) + populate(objectMap, "sourceServerVersion", c.SourceServerVersion) + populate(objectMap, "validationErrors", c.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceSQLServerTaskOutputTaskLevel. +func (c *ConnectToSourceSQLServerTaskOutputTaskLevel) 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 "agentJobs": + err = unpopulate(val, "AgentJobs", &c.AgentJobs) + delete(rawMsg, key) + case "databaseTdeCertificateMapping": + err = unpopulate(val, "DatabaseTdeCertificateMapping", &c.DatabaseTdeCertificateMapping) + delete(rawMsg, key) + case "databases": + err = unpopulate(val, "Databases", &c.Databases) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "logins": + err = unpopulate(val, "Logins", &c.Logins) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &c.ResultType) + delete(rawMsg, key) + case "sourceServerBrandVersion": + err = unpopulate(val, "SourceServerBrandVersion", &c.SourceServerBrandVersion) + delete(rawMsg, key) + case "sourceServerVersion": + err = unpopulate(val, "SourceServerVersion", &c.SourceServerVersion) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &c.ValidationErrors) + 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 ConnectToSourceSQLServerTaskProperties. +func (c ConnectToSourceSQLServerTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", c.ClientData) + populate(objectMap, "commands", c.Commands) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "input", c.Input) + populate(objectMap, "output", c.Output) + populate(objectMap, "state", c.State) + populate(objectMap, "taskId", c.TaskID) + objectMap["taskType"] = TaskTypeConnectToSourceSQLServer + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceSQLServerTaskProperties. +func (c *ConnectToSourceSQLServerTaskProperties) 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 "clientData": + err = unpopulate(val, "ClientData", &c.ClientData) + delete(rawMsg, key) + case "commands": + c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &c.Input) + delete(rawMsg, key) + case "output": + c.Output, err = unmarshalConnectToSourceSQLServerTaskOutputClassificationArray(val) + delete(rawMsg, key) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectToTargetAzureDbForMySQLTaskInput. +func (c ConnectToTargetAzureDbForMySQLTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isOfflineMigration", c.IsOfflineMigration) + populate(objectMap, "sourceConnectionInfo", c.SourceConnectionInfo) + populate(objectMap, "targetConnectionInfo", c.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetAzureDbForMySQLTaskInput. +func (c *ConnectToTargetAzureDbForMySQLTaskInput) 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 "isOfflineMigration": + err = unpopulate(val, "IsOfflineMigration", &c.IsOfflineMigration) + delete(rawMsg, key) + case "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &c.SourceConnectionInfo) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &c.TargetConnectionInfo) + 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 ConnectToTargetAzureDbForMySQLTaskOutput. +func (c ConnectToTargetAzureDbForMySQLTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databases", c.Databases) + populate(objectMap, "id", c.ID) + populate(objectMap, "serverVersion", c.ServerVersion) + populate(objectMap, "targetServerBrandVersion", c.TargetServerBrandVersion) + populate(objectMap, "validationErrors", c.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetAzureDbForMySQLTaskOutput. +func (c *ConnectToTargetAzureDbForMySQLTaskOutput) 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 "databases": + err = unpopulate(val, "Databases", &c.Databases) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "serverVersion": + err = unpopulate(val, "ServerVersion", &c.ServerVersion) + delete(rawMsg, key) + case "targetServerBrandVersion": + err = unpopulate(val, "TargetServerBrandVersion", &c.TargetServerBrandVersion) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &c.ValidationErrors) + 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 ConnectToTargetAzureDbForMySQLTaskProperties. +func (c ConnectToTargetAzureDbForMySQLTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", c.ClientData) + populate(objectMap, "commands", c.Commands) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "input", c.Input) + populate(objectMap, "output", c.Output) + populate(objectMap, "state", c.State) + objectMap["taskType"] = TaskTypeConnectToTargetAzureDbForMySQL + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetAzureDbForMySQLTaskProperties. +func (c *ConnectToTargetAzureDbForMySQLTaskProperties) 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 "clientData": + err = unpopulate(val, "ClientData", &c.ClientData) + delete(rawMsg, key) + case "commands": + c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &c.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &c.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &c.TaskType) + 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 ConnectToTargetAzureDbForPostgreSQLSyncTaskInput. +func (c ConnectToTargetAzureDbForPostgreSQLSyncTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceConnectionInfo", c.SourceConnectionInfo) + populate(objectMap, "targetConnectionInfo", c.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetAzureDbForPostgreSQLSyncTaskInput. +func (c *ConnectToTargetAzureDbForPostgreSQLSyncTaskInput) 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 "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &c.SourceConnectionInfo) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &c.TargetConnectionInfo) + 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 ConnectToTargetAzureDbForPostgreSQLSyncTaskOutput. +func (c ConnectToTargetAzureDbForPostgreSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databases", c.Databases) + populate(objectMap, "id", c.ID) + populate(objectMap, "targetServerBrandVersion", c.TargetServerBrandVersion) + populate(objectMap, "targetServerVersion", c.TargetServerVersion) + populate(objectMap, "validationErrors", c.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetAzureDbForPostgreSQLSyncTaskOutput. +func (c *ConnectToTargetAzureDbForPostgreSQLSyncTaskOutput) 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 "databases": + err = unpopulate(val, "Databases", &c.Databases) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "targetServerBrandVersion": + err = unpopulate(val, "TargetServerBrandVersion", &c.TargetServerBrandVersion) + delete(rawMsg, key) + case "targetServerVersion": + err = unpopulate(val, "TargetServerVersion", &c.TargetServerVersion) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &c.ValidationErrors) + 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 ConnectToTargetAzureDbForPostgreSQLSyncTaskProperties. +func (c ConnectToTargetAzureDbForPostgreSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", c.ClientData) + populate(objectMap, "commands", c.Commands) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "input", c.Input) + populate(objectMap, "output", c.Output) + populate(objectMap, "state", c.State) + objectMap["taskType"] = TaskTypeConnectToTargetAzureDbForPostgreSQLSync + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetAzureDbForPostgreSQLSyncTaskProperties. +func (c *ConnectToTargetAzureDbForPostgreSQLSyncTaskProperties) 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 "clientData": + err = unpopulate(val, "ClientData", &c.ClientData) + delete(rawMsg, key) + case "commands": + c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &c.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &c.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &c.TaskType) + 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 ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskInput. +func (c ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "targetConnectionInfo", c.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskInput. +func (c *ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskInput) 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 "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &c.TargetConnectionInfo) + 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 ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskOutput. +func (c ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseSchemaMap", c.DatabaseSchemaMap) + populate(objectMap, "databases", c.Databases) + populate(objectMap, "targetServerBrandVersion", c.TargetServerBrandVersion) + populate(objectMap, "targetServerVersion", c.TargetServerVersion) + populate(objectMap, "validationErrors", c.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskOutput. +func (c *ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskOutput) 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 "databaseSchemaMap": + err = unpopulate(val, "DatabaseSchemaMap", &c.DatabaseSchemaMap) + delete(rawMsg, key) + case "databases": + err = unpopulate(val, "Databases", &c.Databases) + delete(rawMsg, key) + case "targetServerBrandVersion": + err = unpopulate(val, "TargetServerBrandVersion", &c.TargetServerBrandVersion) + delete(rawMsg, key) + case "targetServerVersion": + err = unpopulate(val, "TargetServerVersion", &c.TargetServerVersion) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &c.ValidationErrors) + 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 ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskOutputDatabaseSchemaMapItem. +func (c ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskOutputDatabaseSchemaMapItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "database", c.Database) + populate(objectMap, "schemas", c.Schemas) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskOutputDatabaseSchemaMapItem. +func (c *ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskOutputDatabaseSchemaMapItem) 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 "database": + err = unpopulate(val, "Database", &c.Database) + delete(rawMsg, key) + case "schemas": + err = unpopulate(val, "Schemas", &c.Schemas) + 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 ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskProperties. +func (c ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", c.ClientData) + populate(objectMap, "commands", c.Commands) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "input", c.Input) + populate(objectMap, "output", c.Output) + populate(objectMap, "state", c.State) + objectMap["taskType"] = TaskTypeConnectToTargetOracleAzureDbForPostgreSQLSync + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskProperties. +func (c *ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskProperties) 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 "clientData": + err = unpopulate(val, "ClientData", &c.ClientData) + delete(rawMsg, key) + case "commands": + c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &c.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &c.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &c.TaskType) + 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 ConnectToTargetSQLDbSyncTaskInput. +func (c ConnectToTargetSQLDbSyncTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceConnectionInfo", c.SourceConnectionInfo) + populate(objectMap, "targetConnectionInfo", c.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLDbSyncTaskInput. +func (c *ConnectToTargetSQLDbSyncTaskInput) 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 "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &c.SourceConnectionInfo) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &c.TargetConnectionInfo) + 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 ConnectToTargetSQLDbSyncTaskProperties. +func (c ConnectToTargetSQLDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", c.ClientData) + populate(objectMap, "commands", c.Commands) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "input", c.Input) + populate(objectMap, "output", c.Output) + populate(objectMap, "state", c.State) + objectMap["taskType"] = TaskTypeConnectToTargetSQLDbSync + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLDbSyncTaskProperties. +func (c *ConnectToTargetSQLDbSyncTaskProperties) 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 "clientData": + err = unpopulate(val, "ClientData", &c.ClientData) + delete(rawMsg, key) + case "commands": + c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &c.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &c.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &c.TaskType) + 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 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLDbTaskInput. +func (c *ConnectToTargetSQLDbTaskInput) 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 "queryObjectCounts": + err = unpopulate(val, "QueryObjectCounts", &c.QueryObjectCounts) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &c.TargetConnectionInfo) + 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 ConnectToTargetSQLDbTaskOutput. +func (c ConnectToTargetSQLDbTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databases", c.Databases) + populate(objectMap, "id", c.ID) + populate(objectMap, "targetServerBrandVersion", c.TargetServerBrandVersion) + populate(objectMap, "targetServerVersion", c.TargetServerVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLDbTaskOutput. +func (c *ConnectToTargetSQLDbTaskOutput) 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 "databases": + err = unpopulate(val, "Databases", &c.Databases) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "targetServerBrandVersion": + err = unpopulate(val, "TargetServerBrandVersion", &c.TargetServerBrandVersion) + delete(rawMsg, key) + case "targetServerVersion": + err = unpopulate(val, "TargetServerVersion", &c.TargetServerVersion) + 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 ConnectToTargetSQLDbTaskProperties. +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"] = TaskTypeConnectToTargetSQLDb + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLDbTaskProperties. +func (c *ConnectToTargetSQLDbTaskProperties) 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 "clientData": + err = unpopulate(val, "ClientData", &c.ClientData) + delete(rawMsg, key) + 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) + case "input": + err = unpopulate(val, "Input", &c.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &c.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &c.TaskType) + 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 ConnectToTargetSQLMISyncTaskInput. +func (c ConnectToTargetSQLMISyncTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureApp", c.AzureApp) + populate(objectMap, "targetConnectionInfo", c.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLMISyncTaskInput. +func (c *ConnectToTargetSQLMISyncTaskInput) 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 "azureApp": + err = unpopulate(val, "AzureApp", &c.AzureApp) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &c.TargetConnectionInfo) + 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 ConnectToTargetSQLMISyncTaskOutput. +func (c ConnectToTargetSQLMISyncTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "targetServerBrandVersion", c.TargetServerBrandVersion) + populate(objectMap, "targetServerVersion", c.TargetServerVersion) + populate(objectMap, "validationErrors", c.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLMISyncTaskOutput. +func (c *ConnectToTargetSQLMISyncTaskOutput) 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 "targetServerBrandVersion": + err = unpopulate(val, "TargetServerBrandVersion", &c.TargetServerBrandVersion) + delete(rawMsg, key) + case "targetServerVersion": + err = unpopulate(val, "TargetServerVersion", &c.TargetServerVersion) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &c.ValidationErrors) + 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 ConnectToTargetSQLMISyncTaskProperties. +func (c ConnectToTargetSQLMISyncTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", c.ClientData) + populate(objectMap, "commands", c.Commands) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "input", c.Input) + populate(objectMap, "output", c.Output) + populate(objectMap, "state", c.State) + objectMap["taskType"] = TaskTypeConnectToTargetAzureSQLDbMISyncLRS + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLMISyncTaskProperties. +func (c *ConnectToTargetSQLMISyncTaskProperties) 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 "clientData": + err = unpopulate(val, "ClientData", &c.ClientData) + delete(rawMsg, key) + case "commands": + c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &c.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &c.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &c.TaskType) + 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 ConnectToTargetSQLMITaskInput. +func (c ConnectToTargetSQLMITaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "collectAgentJobs", c.CollectAgentJobs) + populate(objectMap, "collectLogins", c.CollectLogins) + populate(objectMap, "targetConnectionInfo", c.TargetConnectionInfo) + populate(objectMap, "validateSsisCatalogOnly", c.ValidateSsisCatalogOnly) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLMITaskInput. +func (c *ConnectToTargetSQLMITaskInput) 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 "collectAgentJobs": + err = unpopulate(val, "CollectAgentJobs", &c.CollectAgentJobs) + delete(rawMsg, key) + case "collectLogins": + err = unpopulate(val, "CollectLogins", &c.CollectLogins) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &c.TargetConnectionInfo) + delete(rawMsg, key) + case "validateSsisCatalogOnly": + err = unpopulate(val, "ValidateSsisCatalogOnly", &c.ValidateSsisCatalogOnly) + 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 ConnectToTargetSQLMITaskOutput. +func (c ConnectToTargetSQLMITaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "agentJobs", c.AgentJobs) + populate(objectMap, "id", c.ID) + populate(objectMap, "logins", c.Logins) + populate(objectMap, "targetServerBrandVersion", c.TargetServerBrandVersion) + populate(objectMap, "targetServerVersion", c.TargetServerVersion) + populate(objectMap, "validationErrors", c.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLMITaskOutput. +func (c *ConnectToTargetSQLMITaskOutput) 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 "agentJobs": + err = unpopulate(val, "AgentJobs", &c.AgentJobs) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "logins": + err = unpopulate(val, "Logins", &c.Logins) + delete(rawMsg, key) + case "targetServerBrandVersion": + err = unpopulate(val, "TargetServerBrandVersion", &c.TargetServerBrandVersion) + delete(rawMsg, key) + case "targetServerVersion": + err = unpopulate(val, "TargetServerVersion", &c.TargetServerVersion) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &c.ValidationErrors) + 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 ConnectToTargetSQLMITaskProperties. +func (c ConnectToTargetSQLMITaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", c.ClientData) + populate(objectMap, "commands", c.Commands) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "input", c.Input) + populate(objectMap, "output", c.Output) + populate(objectMap, "state", c.State) + objectMap["taskType"] = TaskTypeConnectToTargetAzureSQLDbMI + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLMITaskProperties. +func (c *ConnectToTargetSQLMITaskProperties) 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 "clientData": + err = unpopulate(val, "ClientData", &c.ClientData) + delete(rawMsg, key) + case "commands": + c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &c.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &c.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &c.TaskType) + 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 ConnectionInfo. +func (c ConnectionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "password", c.Password) + objectMap["type"] = c.Type + populate(objectMap, "userName", c.UserName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionInfo. +func (c *ConnectionInfo) 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 "password": + err = unpopulate(val, "Password", &c.Password) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &c.UserName) + 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 CopyProgressDetails. +func (c CopyProgressDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "copyDuration", c.CopyDuration) + populateTimeRFC3339(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 = unpopulateTimeRFC3339(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) + populate(objectMap, "failedObjects", d.FailedObjects) + populate(objectMap, "validationErrors", d.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataIntegrityValidationResult. +func (d *DataIntegrityValidationResult) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "failedObjects": + err = unpopulate(val, "FailedObjects", &d.FailedObjects) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &d.ValidationErrors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataItemMigrationSummaryResult. +func (d DataItemMigrationSummaryResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(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) + populateTimeRFC3339(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 DataItemMigrationSummaryResult. +func (d *DataItemMigrationSummaryResult) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "endedOn": + err = unpopulateTimeRFC3339(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) + 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 "startedOn": + err = unpopulateTimeRFC3339(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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Database. +func (d Database) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "collation", d.Collation) + populate(objectMap, "compatibilityLevel", d.CompatibilityLevel) + populate(objectMap, "databaseState", d.DatabaseState) + populate(objectMap, "fqdn", d.Fqdn) + populate(objectMap, "id", d.ID) + populate(objectMap, "installId", d.InstallID) + populate(objectMap, "name", d.Name) + populate(objectMap, "serverCoreCount", d.ServerCoreCount) + populate(objectMap, "serverDefaultBackupPath", d.ServerDefaultBackupPath) + populate(objectMap, "serverDefaultDataPath", d.ServerDefaultDataPath) + populate(objectMap, "serverDefaultLogPath", d.ServerDefaultLogPath) + populate(objectMap, "serverEdition", d.ServerEdition) + populate(objectMap, "serverId", d.ServerID) + populate(objectMap, "serverLevel", d.ServerLevel) + populate(objectMap, "serverName", d.ServerName) + populate(objectMap, "serverVersion", d.ServerVersion) + populate(objectMap, "serverVisibleOnlineCoreCount", d.ServerVisibleOnlineCoreCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Database. +func (d *Database) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "collation": + err = unpopulate(val, "Collation", &d.Collation) + delete(rawMsg, key) + case "compatibilityLevel": + err = unpopulate(val, "CompatibilityLevel", &d.CompatibilityLevel) + delete(rawMsg, key) + case "databaseState": + err = unpopulate(val, "DatabaseState", &d.DatabaseState) + delete(rawMsg, key) + case "fqdn": + err = unpopulate(val, "Fqdn", &d.Fqdn) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "installId": + err = unpopulate(val, "InstallID", &d.InstallID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "serverCoreCount": + err = unpopulate(val, "ServerCoreCount", &d.ServerCoreCount) + delete(rawMsg, key) + case "serverDefaultBackupPath": + err = unpopulate(val, "ServerDefaultBackupPath", &d.ServerDefaultBackupPath) + delete(rawMsg, key) + case "serverDefaultDataPath": + err = unpopulate(val, "ServerDefaultDataPath", &d.ServerDefaultDataPath) + delete(rawMsg, key) + case "serverDefaultLogPath": + err = unpopulate(val, "ServerDefaultLogPath", &d.ServerDefaultLogPath) + delete(rawMsg, key) + case "serverEdition": + err = unpopulate(val, "ServerEdition", &d.ServerEdition) + delete(rawMsg, key) + case "serverId": + err = unpopulate(val, "ServerID", &d.ServerID) + delete(rawMsg, key) + case "serverLevel": + err = unpopulate(val, "ServerLevel", &d.ServerLevel) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &d.ServerName) + delete(rawMsg, key) + case "serverVersion": + err = unpopulate(val, "ServerVersion", &d.ServerVersion) + delete(rawMsg, key) + case "serverVisibleOnlineCoreCount": + err = unpopulate(val, "ServerVisibleOnlineCoreCount", &d.ServerVisibleOnlineCoreCount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseBackupInfo. +func (d DatabaseBackupInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupFiles", d.BackupFiles) + populateTimeRFC3339(objectMap, "backupFinishDate", d.BackupFinishDate) + populate(objectMap, "backupType", d.BackupType) + populate(objectMap, "databaseName", d.DatabaseName) + populate(objectMap, "familyCount", d.FamilyCount) + populate(objectMap, "isCompressed", d.IsCompressed) + populate(objectMap, "isDamaged", d.IsDamaged) + populate(objectMap, "position", d.Position) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseBackupInfo. +func (d *DatabaseBackupInfo) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupFiles": + err = unpopulate(val, "BackupFiles", &d.BackupFiles) + delete(rawMsg, key) + case "backupFinishDate": + err = unpopulateTimeRFC3339(val, "BackupFinishDate", &d.BackupFinishDate) + delete(rawMsg, key) + case "backupType": + err = unpopulate(val, "BackupType", &d.BackupType) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &d.DatabaseName) + delete(rawMsg, key) + case "familyCount": + err = unpopulate(val, "FamilyCount", &d.FamilyCount) + delete(rawMsg, key) + case "isCompressed": + err = unpopulate(val, "IsCompressed", &d.IsCompressed) + delete(rawMsg, key) + case "isDamaged": + err = unpopulate(val, "IsDamaged", &d.IsDamaged) + delete(rawMsg, key) + case "position": + err = unpopulate(val, "Position", &d.Position) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseFileInfo. +func (d DatabaseFileInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseName", d.DatabaseName) + populate(objectMap, "fileType", d.FileType) + populate(objectMap, "id", d.ID) + populate(objectMap, "logicalName", d.LogicalName) + populate(objectMap, "physicalFullName", d.PhysicalFullName) + populate(objectMap, "restoreFullName", d.RestoreFullName) + populate(objectMap, "sizeMB", d.SizeMB) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseFileInfo. +func (d *DatabaseFileInfo) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &d.DatabaseName) + delete(rawMsg, key) + case "fileType": + err = unpopulate(val, "FileType", &d.FileType) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "logicalName": + err = unpopulate(val, "LogicalName", &d.LogicalName) + delete(rawMsg, key) + case "physicalFullName": + err = unpopulate(val, "PhysicalFullName", &d.PhysicalFullName) + delete(rawMsg, key) + case "restoreFullName": + err = unpopulate(val, "RestoreFullName", &d.RestoreFullName) + delete(rawMsg, key) + case "sizeMB": + err = unpopulate(val, "SizeMB", &d.SizeMB) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseFileInput. +func (d DatabaseFileInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fileType", d.FileType) + populate(objectMap, "id", d.ID) + populate(objectMap, "logicalName", d.LogicalName) + populate(objectMap, "physicalFullName", d.PhysicalFullName) + populate(objectMap, "restoreFullName", d.RestoreFullName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseFileInput. +func (d *DatabaseFileInput) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "fileType": + err = unpopulate(val, "FileType", &d.FileType) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "logicalName": + err = unpopulate(val, "LogicalName", &d.LogicalName) + delete(rawMsg, key) + case "physicalFullName": + err = unpopulate(val, "PhysicalFullName", &d.PhysicalFullName) + delete(rawMsg, key) + case "restoreFullName": + err = unpopulate(val, "RestoreFullName", &d.RestoreFullName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseInfo. +func (d DatabaseInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceDatabaseName", d.SourceDatabaseName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseInfo. +func (d *DatabaseInfo) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "sourceDatabaseName": + err = unpopulate(val, "SourceDatabaseName", &d.SourceDatabaseName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigration. +func (d DatabaseMigration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + d.Properties, err = unmarshalDatabaseMigrationPropertiesClassification(val) + 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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationListResult. +func (d DatabaseMigrationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationProperties. +func (d DatabaseMigrationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(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) + populate(objectMap, "sourceDatabaseName", d.SourceDatabaseName) + populate(objectMap, "sourceSqlConnection", d.SourceSQLConnection) + populate(objectMap, "sourceServerName", d.SourceServerName) + populateTimeRFC3339(objectMap, "startedOn", d.StartedOn) + populate(objectMap, "targetDatabaseCollation", d.TargetDatabaseCollation) + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endedOn": + err = unpopulateTimeRFC3339(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 "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 = unpopulateTimeRFC3339(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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationPropertiesSQLDb. +func (d DatabaseMigrationPropertiesSQLDb) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(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) + populateTimeRFC3339(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 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endedOn": + err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationPropertiesSQLMi. +func (d DatabaseMigrationPropertiesSQLMi) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupConfiguration", d.BackupConfiguration) + populateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "startedOn", d.StartedOn) + populate(objectMap, "targetDatabaseCollation", d.TargetDatabaseCollation) + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupConfiguration": + err = unpopulate(val, "BackupConfiguration", &d.BackupConfiguration) + delete(rawMsg, key) + case "endedOn": + err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationPropertiesSQLVM. +func (d DatabaseMigrationPropertiesSQLVM) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupConfiguration", d.BackupConfiguration) + populateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "startedOn", d.StartedOn) + populate(objectMap, "targetDatabaseCollation", d.TargetDatabaseCollation) + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupConfiguration": + err = unpopulate(val, "BackupConfiguration", &d.BackupConfiguration) + delete(rawMsg, key) + case "endedOn": + err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationSQLDb. +func (d DatabaseMigrationSQLDb) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + 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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationSQLMi. +func (d DatabaseMigrationSQLMi) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + 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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationSQLVM. +func (d DatabaseMigrationSQLVM) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + 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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseObjectName. +func (d DatabaseObjectName) 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) + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &d.DatabaseName) + delete(rawMsg, key) + 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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseSummaryResult. +func (d DatabaseSummaryResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(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) + populateTimeRFC3339(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 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endedOn": + err = unpopulateTimeRFC3339(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) + 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 = unpopulateTimeRFC3339(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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseTable. +func (d DatabaseTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hasRows", d.HasRows) + populate(objectMap, "name", d.Name) + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hasRows": + err = unpopulate(val, "HasRows", &d.HasRows) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeleteNode. +func (d DeleteNode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "integrationRuntimeName", d.IntegrationRuntimeName) + populate(objectMap, "nodeName", d.NodeName) + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "integrationRuntimeName": + err = unpopulate(val, "IntegrationRuntimeName", &d.IntegrationRuntimeName) + delete(rawMsg, key) + case "nodeName": + err = unpopulate(val, "NodeName", &d.NodeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Error. +func (e Error) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "message", e.Message) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorInfo. +func (e ErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExecutionStatistics. +func (e ExecutionStatistics) 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) + return json.Marshal(objectMap) +} + +// 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", e, 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) + 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", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileList. +func (f FileList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileShare. +func (f FileShare) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", f, 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) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &f.UserName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileStorageInfo. +func (f FileStorageInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "headers", f.Headers) + populate(objectMap, "uri", f.URI) + return json.Marshal(objectMap) +} + +// 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + 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", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetProjectDetailsNonSQLTaskInput. +func (g GetProjectDetailsNonSQLTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "projectLocation", g.ProjectLocation) + populate(objectMap, "projectName", g.ProjectName) + return json.Marshal(objectMap) +} + +// 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + 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", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetTdeCertificatesSQLTaskInput. +func (g GetTdeCertificatesSQLTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupFileShare": + err = unpopulate(val, "BackupFileShare", &g.BackupFileShare) + delete(rawMsg, key) + case "connectionInfo": + err = unpopulate(val, "ConnectionInfo", &g.ConnectionInfo) + delete(rawMsg, key) + case "selectedCertificates": + err = unpopulate(val, "SelectedCertificates", &g.SelectedCertificates) + 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 GetTdeCertificatesSQLTaskOutput. +func (g GetTdeCertificatesSQLTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "base64EncodedCertificates", g.Base64EncodedCertificates) + populate(objectMap, "validationErrors", g.ValidationErrors) + return json.Marshal(objectMap) +} + +// 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "base64EncodedCertificates": + err = unpopulate(val, "Base64EncodedCertificates", &g.Base64EncodedCertificates) + 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 GetTdeCertificatesSQLTaskProperties. +func (g GetTdeCertificatesSQLTaskProperties) 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"] = TaskTypeGetTDECertificatesSQL + return json.Marshal(objectMap) +} + +// 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", 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 GetUserTablesMySQLTaskInput. +func (g GetUserTablesMySQLTaskInput) 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 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", 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 GetUserTablesMySQLTaskOutput. +func (g GetUserTablesMySQLTaskOutput) 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 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", 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 GetUserTablesMySQLTaskProperties. +func (g GetUserTablesMySQLTaskProperties) 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"] = TaskTypeGetUserTablesMySQL + return json.Marshal(objectMap) +} + +// 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", 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 GetUserTablesOracleTaskInput. +func (g GetUserTablesOracleTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionInfo", g.ConnectionInfo) + populate(objectMap, "selectedSchemas", g.SelectedSchemas) + return json.Marshal(objectMap) +} + +// 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connectionInfo": + err = unpopulate(val, "ConnectionInfo", &g.ConnectionInfo) + delete(rawMsg, key) + case "selectedSchemas": + err = unpopulate(val, "SelectedSchemas", &g.SelectedSchemas) + 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 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) + populateTimeRFC3339(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 = unpopulateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "errorCount", m.ErrorCount) + populate(objectMap, "errorPrefix", m.ErrorPrefix) + populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) + populate(objectMap, "id", m.ID) + populateTimeRFC3339(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) + populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) + populate(objectMap, "id", m.ID) + populateTimeRFC3339(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) + populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "errorPrefix", m.ErrorPrefix) + populate(objectMap, "id", m.ID) + populate(objectMap, "itemsCompletedCount", m.ItemsCompletedCount) + populate(objectMap, "itemsCount", m.ItemsCount) + populateTimeRFC3339(objectMap, "lastStorageUpdate", m.LastStorageUpdate) + populate(objectMap, "objectName", m.ObjectName) + populate(objectMap, "resultPrefix", m.ResultPrefix) + objectMap["resultType"] = "TableLevelOutput" + populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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) + populateTimeRFC3339(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" + populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "id", m.ID) + objectMap["resultType"] = "MigrationLevelOutput" + populate(objectMap, "sourceServer", m.SourceServer) + populate(objectMap, "sourceServerVersion", m.SourceServerVersion) + populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "fullLoadEndedOn", m.FullLoadEndedOn) + populateTimeRFC3339(objectMap, "fullLoadEstFinishTime", m.FullLoadEstFinishTime) + populateTimeRFC3339(objectMap, "fullLoadStartedOn", m.FullLoadStartedOn) + populate(objectMap, "fullLoadTotalRows", m.FullLoadTotalRows) + populate(objectMap, "id", m.ID) + populateTimeRFC3339(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 = unpopulateTimeRFC3339(val, "FullLoadEndedOn", &m.FullLoadEndedOn) + delete(rawMsg, key) + case "fullLoadEstFinishTime": + err = unpopulateTimeRFC3339(val, "FullLoadEstFinishTime", &m.FullLoadEstFinishTime) + delete(rawMsg, key) + case "fullLoadStartedOn": + err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 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) + } + 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 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 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) + } + 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 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) + populateTimeRFC3339(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" + populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + return json.Marshal(objectMap) +} + +// 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) + } + 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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigrateOracleAzureDbPostgreSQLSyncTaskOutputError. +func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputError) 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 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) + } + 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 MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel. +func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "id", m.ID) + objectMap["resultType"] = "MigrationLevelOutput" + populate(objectMap, "sourceServer", m.SourceServer) + populate(objectMap, "sourceServerVersion", m.SourceServerVersion) + populateTimeRFC3339(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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "endedOn": + err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel. +func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel) 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) + populateTimeRFC3339(objectMap, "fullLoadEndedOn", m.FullLoadEndedOn) + populateTimeRFC3339(objectMap, "fullLoadEstFinishTime", m.FullLoadEstFinishTime) + populateTimeRFC3339(objectMap, "fullLoadStartedOn", m.FullLoadStartedOn) + populate(objectMap, "fullLoadTotalRows", m.FullLoadTotalRows) + populate(objectMap, "id", m.ID) + populateTimeRFC3339(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 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) + } + 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 = unpopulateTimeRFC3339(val, "FullLoadEndedOn", &m.FullLoadEndedOn) + delete(rawMsg, key) + case "fullLoadEstFinishTime": + err = unpopulateTimeRFC3339(val, "FullLoadEstFinishTime", &m.FullLoadEstFinishTime) + delete(rawMsg, key) + case "fullLoadStartedOn": + err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput. +func (m MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput) 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, "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 "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 "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) { + objectMap := make(map[string]any) + populate(objectMap, "name", m.Name) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &m.Name) + 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 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) + populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// 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) + } + 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 = unpopulateTimeRFC3339(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 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 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) + } + 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 MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseError. +func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseError) 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 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) + } + 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 MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseLevel. +func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseLevel) 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) + populateTimeRFC3339(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" + populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + return json.Marshal(objectMap) +} + +// 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) + } + 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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + 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) + 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 MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel. +func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseCount", m.DatabaseCount) + populateTimeRFC3339(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) + populateTimeRFC3339(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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseCount": + err = unpopulate(val, "DatabaseCount", &m.DatabaseCount) + delete(rawMsg, key) + case "endedOn": + err = unpopulateTimeRFC3339(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 "sourceServerType": + err = unpopulate(val, "SourceServerType", &m.SourceServerType) + delete(rawMsg, key) + case "sourceServerVersion": + err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) + delete(rawMsg, key) + case "startedOn": + err = unpopulateTimeRFC3339(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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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) + populate(objectMap, "cdcUpdateCounter", m.CdcUpdateCounter) + populate(objectMap, "dataErrorsCounter", m.DataErrorsCounter) + populate(objectMap, "databaseName", m.DatabaseName) + populateTimeRFC3339(objectMap, "fullLoadEndedOn", m.FullLoadEndedOn) + populateTimeRFC3339(objectMap, "fullLoadEstFinishTime", m.FullLoadEstFinishTime) + populateTimeRFC3339(objectMap, "fullLoadStartedOn", m.FullLoadStartedOn) + populate(objectMap, "fullLoadTotalRows", m.FullLoadTotalRows) + populate(objectMap, "id", m.ID) + populateTimeRFC3339(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 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) + } + 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 = unpopulateTimeRFC3339(val, "FullLoadEndedOn", &m.FullLoadEndedOn) + delete(rawMsg, key) + case "fullLoadEstFinishTime": + err = unpopulateTimeRFC3339(val, "FullLoadEstFinishTime", &m.FullLoadEstFinishTime) + delete(rawMsg, key) + case "fullLoadStartedOn": + err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 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) + populate(objectMap, "taskId", m.TaskID) + objectMap["taskType"] = TaskTypeMigratePostgreSQLAzureDbForPostgreSQLSyncV2 + return json.Marshal(objectMap) +} + +// 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) + } + 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 "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) + 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 MigrateSQLServerDatabaseInput. +func (m MigrateSQLServerDatabaseInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupAndRestoreFolder": + err = unpopulate(val, "BackupAndRestoreFolder", &m.BackupAndRestoreFolder) + delete(rawMsg, key) + case "databaseFiles": + err = unpopulate(val, "DatabaseFiles", &m.DatabaseFiles) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "restoreDatabaseName": + err = unpopulate(val, "RestoreDatabaseName", &m.RestoreDatabaseName) + 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 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) + populate(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 "makeSourceDbReadOnly": + err = unpopulate(val, "MakeSourceDbReadOnly", &m.MakeSourceDbReadOnly) + delete(rawMsg, key) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncDatabaseInput. +func (m MigrateSQLServerSQLDbSyncDatabaseInput) 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) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + 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) + 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 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 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) + } + 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) + case "validationOptions": + err = unpopulate(val, "ValidationOptions", &m.ValidationOptions) + 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 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 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) + } + 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 MigrateSQLServerSQLDbSyncTaskOutputDatabaseError. +func (m MigrateSQLServerSQLDbSyncTaskOutputDatabaseError) 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 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) + } + 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 MigrateSQLServerSQLDbSyncTaskOutputDatabaseLevel. +func (m MigrateSQLServerSQLDbSyncTaskOutputDatabaseLevel) 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) + populateTimeRFC3339(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" + populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + return json.Marshal(objectMap) +} + +// 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) + } + 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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigrateSQLServerSQLDbSyncTaskOutputError. +func (m MigrateSQLServerSQLDbSyncTaskOutputError) 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 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) + } + 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 MigrateSQLServerSQLDbSyncTaskOutputMigrationLevel. +func (m MigrateSQLServerSQLDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseCount", m.DatabaseCount) + populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "id", m.ID) + objectMap["resultType"] = "MigrationLevelOutput" + populate(objectMap, "sourceServer", m.SourceServer) + populate(objectMap, "sourceServerVersion", m.SourceServerVersion) + populateTimeRFC3339(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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseCount": + err = unpopulate(val, "DatabaseCount", &m.DatabaseCount) + delete(rawMsg, key) + case "endedOn": + err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigrateSQLServerSQLDbSyncTaskOutputTableLevel. +func (m MigrateSQLServerSQLDbSyncTaskOutputTableLevel) 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) + populateTimeRFC3339(objectMap, "fullLoadEndedOn", m.FullLoadEndedOn) + populateTimeRFC3339(objectMap, "fullLoadEstFinishTime", m.FullLoadEstFinishTime) + populateTimeRFC3339(objectMap, "fullLoadStartedOn", m.FullLoadStartedOn) + populate(objectMap, "fullLoadTotalRows", m.FullLoadTotalRows) + populate(objectMap, "id", m.ID) + populateTimeRFC3339(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 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) + } + 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 = unpopulateTimeRFC3339(val, "FullLoadEndedOn", &m.FullLoadEndedOn) + delete(rawMsg, key) + case "fullLoadEstFinishTime": + err = unpopulateTimeRFC3339(val, "FullLoadEstFinishTime", &m.FullLoadEstFinishTime) + delete(rawMsg, key) + case "fullLoadStartedOn": + err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 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"] = TaskTypeMigrateSQLServerAzureSQLDbSync + 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) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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 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) + } + 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) + } + } + return nil +} + +// 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 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) + } + 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 MigrateSQLServerSQLDbTaskOutputDatabaseLevel. +func (m MigrateSQLServerSQLDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseName", m.DatabaseName) + populateTimeRFC3339(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, "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) + populateTimeRFC3339(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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) + delete(rawMsg, key) + case "endedOn": + err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigrateSQLServerSQLDbTaskOutputDatabaseLevelValidationResult. +func (m MigrateSQLServerSQLDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataIntegrityValidationResult", m.DataIntegrityValidationResult) + populateTimeRFC3339(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) + populateTimeRFC3339(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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataIntegrityValidationResult": + err = unpopulate(val, "DataIntegrityValidationResult", &m.DataIntegrityValidationResult) + delete(rawMsg, key) + case "endedOn": + err = unpopulateTimeRFC3339(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 "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 = unpopulateTimeRFC3339(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) + } + } + return nil +} + +// 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) + objectMap["resultType"] = "ErrorOutput" + return json.Marshal(objectMap) +} + +// 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) + } + 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 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) + populateTimeRFC3339(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) + populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "errorPrefix", m.ErrorPrefix) + 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" + populateTimeRFC3339(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 { + 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 = unpopulateTimeRFC3339(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 "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 = unpopulateTimeRFC3339(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 MigrateSQLServerSQLDbTaskOutputValidationResult. +func (m MigrateSQLServerSQLDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + 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 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) + } + 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 "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) + } + } + return nil +} + +// 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) + populate(objectMap, "taskId", m.TaskID) + objectMap["taskType"] = TaskTypeMigrateSQLServerSQLDb + return json.Marshal(objectMap) +} + +// 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) + } + 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 "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 = 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMIDatabaseInput. +func (m MigrateSQLServerSQLMIDatabaseInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupFilePaths": + err = unpopulate(val, "BackupFilePaths", &m.BackupFilePaths) + delete(rawMsg, key) + 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) + delete(rawMsg, key) + case "restoreDatabaseName": + err = unpopulate(val, "RestoreDatabaseName", &m.RestoreDatabaseName) + 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, "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 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) + delete(rawMsg, key) + case "backupFileShare": + err = unpopulate(val, "BackupFileShare", &m.BackupFileShare) + delete(rawMsg, key) + case "numberOfParallelDatabaseMigrations": + err = unpopulate(val, "NumberOfParallelDatabaseMigrations", &m.NumberOfParallelDatabaseMigrations) + 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 "storageResourceId": + err = unpopulate(val, "StorageResourceID", &m.StorageResourceID) + 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 MigrateSQLServerSQLMISyncTaskOutput. +func (m MigrateSQLServerSQLMISyncTaskOutput) 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 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) + } + 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 MigrateSQLServerSQLMISyncTaskOutputDatabaseLevel. +func (m MigrateSQLServerSQLMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "activeBackupSets", m.ActiveBackupSets) + populate(objectMap, "containerName", m.ContainerName) + populateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + return json.Marshal(objectMap) +} + +// 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) + } + 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 = unpopulateTimeRFC3339(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) + delete(rawMsg, key) + case "sourceDatabaseName": + err = unpopulate(val, "SourceDatabaseName", &m.SourceDatabaseName) + delete(rawMsg, key) + case "startedOn": + err = unpopulateTimeRFC3339(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 MigrateSQLServerSQLMISyncTaskOutputError. +func (m MigrateSQLServerSQLMISyncTaskOutputError) 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 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) + } + 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 MigrateSQLServerSQLMISyncTaskOutputMigrationLevel. +func (m MigrateSQLServerSQLMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseCount", m.DatabaseCount) + populate(objectMap, "databaseErrorCount", m.DatabaseErrorCount) + populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "id", m.ID) + objectMap["resultType"] = "MigrationLevelOutput" + populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) + populate(objectMap, "sourceServerName", m.SourceServerName) + populate(objectMap, "sourceServerVersion", m.SourceServerVersion) + populateTimeRFC3339(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 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) + } + 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 = unpopulateTimeRFC3339(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 "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 = unpopulateTimeRFC3339(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) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskProperties. +func (m MigrateSQLServerSQLMISyncTaskProperties) 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, "output", m.Output) + populate(objectMap, "state", m.State) + objectMap["taskType"] = TaskTypeMigrateSQLServerAzureSQLDbMISyncLRS + return json.Marshal(objectMap) +} + +// 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) + } + 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 "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 "output": + m.Output, err = unmarshalMigrateSQLServerSQLMISyncTaskOutputClassificationArray(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 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 "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) + delete(rawMsg, key) + case "encryptedKeyForSecureFields": + err = unpopulate(val, "EncryptedKeyForSecureFields", &m.EncryptedKeyForSecureFields) + delete(rawMsg, key) + case "selectedAgentJobs": + err = unpopulate(val, "SelectedAgentJobs", &m.SelectedAgentJobs) + delete(rawMsg, key) + case "selectedDatabases": + err = unpopulate(val, "SelectedDatabases", &m.SelectedDatabases) + delete(rawMsg, key) + case "selectedLogins": + err = unpopulate(val, "SelectedLogins", &m.SelectedLogins) + 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 MigrateSQLServerSQLMITaskOutput. +func (m MigrateSQLServerSQLMITaskOutput) 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 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) + } + 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 MigrateSQLServerSQLMITaskOutputAgentJobLevel. +func (m MigrateSQLServerSQLMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) + populate(objectMap, "id", m.ID) + populate(objectMap, "isEnabled", m.IsEnabled) + populate(objectMap, "message", m.Message) + populate(objectMap, "name", m.Name) + objectMap["resultType"] = "AgentJobLevelOutput" + populateTimeRFC3339(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 { + 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 = unpopulateTimeRFC3339(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 "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 = unpopulateTimeRFC3339(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) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputDatabaseLevel. +func (m MigrateSQLServerSQLMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseName", m.DatabaseName) + populateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + 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 { + 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 = unpopulateTimeRFC3339(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 "sizeMB": + err = unpopulate(val, "SizeMB", &m.SizeMB) + delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &m.Stage) + delete(rawMsg, key) + case "startedOn": + err = unpopulateTimeRFC3339(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) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputError. +func (m MigrateSQLServerSQLMITaskOutputError) 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 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) + } + 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 MigrateSQLServerSQLMITaskOutputLoginLevel. +func (m MigrateSQLServerSQLMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "state", m.State) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "endedOn": + err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputMigrationLevel. +func (m MigrateSQLServerSQLMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "agentJobs", m.AgentJobs) + populate(objectMap, "databases", m.Databases) + populateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "state", m.State) + 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 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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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) + 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 MigrateSQLServerSQLMITaskProperties. +func (m MigrateSQLServerSQLMITaskProperties) 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, "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 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) + } + 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 "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 = unmarshalMigrateSQLServerSQLMITaskOutputClassificationArray(val) + delete(rawMsg, key) + case "parentTaskId": + err = unpopulate(val, "ParentTaskID", &m.ParentTaskID) + 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 MigrateSchemaSQLServerSQLDbDatabaseInput. +func (m MigrateSchemaSQLServerSQLDbDatabaseInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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, "id", m.ID) + objectMap["resultType"] = m.ResultType + return json.Marshal(objectMap) +} + +// 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) + } + 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 MigrateSchemaSQLServerSQLDbTaskOutputDatabaseLevel. +func (m MigrateSchemaSQLServerSQLDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseErrorResultPrefix", m.DatabaseErrorResultPrefix) + populate(objectMap, "databaseName", m.DatabaseName) + populateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "state", m.State) + return json.Marshal(objectMap) +} + +// 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) + } + 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 = unpopulateTimeRFC3339(val, "EndedOn", &m.EndedOn) + delete(rawMsg, key) + case "fileId": + err = unpopulate(val, "FileID", &m.FileID) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "numberOfFailedOperations": + err = unpopulate(val, "NumberOfFailedOperations", &m.NumberOfFailedOperations) + delete(rawMsg, key) + 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 = unpopulateTimeRFC3339(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) + } + } + return nil +} + +// 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) + objectMap["resultType"] = "SchemaErrorOutput" + return json.Marshal(objectMap) +} + +// 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) + } + 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 "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 MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel. +func (m MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "id", m.ID) + objectMap["resultType"] = "MigrationLevelOutput" + populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) + populate(objectMap, "sourceServerVersion", m.SourceServerVersion) + populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "state", m.State) + populate(objectMap, "targetServerBrandVersion", m.TargetServerBrandVersion) + populate(objectMap, "targetServerVersion", m.TargetServerVersion) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "endedOn": + err = unpopulateTimeRFC3339(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 "sourceServerBrandVersion": + err = unpopulate(val, "SourceServerBrandVersion", &m.SourceServerBrandVersion) + delete(rawMsg, key) + case "sourceServerVersion": + err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) + delete(rawMsg, key) + case "startedOn": + err = unpopulateTimeRFC3339(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 "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 MigrateSchemaSQLServerSQLDbTaskProperties. +func (m MigrateSchemaSQLServerSQLDbTaskProperties) 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) + populate(objectMap, "taskId", m.TaskID) + objectMap["taskType"] = TaskTypeMigrateSchemaSQLServerSQLDb + return json.Marshal(objectMap) +} + +// 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) + } + 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 "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 = unmarshalMigrateSchemaSQLServerSQLDbTaskOutputClassificationArray(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 MigrateSchemaSQLTaskOutputError. +func (m MigrateSchemaSQLTaskOutputError) 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 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) + } + 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 MigrateSsisTaskInput. +func (m MigrateSsisTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &m.SourceConnectionInfo) + delete(rawMsg, key) + case "ssisMigrationInfo": + err = unpopulate(val, "SsisMigrationInfo", &m.SsisMigrationInfo) + 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 MigrateSsisTaskOutput. +func (m MigrateSsisTaskOutput) 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 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) + } + 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 MigrateSsisTaskOutputMigrationLevel. +func (m MigrateSsisTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "endedOn": + err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(val, "StartedOn", &m.StartedOn) + delete(rawMsg, key) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateSsisTaskOutputProjectLevel. +func (m MigrateSsisTaskOutputProjectLevel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(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) + populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) + populate(objectMap, "state", m.State) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "endedOn": + err = unpopulateTimeRFC3339(val, "EndedOn", &m.EndedOn) + delete(rawMsg, key) + case "exceptionsAndWarnings": + err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) + delete(rawMsg, key) + case "folderName": + err = unpopulate(val, "FolderName", &m.FolderName) + 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 "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 = unpopulateTimeRFC3339(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) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateSsisTaskProperties. +func (m MigrateSsisTaskProperties) 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"] = TaskTypeMigrateSsis + return json.Marshal(objectMap) +} + +// 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) + } + 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 = unmarshalMigrateSsisTaskOutputClassificationArray(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 MigrateSyncCompleteCommandInput. +func (m MigrateSyncCompleteCommandInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "commitTimeStamp", m.CommitTimeStamp) + populate(objectMap, "databaseName", m.DatabaseName) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "commitTimeStamp": + err = unpopulateTimeRFC3339(val, "CommitTimeStamp", &m.CommitTimeStamp) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) + 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 MigrateSyncCompleteCommandOutput. +func (m MigrateSyncCompleteCommandOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errors", m.Errors) + populate(objectMap, "id", m.ID) + return json.Marshal(objectMap) +} + +// 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) + } + 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) + 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 MigrateSyncCompleteCommandProperties. +func (m MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "commandId": + err = unpopulate(val, "CommandID", &m.CommandID) + delete(rawMsg, 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 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) + delete(rawMsg, key) + case "validationMessages": + err = unpopulate(val, "ValidationMessages", &m.ValidationMessages) + 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 MigrationOperationInput. +func (m MigrationOperationInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "migrationOperationId", m.MigrationOperationID) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "migrationOperationId": + err = unpopulate(val, "MigrationOperationID", &m.MigrationOperationID) + 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 MigrationReportResult. +func (m MigrationReportResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "reportUrl", m.ReportURL) + return json.Marshal(objectMap) +} + +// 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 "reportUrl": + err = unpopulate(val, "ReportURL", &m.ReportURL) + 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 MigrationStatusDetails. +func (m MigrationStatusDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "activeBackupSets": + err = unpopulate(val, "ActiveBackupSets", &m.ActiveBackupSets) + delete(rawMsg, key) + case "blobContainerName": + err = unpopulate(val, "BlobContainerName", &m.BlobContainerName) + delete(rawMsg, key) + case "completeRestoreErrorMessage": + err = unpopulate(val, "CompleteRestoreErrorMessage", &m.CompleteRestoreErrorMessage) + delete(rawMsg, key) + case "currentRestoringFilename": + err = unpopulate(val, "CurrentRestoringFilename", &m.CurrentRestoringFilename) + delete(rawMsg, key) + case "fileUploadBlockingErrors": + err = unpopulate(val, "FileUploadBlockingErrors", &m.FileUploadBlockingErrors) + delete(rawMsg, key) + case "fullBackupSetInfo": + err = unpopulate(val, "FullBackupSetInfo", &m.FullBackupSetInfo) + delete(rawMsg, key) + case "invalidFiles": + err = unpopulate(val, "InvalidFiles", &m.InvalidFiles) + 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 "lastRestoredFilename": + err = unpopulate(val, "LastRestoredFilename", &m.LastRestoredFilename) + delete(rawMsg, key) + case "migrationState": + err = unpopulate(val, "MigrationState", &m.MigrationState) + delete(rawMsg, key) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationTableMetadata. +func (m MigrationTableMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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) + populateTimeRFC3339(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) + populateTimeRFC3339(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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataIntegrityValidationResult": + err = unpopulate(val, "DataIntegrityValidationResult", &m.DataIntegrityValidationResult) + delete(rawMsg, key) + case "endedOn": + err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationValidationDatabaseSummaryResult. +func (m MigrationValidationDatabaseSummaryResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) + populate(objectMap, "id", m.ID) + populate(objectMap, "migrationId", m.MigrationID) + populate(objectMap, "sourceDatabaseName", m.SourceDatabaseName) + populateTimeRFC3339(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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "endedOn": + err = unpopulateTimeRFC3339(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) + delete(rawMsg, key) + case "startedOn": + err = unpopulateTimeRFC3339(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) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationValidationOptions. +func (m MigrationValidationOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "enableDataIntegrityValidation": + err = unpopulate(val, "EnableDataIntegrityValidation", &m.EnableDataIntegrityValidation) + delete(rawMsg, key) + case "enableQueryAnalysisValidation": + err = unpopulate(val, "EnableQueryAnalysisValidation", &m.EnableQueryAnalysisValidation) + delete(rawMsg, key) + case "enableSchemaValidation": + err = unpopulate(val, "EnableSchemaValidation", &m.EnableSchemaValidation) + 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 MigrationValidationResult. +func (m MigrationValidationResult) 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) + return json.Marshal(objectMap) +} + +// 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) + } + 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) + 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) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MongoDbCancelCommand. +func (m MongoDbCancelCommand) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + 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 MongoDbClusterInfo. +func (m MongoDbClusterInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "databases": + err = unpopulate(val, "Databases", &m.Databases) + delete(rawMsg, key) + case "supportsSharding": + err = unpopulate(val, "SupportsSharding", &m.SupportsSharding) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &m.Version) + 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 MongoDbCollectionInfo. +func (m MongoDbCollectionInfo) 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 { + 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 "averageDocumentSize": + err = unpopulate(val, "AverageDocumentSize", &m.AverageDocumentSize) + delete(rawMsg, key) + 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) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MongoDbCollectionProgress. +func (m MongoDbCollectionProgress) 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) + populateTimeRFC3339(objectMap, "lastEventTime", m.LastEventTime) + populateTimeRFC3339(objectMap, "lastReplayTime", m.LastReplayTime) + populate(objectMap, "name", m.Name) + populate(objectMap, "qualifiedName", m.QualifiedName) + objectMap["resultType"] = MongoDbProgressResultTypeCollection + 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 { + 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 "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 = unpopulateTimeRFC3339(val, "LastEventTime", &m.LastEventTime) + delete(rawMsg, key) + case "lastReplayTime": + err = unpopulateTimeRFC3339(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) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MongoDbCollectionSettings. +func (m MongoDbCollectionSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "canDelete": + err = unpopulate(val, "CanDelete", &m.CanDelete) + delete(rawMsg, key) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MongoDbCommandInput. +func (m MongoDbCommandInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "objectName", m.ObjectName) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "objectName": + err = unpopulate(val, "ObjectName", &m.ObjectName) + 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 MongoDbConnectionInfo. +func (m MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalSettings": + err = unpopulate(val, "AdditionalSettings", &m.AdditionalSettings) + delete(rawMsg, key) + case "authentication": + err = unpopulate(val, "Authentication", &m.Authentication) + delete(rawMsg, key) + case "connectionString": + err = unpopulate(val, "ConnectionString", &m.ConnectionString) + 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 "enforceSSL": + err = unpopulate(val, "EnforceSSL", &m.EnforceSSL) + 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 "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 { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MongoDbDatabaseInfo. +func (m MongoDbDatabaseInfo) 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) + return json.Marshal(objectMap) +} + +// 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) + } + 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) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MongoDbDatabaseProgress. +func (m MongoDbDatabaseProgress) 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) + populateTimeRFC3339(objectMap, "lastEventTime", m.LastEventTime) + populateTimeRFC3339(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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "bytesCopied": + err = unpopulate(val, "BytesCopied", &m.BytesCopied) + delete(rawMsg, key) + 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 = unpopulateTimeRFC3339(val, "LastEventTime", &m.LastEventTime) + delete(rawMsg, key) + case "lastReplayTime": + err = unpopulateTimeRFC3339(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) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MongoDbDatabaseSettings. +func (m MongoDbDatabaseSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "collections", m.Collections) + populate(objectMap, "targetRUs", m.TargetRUs) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "collections": + err = unpopulate(val, "Collections", &m.Collections) + delete(rawMsg, key) + case "targetRUs": + err = unpopulate(val, "TargetRUs", &m.TargetRUs) + 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 MongoDbError. +func (m MongoDbError) 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) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &m.Code) + delete(rawMsg, key) + case "count": + err = unpopulate(val, "Count", &m.Count) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &m.Message) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + 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 MongoDbFinishCommand. +func (m MongoDbFinishCommand) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + 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 MongoDbFinishCommandInput. +func (m MongoDbFinishCommandInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "immediate", m.Immediate) + populate(objectMap, "objectName", m.ObjectName) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "immediate": + err = unpopulate(val, "Immediate", &m.Immediate) + delete(rawMsg, key) + case "objectName": + err = unpopulate(val, "ObjectName", &m.ObjectName) + 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 MongoDbMigrationProgress. +func (m MongoDbMigrationProgress) 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) + populateTimeRFC3339(objectMap, "lastEventTime", m.LastEventTime) + populateTimeRFC3339(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 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) + } + 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 = unpopulateTimeRFC3339(val, "LastEventTime", &m.LastEventTime) + delete(rawMsg, key) + case "lastReplayTime": + err = unpopulateTimeRFC3339(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) + } + } + return nil +} + +// 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, "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 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) + } + 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) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &m.Source) + delete(rawMsg, key) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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, "documentCount", m.DocumentCount) + populate(objectMap, "name", m.Name) + populate(objectMap, "qualifiedName", m.QualifiedName) + return json.Marshal(objectMap) +} + +// 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) + } + 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) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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) + populate(objectMap, "elapsedTime", m.ElapsedTime) + populate(objectMap, "errors", m.Errors) + populate(objectMap, "eventsPending", m.EventsPending) + populate(objectMap, "eventsReplayed", m.EventsReplayed) + populateTimeRFC3339(objectMap, "lastEventTime", m.LastEventTime) + populateTimeRFC3339(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) + return json.Marshal(objectMap) +} + +// 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) + } + 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 = unpopulateTimeRFC3339(val, "LastEventTime", &m.LastEventTime) + delete(rawMsg, key) + case "lastReplayTime": + err = unpopulateTimeRFC3339(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) + } + } + 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 "minFreeMemoryMb": + err = unpopulate(val, "MinFreeMemoryMb", &m.MinFreeMemoryMb) + 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 MySQLConnectionInfo. +func (m MySQLConnectionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + 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) + 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 NameAvailabilityRequest. +func (n NameAvailabilityRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", n.Name) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + 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 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 "nameAvailable": + err = unpopulate(val, "NameAvailable", &n.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &n.Reason) + 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 NodeMonitoringData. +func (n NodeMonitoringData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalProperties": + err = unpopulate(val, "AdditionalProperties", &n.AdditionalProperties) + delete(rawMsg, key) + case "availableMemoryInMB": + err = unpopulate(val, "AvailableMemoryInMB", &n.AvailableMemoryInMB) + delete(rawMsg, key) + case "cpuUtilization": + err = unpopulate(val, "CPUUtilization", &n.CPUUtilization) + delete(rawMsg, key) + case "concurrentJobsLimit": + err = unpopulate(val, "ConcurrentJobsLimit", &n.ConcurrentJobsLimit) + delete(rawMsg, key) + case "concurrentJobsRunning": + err = unpopulate(val, "ConcurrentJobsRunning", &n.ConcurrentJobsRunning) + delete(rawMsg, key) + case "maxConcurrentJobs": + err = unpopulate(val, "MaxConcurrentJobs", &n.MaxConcurrentJobs) + delete(rawMsg, key) + case "nodeName": + err = unpopulate(val, "NodeName", &n.NodeName) + delete(rawMsg, key) + case "receivedBytes": + err = unpopulate(val, "ReceivedBytes", &n.ReceivedBytes) + delete(rawMsg, key) + 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 "errors": + err = unpopulate(val, "Errors", &n.Errors) + delete(rawMsg, key) + case "resultCode": + err = unpopulate(val, "ResultCode", &n.ResultCode) + delete(rawMsg, key) + case "sourceName": + err = unpopulate(val, "SourceName", &n.SourceName) + delete(rawMsg, key) + case "sourceRowCount": + err = unpopulate(val, "SourceRowCount", &n.SourceRowCount) + delete(rawMsg, key) + case "targetName": + err = unpopulate(val, "TargetName", &n.TargetName) + delete(rawMsg, key) + case "targetRowCount": + err = unpopulate(val, "TargetRowCount", &n.TargetRowCount) + 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 NonSQLMigrationTaskInput. +func (n NonSQLMigrationTaskInput) 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) + return json.Marshal(objectMap) +} + +// 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "projectLocation": + err = unpopulate(val, "ProjectLocation", &n.ProjectLocation) + delete(rawMsg, key) + 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", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NonSQLMigrationTaskOutput. +func (n NonSQLMigrationTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataMigrationTableResults", n.DataMigrationTableResults) + populateTimeRFC3339(objectMap, "endedOn", n.EndedOn) + populate(objectMap, "id", n.ID) + populate(objectMap, "progressMessage", n.ProgressMessage) + populate(objectMap, "sourceServerName", n.SourceServerName) + populateTimeRFC3339(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 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", n, 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 = unpopulateTimeRFC3339(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) + delete(rawMsg, key) + case "startedOn": + err = unpopulateTimeRFC3339(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", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ODataError. +func (o ODataError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &o.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &o.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &o.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OfflineConfiguration. +func (o OfflineConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "lastBackupName", o.LastBackupName) + populate(objectMap, "offline", o.Offline) + return json.Marshal(objectMap) +} + +// 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "lastBackupName": + err = unpopulate(val, "LastBackupName", &o.LastBackupName) + delete(rawMsg, key) + case "offline": + err = unpopulate(val, "Offline", &o.Offline) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationsDefinition. +func (o OperationsDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + 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", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationsDisplayDefinition. +func (o OperationsDisplayDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OracleConnectionInfo. +func (o OracleConnectionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authentication": + err = unpopulate(val, "Authentication", &o.Authentication) + delete(rawMsg, key) + case "dataSource": + err = unpopulate(val, "DataSource", &o.DataSource) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &o.Password) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &o.Port) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &o.ServerName) + delete(rawMsg, key) + case "serverVersion": + err = unpopulate(val, "ServerVersion", &o.ServerVersion) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &o.UserName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OracleOCIDriverInfo. +func (o OracleOCIDriverInfo) 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) + return json.Marshal(objectMap) +} + +// 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", o, 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) + delete(rawMsg, key) + 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", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OrphanedUserInfo. +func (o OrphanedUserInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseName", o.DatabaseName) + populate(objectMap, "name", o.Name) + return json.Marshal(objectMap) +} + +// 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &o.DatabaseName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PostgreSQLConnectionInfo. +func (p PostgreSQLConnectionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalSettings": + err = unpopulate(val, "AdditionalSettings", &p.AdditionalSettings) + delete(rawMsg, key) + 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", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Project. +func (p Project) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", p, 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 "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", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProjectFile. +func (p ProjectFile) 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) + return json.Marshal(objectMap) +} + +// 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", p, 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": + 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", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProjectFileProperties. +func (p ProjectFileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "extension", p.Extension) + populate(objectMap, "filePath", p.FilePath) + populateTimeRFC3339(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 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "extension": + err = unpopulate(val, "Extension", &p.Extension) + delete(rawMsg, key) + case "filePath": + err = unpopulate(val, "FilePath", &p.FilePath) + delete(rawMsg, key) + case "lastModified": + err = unpopulateTimeRFC3339(val, "LastModified", &p.LastModified) + delete(rawMsg, key) + case "mediaType": + err = unpopulate(val, "MediaType", &p.MediaType) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &p.Size) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProjectList. +func (p ProjectList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProjectMetadata. +func (p ProjectMetadata) 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) + return json.Marshal(objectMap) +} + +// 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", p, 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) + 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", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProjectProperties. +func (p ProjectProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureAuthenticationInfo", p.AzureAuthenticationInfo) + populateTimeRFC3339(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 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureAuthenticationInfo": + err = unpopulate(val, "AzureAuthenticationInfo", &p.AzureAuthenticationInfo) + delete(rawMsg, key) + case "creationTime": + err = unpopulateTimeRFC3339(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", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProjectTask. +func (p ProjectTask) 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) + return json.Marshal(objectMap) +} + +// 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", p, 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) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProjectTaskProperties. +func (p ProjectTaskProperties) 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 + return json.Marshal(objectMap) +} + +// 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", p, 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) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &p.Errors) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &p.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &p.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueryAnalysisValidationResult. +func (q QueryAnalysisValidationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "queryResults", q.QueryResults) + populate(objectMap, "validationErrors", q.ValidationErrors) + return json.Marshal(objectMap) +} + +// 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "queryResults": + err = unpopulate(val, "QueryResults", &q.QueryResults) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &q.ValidationErrors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueryExecutionResult. +func (q QueryExecutionResult) 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) + return json.Marshal(objectMap) +} + +// 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", q, 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) + delete(rawMsg, key) + case "statementsInBatch": + err = unpopulate(val, "StatementsInBatch", &q.StatementsInBatch) + delete(rawMsg, key) + case "targetResult": + err = unpopulate(val, "TargetResult", &q.TargetResult) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Quota. +func (q Quota) 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) + return json.Marshal(objectMap) +} + +// 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", q, 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) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &q.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QuotaList. +func (q QuotaList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", q.NextLink) + populate(objectMap, "value", q.Value) + return json.Marshal(objectMap) +} + +// 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &q.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &q.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QuotaName. +func (q QuotaName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "localizedValue", q.LocalizedValue) + populate(objectMap, "value", q.Value) + return json.Marshal(objectMap) +} + +// 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &q.LocalizedValue) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &q.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegenAuthKeys. +func (r RegenAuthKeys) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authKey1": + err = unpopulate(val, "AuthKey1", &r.AuthKey1) + delete(rawMsg, key) + case "authKey2": + err = unpopulate(val, "AuthKey2", &r.AuthKey2) + delete(rawMsg, key) + case "keyName": + err = unpopulate(val, "KeyName", &r.KeyName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReportableException. +func (r ReportableException) 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) + return json.Marshal(objectMap) +} + +// 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionableMessage": + err = unpopulate(val, "ActionableMessage", &r.ActionableMessage) + delete(rawMsg, key) + case "filePath": + err = unpopulate(val, "FilePath", &r.FilePath) + delete(rawMsg, key) + case "hResult": + err = unpopulate(val, "HResult", &r.HResult) + delete(rawMsg, key) + case "lineNumber": + err = unpopulate(val, "LineNumber", &r.LineNumber) + delete(rawMsg, key) + 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", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// 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 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", r, 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) + 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", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapabilities. +func (r ResourceSKUCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", r.Name) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// 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", r, 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) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapacity. +func (r ResourceSKUCapacity) 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) + return json.Marshal(objectMap) +} + +// 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", r, 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) + delete(rawMsg, key) + case "minimum": + err = unpopulate(val, "Minimum", &r.Minimum) + delete(rawMsg, key) + case "scaleType": + err = unpopulate(val, "ScaleType", &r.ScaleType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCosts. +func (r ResourceSKUCosts) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", r, 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) + delete(rawMsg, key) + case "quantity": + err = unpopulate(val, "Quantity", &r.Quantity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceSKURestrictions. +func (r ResourceSKURestrictions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "reasonCode": + err = unpopulate(val, "ReasonCode", &r.ReasonCode) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &r.Values) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceSKUsResult. +func (r ResourceSKUsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SQLBackupFileInfo. +func (s SQLBackupFileInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "copyDuration": + err = unpopulate(val, "CopyDuration", &s.CopyDuration) + delete(rawMsg, key) + case "copyThroughput": + err = unpopulate(val, "CopyThroughput", &s.CopyThroughput) + delete(rawMsg, key) + 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", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SQLBackupSetInfo. +func (s SQLBackupSetInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "backupFinishDate", s.BackupFinishDate) + populate(objectMap, "backupSetId", s.BackupSetID) + populateTimeRFC3339(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 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupFinishDate": + err = unpopulateTimeRFC3339(val, "BackupFinishDate", &s.BackupFinishDate) + delete(rawMsg, key) + case "backupSetId": + err = unpopulate(val, "BackupSetID", &s.BackupSetID) + delete(rawMsg, key) + case "backupStartDate": + err = unpopulateTimeRFC3339(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", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SQLConnectionInfo. +func (s SQLConnectionInfo) 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, "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 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", s, err) + } + 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 "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", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SQLConnectionInformation. +func (s SQLConnectionInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", s, err) + } + for key, val := range rawMsg { + var err error + switch 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 "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", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SQLDbMigrationStatusDetails. +func (s SQLDbMigrationStatusDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "listOfCopyProgressDetails": + err = unpopulate(val, "ListOfCopyProgressDetails", &s.ListOfCopyProgressDetails) + delete(rawMsg, key) + case "migrationState": + err = unpopulate(val, "MigrationState", &s.MigrationState) + delete(rawMsg, key) + case "sqlDataCopyErrors": + err = unpopulate(val, "SQLDataCopyErrors", &s.SQLDataCopyErrors) + 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 SQLDbOfflineConfiguration. +func (s SQLDbOfflineConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "offline", s.Offline) + return json.Marshal(objectMap) +} + +// 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "offline": + err = unpopulate(val, "Offline", &s.Offline) + 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 SQLFileShare. +func (s SQLFileShare) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "password": + err = unpopulate(val, "Password", &s.Password) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &s.Path) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &s.Username) + 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 SQLMigrationListResult. +func (s SQLMigrationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + 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 SQLMigrationService. +func (s SQLMigrationService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + 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", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SQLMigrationServiceProperties. +func (s SQLMigrationServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "integrationRuntimeState", s.IntegrationRuntimeState) + populate(objectMap, "provisioningState", s.ProvisioningState) + return json.Marshal(objectMap) +} + +// 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "integrationRuntimeState": + err = unpopulate(val, "IntegrationRuntimeState", &s.IntegrationRuntimeState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + 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 SQLMigrationServiceUpdate. +func (s SQLMigrationServiceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + 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 SQLMigrationTaskInput. +func (s SQLMigrationTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceConnectionInfo", s.SourceConnectionInfo) + populate(objectMap, "targetConnectionInfo", s.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLMigrationTaskInput. +func (s *SQLMigrationTaskInput) 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 "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &s.SourceConnectionInfo) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &s.TargetConnectionInfo) + 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 SQLServerSQLMISyncTaskInput. +func (s SQLServerSQLMISyncTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureApp", s.AzureApp) + populate(objectMap, "backupFileShare", s.BackupFileShare) + populate(objectMap, "selectedDatabases", s.SelectedDatabases) + populate(objectMap, "sourceConnectionInfo", s.SourceConnectionInfo) + populate(objectMap, "storageResourceId", s.StorageResourceID) + populate(objectMap, "targetConnectionInfo", s.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLServerSQLMISyncTaskInput. +func (s *SQLServerSQLMISyncTaskInput) 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 "azureApp": + err = unpopulate(val, "AzureApp", &s.AzureApp) + delete(rawMsg, key) + case "backupFileShare": + err = unpopulate(val, "BackupFileShare", &s.BackupFileShare) + delete(rawMsg, key) + case "selectedDatabases": + err = unpopulate(val, "SelectedDatabases", &s.SelectedDatabases) + delete(rawMsg, key) + case "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &s.SourceConnectionInfo) + delete(rawMsg, key) + case "storageResourceId": + err = unpopulate(val, "StorageResourceID", &s.StorageResourceID) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &s.TargetConnectionInfo) + 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 SchemaComparisonValidationResult. +func (s SchemaComparisonValidationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "schemaDifferences", s.SchemaDifferences) + populate(objectMap, "sourceDatabaseObjectCount", s.SourceDatabaseObjectCount) + populate(objectMap, "targetDatabaseObjectCount", s.TargetDatabaseObjectCount) + populate(objectMap, "validationErrors", s.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SchemaComparisonValidationResult. +func (s *SchemaComparisonValidationResult) 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 "schemaDifferences": + err = unpopulate(val, "SchemaDifferences", &s.SchemaDifferences) + delete(rawMsg, key) + case "sourceDatabaseObjectCount": + err = unpopulate(val, "SourceDatabaseObjectCount", &s.SourceDatabaseObjectCount) + delete(rawMsg, key) + case "targetDatabaseObjectCount": + err = unpopulate(val, "TargetDatabaseObjectCount", &s.TargetDatabaseObjectCount) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &s.ValidationErrors) + 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 SchemaComparisonValidationResultType. +func (s SchemaComparisonValidationResultType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "objectName", s.ObjectName) + populate(objectMap, "objectType", s.ObjectType) + populate(objectMap, "updateAction", s.UpdateAction) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SchemaComparisonValidationResultType. +func (s *SchemaComparisonValidationResultType) 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 "objectName": + err = unpopulate(val, "ObjectName", &s.ObjectName) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &s.ObjectType) + delete(rawMsg, key) + case "updateAction": + err = unpopulate(val, "UpdateAction", &s.UpdateAction) + 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 SchemaMigrationSetting. +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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SchemaMigrationSetting. +func (s *SchemaMigrationSetting) 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 "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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SelectedCertificateInput. +func (s SelectedCertificateInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificateName", s.CertificateName) + populate(objectMap, "password", s.Password) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SelectedCertificateInput. +func (s *SelectedCertificateInput) 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 "certificateName": + err = unpopulate(val, "CertificateName", &s.CertificateName) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &s.Password) + 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 ServerProperties. +func (s ServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serverDatabaseCount", s.ServerDatabaseCount) + populate(objectMap, "serverEdition", s.ServerEdition) + populate(objectMap, "serverName", s.ServerName) + populate(objectMap, "serverOperatingSystemVersion", s.ServerOperatingSystemVersion) + populate(objectMap, "serverPlatform", s.ServerPlatform) + populate(objectMap, "serverVersion", s.ServerVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerProperties. +func (s *ServerProperties) 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 "serverDatabaseCount": + err = unpopulate(val, "ServerDatabaseCount", &s.ServerDatabaseCount) + delete(rawMsg, key) + case "serverEdition": + err = unpopulate(val, "ServerEdition", &s.ServerEdition) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &s.ServerName) + delete(rawMsg, key) + case "serverOperatingSystemVersion": + err = unpopulate(val, "ServerOperatingSystemVersion", &s.ServerOperatingSystemVersion) + delete(rawMsg, key) + case "serverPlatform": + err = unpopulate(val, "ServerPlatform", &s.ServerPlatform) + delete(rawMsg, key) + case "serverVersion": + err = unpopulate(val, "ServerVersion", &s.ServerVersion) + 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 Service. +func (s Service) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + 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 Service. +func (s *Service) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + 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", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceList. +func (s ServiceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceList. +func (s *ServiceList) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + 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 ServiceOperation. +func (s ServiceOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", s.Display) + populate(objectMap, "name", s.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceOperation. +func (s *ServiceOperation) 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 "display": + err = unpopulate(val, "Display", &s.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + 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 ServiceOperationDisplay. +func (s ServiceOperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", s.Description) + populate(objectMap, "operation", s.Operation) + populate(objectMap, "provider", s.Provider) + populate(objectMap, "resource", s.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceOperationDisplay. +func (s *ServiceOperationDisplay) 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 "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &s.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &s.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &s.Resource) + 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 ServiceOperationList. +func (s ServiceOperationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceOperationList. +func (s *ServiceOperationList) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + 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 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) + populate(objectMap, "virtualSubnetId", s.VirtualSubnetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProperties. +func (s *ServiceProperties) 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 "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) + case "publicKey": + err = unpopulate(val, "PublicKey", &s.PublicKey) + delete(rawMsg, key) + case "virtualNicId": + err = unpopulate(val, "VirtualNicID", &s.VirtualNicID) + delete(rawMsg, key) + case "virtualSubnetId": + err = unpopulate(val, "VirtualSubnetID", &s.VirtualSubnetID) + 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 ServiceSKU. +func (s ServiceSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "family", s.Family) + populate(objectMap, "name", s.Name) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSKU. +func (s *ServiceSKU) 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 "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) + delete(rawMsg, key) + case "family": + err = unpopulate(val, "Family", &s.Family) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &s.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + 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 ServiceSKUList. +func (s ServiceSKUList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSKUList. +func (s *ServiceSKUList) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + 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 ServiceStatusResponse. +func (s ServiceStatusResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "agentConfiguration", &s.AgentConfiguration) + populate(objectMap, "agentVersion", s.AgentVersion) + populate(objectMap, "status", s.Status) + populate(objectMap, "supportedTaskTypes", s.SupportedTaskTypes) + populate(objectMap, "vmSize", s.VMSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceStatusResponse. +func (s *ServiceStatusResponse) 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 "agentConfiguration": + err = unpopulate(val, "AgentConfiguration", &s.AgentConfiguration) + delete(rawMsg, key) + case "agentVersion": + err = unpopulate(val, "AgentVersion", &s.AgentVersion) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "supportedTaskTypes": + err = unpopulate(val, "SupportedTaskTypes", &s.SupportedTaskTypes) + delete(rawMsg, key) + case "vmSize": + err = unpopulate(val, "VMSize", &s.VMSize) + 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 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) + populate(objectMap, "environmentOverwriteOption", s.EnvironmentOverwriteOption) + populate(objectMap, "projectOverwriteOption", s.ProjectOverwriteOption) + populate(objectMap, "ssisStoreType", s.SsisStoreType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SsisMigrationInfo. +func (s *SsisMigrationInfo) 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 "environmentOverwriteOption": + err = unpopulate(val, "EnvironmentOverwriteOption", &s.EnvironmentOverwriteOption) + delete(rawMsg, key) + case "projectOverwriteOption": + err = unpopulate(val, "ProjectOverwriteOption", &s.ProjectOverwriteOption) + delete(rawMsg, key) + case "ssisStoreType": + err = unpopulate(val, "SsisStoreType", &s.SsisStoreType) + 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 StartMigrationScenarioServerRoleResult. +func (s StartMigrationScenarioServerRoleResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exceptionsAndWarnings", s.ExceptionsAndWarnings) + populate(objectMap, "name", s.Name) + populate(objectMap, "state", s.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StartMigrationScenarioServerRoleResult. +func (s *StartMigrationScenarioServerRoleResult) 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 "exceptionsAndWarnings": + err = unpopulate(val, "ExceptionsAndWarnings", &s.ExceptionsAndWarnings) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + 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 SyncMigrationDatabaseErrorEvent. +func (s SyncMigrationDatabaseErrorEvent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eventText", s.EventText) + populate(objectMap, "eventTypeString", s.EventTypeString) + populate(objectMap, "timestampString", s.TimestampString) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncMigrationDatabaseErrorEvent. +func (s *SyncMigrationDatabaseErrorEvent) 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 "eventText": + err = unpopulate(val, "EventText", &s.EventText) + delete(rawMsg, key) + case "eventTypeString": + err = unpopulate(val, "EventTypeString", &s.EventTypeString) + delete(rawMsg, key) + case "timestampString": + err = unpopulate(val, "TimestampString", &s.TimestampString) + 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 SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(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 SystemData. +func (s *SystemData) 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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TaskList. +func (t *TaskList) 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 "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + 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 TrackedResource. +func (t TrackedResource) 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 TrackedResource. +func (t *TrackedResource) 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) + populate(objectMap, "driverShare", u.DriverShare) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UploadOCIDriverTaskInput. +func (u *UploadOCIDriverTaskInput) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "driverShare": + err = unpopulate(val, "DriverShare", &u.DriverShare) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UploadOCIDriverTaskOutput. +func (u UploadOCIDriverTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "driverPackageName", u.DriverPackageName) + populate(objectMap, "validationErrors", u.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UploadOCIDriverTaskOutput. +func (u *UploadOCIDriverTaskOutput) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "driverPackageName": + err = unpopulate(val, "DriverPackageName", &u.DriverPackageName) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &u.ValidationErrors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UploadOCIDriverTaskProperties. +func (u UploadOCIDriverTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", u.ClientData) + populate(objectMap, "commands", u.Commands) + populate(objectMap, "errors", u.Errors) + populate(objectMap, "input", u.Input) + populate(objectMap, "output", u.Output) + populate(objectMap, "state", u.State) + objectMap["taskType"] = TaskTypeServiceUploadOCI + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UploadOCIDriverTaskProperties. +func (u *UploadOCIDriverTaskProperties) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &u.ClientData) + delete(rawMsg, key) + case "commands": + u.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &u.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &u.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &u.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &u.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &u.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateMigrationInputSQLServerSQLDbSyncTaskProperties. +func (v ValidateMigrationInputSQLServerSQLDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", v.ClientData) + populate(objectMap, "commands", v.Commands) + populate(objectMap, "errors", v.Errors) + populate(objectMap, "input", v.Input) + populate(objectMap, "output", v.Output) + populate(objectMap, "state", v.State) + objectMap["taskType"] = TaskTypeValidateMigrationInputSQLServerSQLDbSync + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateMigrationInputSQLServerSQLDbSyncTaskProperties. +func (v *ValidateMigrationInputSQLServerSQLDbSyncTaskProperties) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &v.ClientData) + delete(rawMsg, key) + case "commands": + v.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &v.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &v.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &v.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &v.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateMigrationInputSQLServerSQLMISyncTaskInput. +func (v ValidateMigrationInputSQLServerSQLMISyncTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureApp", v.AzureApp) + populate(objectMap, "backupFileShare", v.BackupFileShare) + populate(objectMap, "selectedDatabases", v.SelectedDatabases) + populate(objectMap, "sourceConnectionInfo", v.SourceConnectionInfo) + populate(objectMap, "storageResourceId", v.StorageResourceID) + populate(objectMap, "targetConnectionInfo", v.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateMigrationInputSQLServerSQLMISyncTaskInput. +func (v *ValidateMigrationInputSQLServerSQLMISyncTaskInput) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureApp": + err = unpopulate(val, "AzureApp", &v.AzureApp) + delete(rawMsg, key) + case "backupFileShare": + err = unpopulate(val, "BackupFileShare", &v.BackupFileShare) + delete(rawMsg, key) + case "selectedDatabases": + err = unpopulate(val, "SelectedDatabases", &v.SelectedDatabases) + delete(rawMsg, key) + case "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &v.SourceConnectionInfo) + delete(rawMsg, key) + case "storageResourceId": + err = unpopulate(val, "StorageResourceID", &v.StorageResourceID) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &v.TargetConnectionInfo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateMigrationInputSQLServerSQLMISyncTaskOutput. +func (v ValidateMigrationInputSQLServerSQLMISyncTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "validationErrors", v.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateMigrationInputSQLServerSQLMISyncTaskOutput. +func (v *ValidateMigrationInputSQLServerSQLMISyncTaskOutput) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &v.ValidationErrors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateMigrationInputSQLServerSQLMISyncTaskProperties. +func (v ValidateMigrationInputSQLServerSQLMISyncTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", v.ClientData) + populate(objectMap, "commands", v.Commands) + populate(objectMap, "errors", v.Errors) + populate(objectMap, "input", v.Input) + populate(objectMap, "output", v.Output) + populate(objectMap, "state", v.State) + objectMap["taskType"] = TaskTypeValidateMigrationInputSQLServerAzureSQLDbMISyncLRS + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateMigrationInputSQLServerSQLMISyncTaskProperties. +func (v *ValidateMigrationInputSQLServerSQLMISyncTaskProperties) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &v.ClientData) + delete(rawMsg, key) + case "commands": + v.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &v.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &v.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &v.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &v.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateMigrationInputSQLServerSQLMITaskInput. +func (v ValidateMigrationInputSQLServerSQLMITaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupBlobShare", v.BackupBlobShare) + populate(objectMap, "backupFileShare", v.BackupFileShare) + populate(objectMap, "backupMode", v.BackupMode) + populate(objectMap, "selectedDatabases", v.SelectedDatabases) + populate(objectMap, "selectedLogins", v.SelectedLogins) + populate(objectMap, "sourceConnectionInfo", v.SourceConnectionInfo) + populate(objectMap, "targetConnectionInfo", v.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateMigrationInputSQLServerSQLMITaskInput. +func (v *ValidateMigrationInputSQLServerSQLMITaskInput) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupBlobShare": + err = unpopulate(val, "BackupBlobShare", &v.BackupBlobShare) + delete(rawMsg, key) + case "backupFileShare": + err = unpopulate(val, "BackupFileShare", &v.BackupFileShare) + delete(rawMsg, key) + case "backupMode": + err = unpopulate(val, "BackupMode", &v.BackupMode) + delete(rawMsg, key) + case "selectedDatabases": + err = unpopulate(val, "SelectedDatabases", &v.SelectedDatabases) + delete(rawMsg, key) + case "selectedLogins": + err = unpopulate(val, "SelectedLogins", &v.SelectedLogins) + delete(rawMsg, key) + case "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &v.SourceConnectionInfo) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &v.TargetConnectionInfo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateMigrationInputSQLServerSQLMITaskOutput. +func (v ValidateMigrationInputSQLServerSQLMITaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupFolderErrors", v.BackupFolderErrors) + populate(objectMap, "backupShareCredentialsErrors", v.BackupShareCredentialsErrors) + populate(objectMap, "backupStorageAccountErrors", v.BackupStorageAccountErrors) + populate(objectMap, "databaseBackupInfo", v.DatabaseBackupInfo) + populate(objectMap, "existingBackupErrors", v.ExistingBackupErrors) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "restoreDatabaseNameErrors", v.RestoreDatabaseNameErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateMigrationInputSQLServerSQLMITaskOutput. +func (v *ValidateMigrationInputSQLServerSQLMITaskOutput) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupFolderErrors": + err = unpopulate(val, "BackupFolderErrors", &v.BackupFolderErrors) + delete(rawMsg, key) + case "backupShareCredentialsErrors": + err = unpopulate(val, "BackupShareCredentialsErrors", &v.BackupShareCredentialsErrors) + delete(rawMsg, key) + case "backupStorageAccountErrors": + err = unpopulate(val, "BackupStorageAccountErrors", &v.BackupStorageAccountErrors) + delete(rawMsg, key) + case "databaseBackupInfo": + err = unpopulate(val, "DatabaseBackupInfo", &v.DatabaseBackupInfo) + delete(rawMsg, key) + case "existingBackupErrors": + err = unpopulate(val, "ExistingBackupErrors", &v.ExistingBackupErrors) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "restoreDatabaseNameErrors": + err = unpopulate(val, "RestoreDatabaseNameErrors", &v.RestoreDatabaseNameErrors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateMigrationInputSQLServerSQLMITaskProperties. +func (v ValidateMigrationInputSQLServerSQLMITaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", v.ClientData) + populate(objectMap, "commands", v.Commands) + populate(objectMap, "errors", v.Errors) + populate(objectMap, "input", v.Input) + populate(objectMap, "output", v.Output) + populate(objectMap, "state", v.State) + objectMap["taskType"] = TaskTypeValidateMigrationInputSQLServerAzureSQLDbMI + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateMigrationInputSQLServerSQLMITaskProperties. +func (v *ValidateMigrationInputSQLServerSQLMITaskProperties) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &v.ClientData) + delete(rawMsg, key) + case "commands": + v.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &v.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &v.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &v.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &v.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateMongoDbTaskProperties. +func (v ValidateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", v.ClientData) + populate(objectMap, "commands", v.Commands) + populate(objectMap, "errors", v.Errors) + populate(objectMap, "input", v.Input) + populate(objectMap, "output", v.Output) + populate(objectMap, "state", v.State) + objectMap["taskType"] = TaskTypeValidateMongoDb + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateMongoDbTaskProperties. +func (v *ValidateMongoDbTaskProperties) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &v.ClientData) + delete(rawMsg, key) + case "commands": + v.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &v.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &v.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &v.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &v.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateOracleAzureDbForPostgreSQLSyncTaskProperties. +func (v ValidateOracleAzureDbForPostgreSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientData", v.ClientData) + populate(objectMap, "commands", v.Commands) + populate(objectMap, "errors", v.Errors) + populate(objectMap, "input", v.Input) + populate(objectMap, "output", v.Output) + populate(objectMap, "state", v.State) + objectMap["taskType"] = TaskTypeValidateOracleAzureDbPostgreSQLSync + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateOracleAzureDbForPostgreSQLSyncTaskProperties. +func (v *ValidateOracleAzureDbForPostgreSQLSyncTaskProperties) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientData": + err = unpopulate(val, "ClientData", &v.ClientData) + delete(rawMsg, key) + case "commands": + v.Commands, err = unmarshalCommandPropertiesClassificationArray(val) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &v.Errors) + delete(rawMsg, key) + case "input": + err = unpopulate(val, "Input", &v.Input) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &v.Output) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &v.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateOracleAzureDbPostgreSQLSyncTaskOutput. +func (v ValidateOracleAzureDbPostgreSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "validationErrors", v.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateOracleAzureDbPostgreSQLSyncTaskOutput. +func (v *ValidateOracleAzureDbPostgreSQLSyncTaskOutput) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &v.ValidationErrors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateSyncMigrationInputSQLServerTaskInput. +func (v ValidateSyncMigrationInputSQLServerTaskInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "selectedDatabases", v.SelectedDatabases) + populate(objectMap, "sourceConnectionInfo", v.SourceConnectionInfo) + populate(objectMap, "targetConnectionInfo", v.TargetConnectionInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateSyncMigrationInputSQLServerTaskInput. +func (v *ValidateSyncMigrationInputSQLServerTaskInput) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "selectedDatabases": + err = unpopulate(val, "SelectedDatabases", &v.SelectedDatabases) + delete(rawMsg, key) + case "sourceConnectionInfo": + err = unpopulate(val, "SourceConnectionInfo", &v.SourceConnectionInfo) + delete(rawMsg, key) + case "targetConnectionInfo": + err = unpopulate(val, "TargetConnectionInfo", &v.TargetConnectionInfo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateSyncMigrationInputSQLServerTaskOutput. +func (v ValidateSyncMigrationInputSQLServerTaskOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "validationErrors", v.ValidationErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateSyncMigrationInputSQLServerTaskOutput. +func (v *ValidateSyncMigrationInputSQLServerTaskOutput) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "validationErrors": + err = unpopulate(val, "ValidationErrors", &v.ValidationErrors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidationError. +func (v ValidationError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "severity", v.Severity) + populate(objectMap, "text", v.Text) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidationError. +func (v *ValidationError) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "severity": + err = unpopulate(val, "Severity", &v.Severity) + delete(rawMsg, key) + case "text": + err = unpopulate(val, "Text", &v.Text) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WaitStatistics. +func (w WaitStatistics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "waitCount", w.WaitCount) + populate(objectMap, "waitTimeMs", w.WaitTimeMs) + populate(objectMap, "waitType", w.WaitType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WaitStatistics. +func (w *WaitStatistics) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "waitCount": + err = unpopulate(val, "WaitCount", &w.WaitCount) + delete(rawMsg, key) + case "waitTimeMs": + err = unpopulate(val, "WaitTimeMs", &w.WaitTimeMs) + delete(rawMsg, key) + case "waitType": + err = unpopulate(val, "WaitType", &w.WaitType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +func populate(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v any) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_operations_client.go b/sdk/resourcemanager/datamigration/armdatamigration/operations_client.go similarity index 85% rename from sdk/resourcemanager/datamigration/armdatamigration/zz_generated_operations_client.go rename to sdk/resourcemanager/datamigration/armdatamigration/operations_client.go index 8f8b38970bfb..d0fd7d1a1646 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_operations_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/operations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 @@ -27,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -48,10 +49,10 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// NewListPager - Lists all available actions exposed by the Database Migration Service resource provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// NewListPager - Lists all of the available SQL Migration REST API operations. +// +// Generated from API version 2022-03-30-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]{ More: func(page OperationsClientListResponse) bool { @@ -88,7 +89,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -97,7 +98,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/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/datamigration/armdatamigration/polymorphic_helpers.go similarity index 87% rename from sdk/resourcemanager/datamigration/armdatamigration/zz_generated_polymorphic_helpers.go rename to sdk/resourcemanager/datamigration/armdatamigration/polymorphic_helpers.go index 4ee14908d038..dd04c24b1afd 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/polymorphic_helpers.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 @@ -14,21 +15,21 @@ func unmarshalCommandPropertiesClassification(rawMsg json.RawMessage) (CommandPr if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } 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{} @@ -59,7 +60,7 @@ func unmarshalConnectToSourceSQLServerTaskOutputClassification(rawMsg json.RawMe if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -102,7 +103,7 @@ func unmarshalConnectionInfoClassification(rawMsg json.RawMessage) (ConnectionIn if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -126,11 +127,33 @@ func unmarshalConnectionInfoClassification(rawMsg json.RawMessage) (ConnectionIn return b, json.Unmarshal(rawMsg, b) } +func unmarshalDatabaseMigrationPropertiesClassification(rawMsg json.RawMessage) (DatabaseMigrationPropertiesClassification, error) { + if rawMsg == nil { + 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{} + } + return b, json.Unmarshal(rawMsg, b) +} + func unmarshalMigrateMySQLAzureDbForMySQLOfflineTaskOutputClassification(rawMsg json.RawMessage) (MigrateMySQLAzureDbForMySQLOfflineTaskOutputClassification, error) { if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -173,7 +196,7 @@ func unmarshalMigrateMySQLAzureDbForMySQLSyncTaskOutputClassification(rawMsg jso if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -218,7 +241,7 @@ func unmarshalMigrateOracleAzureDbPostgreSQLSyncTaskOutputClassification(rawMsg if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -263,7 +286,7 @@ func unmarshalMigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputClassification( if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -308,7 +331,7 @@ func unmarshalMigrateSQLServerSQLDbSyncTaskOutputClassification(rawMsg json.RawM if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -353,7 +376,7 @@ func unmarshalMigrateSQLServerSQLDbTaskOutputClassification(rawMsg json.RawMessa if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -400,7 +423,7 @@ func unmarshalMigrateSQLServerSQLMISyncTaskOutputClassification(rawMsg json.RawM if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -441,7 +464,7 @@ func unmarshalMigrateSQLServerSQLMITaskOutputClassification(rawMsg json.RawMessa if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -486,7 +509,7 @@ func unmarshalMigrateSchemaSQLServerSQLDbTaskOutputClassification(rawMsg json.Ra if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -529,7 +552,7 @@ func unmarshalMigrateSsisTaskOutputClassification(rawMsg json.RawMessage) (Migra if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -568,7 +591,7 @@ func unmarshalMongoDbProgressClassification(rawMsg json.RawMessage) (MongoDbProg if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -609,87 +632,87 @@ func unmarshalProjectTaskPropertiesClassification(rawMsg json.RawMessage) (Proje if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } 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/zz_generated_projects_client.go b/sdk/resourcemanager/datamigration/armdatamigration/projects_client.go similarity index 88% rename from sdk/resourcemanager/datamigration/armdatamigration/zz_generated_projects_client.go rename to sdk/resourcemanager/datamigration/armdatamigration/projects_client.go index d2a0e76228a9..eb2f11146d7c 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_projects_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/projects_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 @@ -32,9 +33,9 @@ type ProjectsClient struct { } // NewProjectsClient creates a new instance of ProjectsClient with the specified values. -// subscriptionID - Identifier of the subscription -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default 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 NewProjectsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProjectsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +59,13 @@ func NewProjectsClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - The project resource is a nested resource representing a stored migration project. The PUT method creates // 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// parameters - Information about the project -// options - ProjectsClientCreateOrUpdateOptions contains the optional parameters for the ProjectsClient.CreateOrUpdate method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - parameters - Information about the project +// - options - ProjectsClientCreateOrUpdateOptions contains the optional parameters for the ProjectsClient.CreateOrUpdate method. func (client *ProjectsClient) CreateOrUpdate(ctx context.Context, groupName string, serviceName string, projectName string, parameters Project, options *ProjectsClientCreateOrUpdateOptions) (ProjectsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, groupName, serviceName, projectName, parameters, options) if err != nil { @@ -103,7 +105,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,11 +123,12 @@ func (client *ProjectsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - The project resource is a nested resource representing a stored migration project. The DELETE method deletes a // project. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// options - ProjectsClientDeleteOptions contains the optional parameters for the ProjectsClient.Delete method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - options - ProjectsClientDeleteOptions contains the optional parameters for the ProjectsClient.Delete method. func (client *ProjectsClient) Delete(ctx context.Context, groupName string, serviceName string, projectName string, options *ProjectsClientDeleteOptions) (ProjectsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, groupName, serviceName, projectName, options) if err != nil { @@ -165,7 +168,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", "2022-03-30-preview") if options != nil && options.DeleteRunningTasks != nil { reqQP.Set("deleteRunningTasks", strconv.FormatBool(*options.DeleteRunningTasks)) } @@ -177,11 +180,12 @@ func (client *ProjectsClient) deleteCreateRequest(ctx context.Context, groupName // Get - The project resource is a nested resource representing a stored migration project. The GET method retrieves information // about a project. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// options - ProjectsClientGetOptions contains the optional parameters for the ProjectsClient.Get method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - options - ProjectsClientGetOptions contains the optional parameters for the ProjectsClient.Get method. func (client *ProjectsClient) Get(ctx context.Context, groupName string, serviceName string, projectName string, options *ProjectsClientGetOptions) (ProjectsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, groupName, serviceName, projectName, options) if err != nil { @@ -221,7 +225,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,11 +242,11 @@ 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// options - ProjectsClientListOptions contains the optional parameters for the ProjectsClient.List method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - options - ProjectsClientListOptions contains the optional parameters for the ProjectsClient.NewListPager method. func (client *ProjectsClient) NewListPager(groupName string, serviceName string, options *ProjectsClientListOptions) *runtime.Pager[ProjectsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ProjectsClientListResponse]{ More: func(page ProjectsClientListResponse) bool { @@ -291,7 +295,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -309,12 +313,13 @@ func (client *ProjectsClient) listHandleResponse(resp *http.Response) (ProjectsC // Update - The project resource is a nested resource representing a stored migration project. The PATCH method updates an // existing project. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// parameters - Information about the project -// options - ProjectsClientUpdateOptions contains the optional parameters for the ProjectsClient.Update method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - parameters - Information about the project +// - options - ProjectsClientUpdateOptions contains the optional parameters for the ProjectsClient.Update method. func (client *ProjectsClient) Update(ctx context.Context, groupName string, serviceName string, projectName string, parameters Project, options *ProjectsClientUpdateOptions) (ProjectsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, groupName, serviceName, projectName, parameters, options) if err != nil { @@ -354,7 +359,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_resourceskus_client.go b/sdk/resourcemanager/datamigration/armdatamigration/resourceskus_client.go similarity index 89% rename from sdk/resourcemanager/datamigration/armdatamigration/zz_generated_resourceskus_client.go rename to sdk/resourcemanager/datamigration/armdatamigration/resourceskus_client.go index 86965798361f..c8ab9584d737 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_resourceskus_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/resourceskus_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 @@ -31,9 +32,9 @@ type ResourceSKUsClient struct { } // NewResourceSKUsClient creates a new instance of ResourceSKUsClient with the specified values. -// subscriptionID - Identifier of the subscription -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default 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 NewResourceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceSKUsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,9 +56,10 @@ func NewResourceSKUsClient(subscriptionID string, credential azcore.TokenCredent } // NewListSKUsPager - The skus action returns the list of SKUs that DMS supports. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// options - ResourceSKUsClientListSKUsOptions contains the optional parameters for the ResourceSKUsClient.ListSKUs method. +// +// Generated from API version 2022-03-30-preview +// - options - ResourceSKUsClientListSKUsOptions contains the optional parameters for the ResourceSKUsClient.NewListSKUsPager +// method. func (client *ResourceSKUsClient) NewListSKUsPager(options *ResourceSKUsClientListSKUsOptions) *runtime.Pager[ResourceSKUsClientListSKUsResponse] { return runtime.NewPager(runtime.PagingHandler[ResourceSKUsClientListSKUsResponse]{ More: func(page ResourceSKUsClientListSKUsResponse) bool { @@ -98,7 +100,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_response_types.go b/sdk/resourcemanager/datamigration/armdatamigration/response_types.go similarity index 54% rename from sdk/resourcemanager/datamigration/armdatamigration/zz_generated_response_types.go rename to sdk/resourcemanager/datamigration/armdatamigration/response_types.go index 44487a107ac0..4cda899824a6 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_response_types.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/response_types.go @@ -5,9 +5,70 @@ // Licensed under the MIT License. See License.txt in the project root for 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 +// 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 { + 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 { + 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 { + 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 { + 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 { + 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 { + DatabaseMigrationSQLVM +} + // FilesClientCreateOrUpdateResponse contains the response from method FilesClient.CreateOrUpdate. type FilesClientCreateOrUpdateResponse struct { ProjectFile @@ -23,7 +84,7 @@ type FilesClientGetResponse struct { ProjectFile } -// FilesClientListResponse contains the response from method FilesClient.List. +// FilesClientListResponse contains the response from method FilesClient.NewListPager. type FilesClientListResponse struct { FileList } @@ -43,9 +104,9 @@ type FilesClientUpdateResponse struct { ProjectFile } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { - ServiceOperationList + OperationListResult } // ProjectsClientCreateOrUpdateResponse contains the response from method ProjectsClient.CreateOrUpdate. @@ -63,7 +124,7 @@ type ProjectsClientGetResponse struct { Project } -// ProjectsClientListResponse contains the response from method ProjectsClient.List. +// ProjectsClientListResponse contains the response from method ProjectsClient.NewListPager. type ProjectsClientListResponse struct { ProjectList } @@ -73,11 +134,66 @@ type ProjectsClientUpdateResponse struct { Project } -// ResourceSKUsClientListSKUsResponse contains the response from method ResourceSKUsClient.ListSKUs. +// ResourceSKUsClientListSKUsResponse contains the response from method ResourceSKUsClient.NewListSKUsPager. type ResourceSKUsClientListSKUsResponse struct { ResourceSKUsResult } +// SQLMigrationServicesClientCreateOrUpdateResponse contains the response from method SQLMigrationServicesClient.BeginCreateOrUpdate. +type SQLMigrationServicesClientCreateOrUpdateResponse struct { + SQLMigrationService +} + +// SQLMigrationServicesClientDeleteNodeResponse contains the response from method SQLMigrationServicesClient.DeleteNode. +type SQLMigrationServicesClientDeleteNodeResponse struct { + 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 { + SQLMigrationService +} + +// SQLMigrationServicesClientListAuthKeysResponse contains the response from method SQLMigrationServicesClient.ListAuthKeys. +type SQLMigrationServicesClientListAuthKeysResponse struct { + AuthenticationKeys +} + +// SQLMigrationServicesClientListByResourceGroupResponse contains the response from method SQLMigrationServicesClient.NewListByResourceGroupPager. +type SQLMigrationServicesClientListByResourceGroupResponse struct { + SQLMigrationListResult +} + +// SQLMigrationServicesClientListBySubscriptionResponse contains the response from method SQLMigrationServicesClient.NewListBySubscriptionPager. +type SQLMigrationServicesClientListBySubscriptionResponse struct { + SQLMigrationListResult +} + +// SQLMigrationServicesClientListMigrationsResponse contains the response from method SQLMigrationServicesClient.NewListMigrationsPager. +type SQLMigrationServicesClientListMigrationsResponse struct { + DatabaseMigrationListResult +} + +// SQLMigrationServicesClientListMonitoringDataResponse contains the response from method SQLMigrationServicesClient.ListMonitoringData. +type SQLMigrationServicesClientListMonitoringDataResponse struct { + IntegrationRuntimeMonitoringData +} + +// SQLMigrationServicesClientRegenerateAuthKeysResponse contains the response from method SQLMigrationServicesClient.RegenerateAuthKeys. +type SQLMigrationServicesClientRegenerateAuthKeysResponse struct { + RegenAuthKeys +} + +// SQLMigrationServicesClientUpdateResponse contains the response from method SQLMigrationServicesClient.BeginUpdate. +type SQLMigrationServicesClientUpdateResponse struct { + SQLMigrationService +} + // ServiceTasksClientCancelResponse contains the response from method ServiceTasksClient.Cancel. type ServiceTasksClientCancelResponse struct { ProjectTask @@ -98,7 +214,7 @@ type ServiceTasksClientGetResponse struct { ProjectTask } -// ServiceTasksClientListResponse contains the response from method ServiceTasksClient.List. +// ServiceTasksClientListResponse contains the response from method ServiceTasksClient.NewListPager. type ServiceTasksClientListResponse struct { TaskList } @@ -123,12 +239,12 @@ type ServicesClientCheckStatusResponse struct { ServiceStatusResponse } -// ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.CreateOrUpdate. +// ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.BeginCreateOrUpdate. type ServicesClientCreateOrUpdateResponse struct { Service } -// ServicesClientDeleteResponse contains the response from method ServicesClient.Delete. +// ServicesClientDeleteResponse contains the response from method ServicesClient.BeginDelete. type ServicesClientDeleteResponse struct { // placeholder for future response values } @@ -138,32 +254,32 @@ type ServicesClientGetResponse struct { Service } -// ServicesClientListByResourceGroupResponse contains the response from method ServicesClient.ListByResourceGroup. +// ServicesClientListByResourceGroupResponse contains the response from method ServicesClient.NewListByResourceGroupPager. type ServicesClientListByResourceGroupResponse struct { ServiceList } -// ServicesClientListResponse contains the response from method ServicesClient.List. +// ServicesClientListResponse contains the response from method ServicesClient.NewListPager. type ServicesClientListResponse struct { ServiceList } -// ServicesClientListSKUsResponse contains the response from method ServicesClient.ListSKUs. +// ServicesClientListSKUsResponse contains the response from method ServicesClient.NewListSKUsPager. type ServicesClientListSKUsResponse struct { ServiceSKUList } -// ServicesClientStartResponse contains the response from method ServicesClient.Start. +// ServicesClientStartResponse contains the response from method ServicesClient.BeginStart. type ServicesClientStartResponse struct { // placeholder for future response values } -// ServicesClientStopResponse contains the response from method ServicesClient.Stop. +// ServicesClientStopResponse contains the response from method ServicesClient.BeginStop. type ServicesClientStopResponse struct { // placeholder for future response values } -// ServicesClientUpdateResponse contains the response from method ServicesClient.Update. +// ServicesClientUpdateResponse contains the response from method ServicesClient.BeginUpdate. type ServicesClientUpdateResponse struct { Service } @@ -203,7 +319,7 @@ type TasksClientGetResponse struct { ProjectTask } -// TasksClientListResponse contains the response from method TasksClient.List. +// TasksClientListResponse contains the response from method TasksClient.NewListPager. type TasksClientListResponse struct { TaskList } @@ -213,7 +329,7 @@ type TasksClientUpdateResponse struct { ProjectTask } -// UsagesClientListResponse contains the response from method UsagesClient.List. +// UsagesClientListResponse contains the response from method UsagesClient.NewListPager. type UsagesClientListResponse struct { QuotaList } diff --git a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_services_client.go b/sdk/resourcemanager/datamigration/armdatamigration/services_client.go similarity index 89% rename from sdk/resourcemanager/datamigration/armdatamigration/zz_generated_services_client.go rename to sdk/resourcemanager/datamigration/armdatamigration/services_client.go index df6109bf1bf1..6206138391e6 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_services_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/services_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 @@ -32,9 +33,9 @@ type ServicesClient struct { } // NewServicesClient creates a new instance of ServicesClient with the specified values. -// subscriptionID - Identifier of the subscription -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default 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 NewServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServicesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +58,13 @@ 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// parameters - Requested name to validate -// options - ServicesClientCheckChildrenNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckChildrenNameAvailability -// method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - parameters - Requested name to validate +// - options - ServicesClientCheckChildrenNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckChildrenNameAvailability +// method. func (client *ServicesClient) CheckChildrenNameAvailability(ctx context.Context, groupName string, serviceName string, parameters NameAvailabilityRequest, options *ServicesClientCheckChildrenNameAvailabilityOptions) (ServicesClientCheckChildrenNameAvailabilityResponse, error) { req, err := client.checkChildrenNameAvailabilityCreateRequest(ctx, groupName, serviceName, parameters, options) if err != nil { @@ -98,7 +100,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -115,11 +117,12 @@ 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 -// location - The Azure region of the operation -// parameters - Requested name to validate -// options - ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability -// method. +// +// Generated from API version 2022-03-30-preview +// - location - The Azure region of the operation +// - parameters - Requested name to validate +// - options - ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability +// method. func (client *ServicesClient) CheckNameAvailability(ctx context.Context, location string, parameters NameAvailabilityRequest, options *ServicesClientCheckNameAvailabilityOptions) (ServicesClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, location, parameters, options) if err != nil { @@ -151,7 +154,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -169,10 +172,11 @@ func (client *ServicesClient) checkNameAvailabilityHandleResponse(resp *http.Res // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// options - ServicesClientCheckStatusOptions contains the optional parameters for the ServicesClient.CheckStatus method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - options - ServicesClientCheckStatusOptions contains the optional parameters for the ServicesClient.CheckStatus method. func (client *ServicesClient) CheckStatus(ctx context.Context, groupName string, serviceName string, options *ServicesClientCheckStatusOptions) (ServicesClientCheckStatusResponse, error) { req, err := client.checkStatusCreateRequest(ctx, groupName, serviceName, options) if err != nil { @@ -208,7 +212,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -231,12 +235,13 @@ func (client *ServicesClient) checkStatusHandleResponse(resp *http.Response) (Se // 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// parameters - Information about the service -// options - ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - parameters - Information about the service +// - options - ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate +// method. func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, groupName string, serviceName string, parameters Service, options *ServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServicesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, groupName, serviceName, parameters, options) @@ -257,7 +262,8 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, groupName // 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 2022-03-30-preview func (client *ServicesClient) createOrUpdate(ctx context.Context, groupName string, serviceName string, parameters Service, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, groupName, serviceName, parameters, options) if err != nil { @@ -293,7 +299,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -302,10 +308,11 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, g // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// options - ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - options - ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. func (client *ServicesClient) BeginDelete(ctx context.Context, groupName string, serviceName string, options *ServicesClientBeginDeleteOptions) (*runtime.Poller[ServicesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, groupName, serviceName, options) @@ -321,7 +328,8 @@ 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 +// +// Generated from API version 2022-03-30-preview func (client *ServicesClient) deleteOperation(ctx context.Context, groupName string, serviceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, groupName, serviceName, options) if err != nil { @@ -357,7 +365,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", "2022-03-30-preview") if options != nil && options.DeleteRunningTasks != nil { reqQP.Set("deleteRunningTasks", strconv.FormatBool(*options.DeleteRunningTasks)) } @@ -369,10 +377,11 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, groupName // Get - The services resource is the top-level resource that represents the Database Migration Service. 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. func (client *ServicesClient) Get(ctx context.Context, groupName string, serviceName string, options *ServicesClientGetOptions) (ServicesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, groupName, serviceName, options) if err != nil { @@ -408,7 +417,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -425,9 +434,9 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// options - ServicesClientListOptions contains the optional parameters for the ServicesClient.List method. +// +// Generated from API version 2022-03-30-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]{ More: func(page ServicesClientListResponse) bool { @@ -468,7 +477,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -485,11 +494,11 @@ func (client *ServicesClient) listHandleResponse(resp *http.Response) (ServicesC // 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// options - ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - options - ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager +// method. func (client *ServicesClient) NewListByResourceGroupPager(groupName string, options *ServicesClientListByResourceGroupOptions) *runtime.Pager[ServicesClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[ServicesClientListByResourceGroupResponse]{ More: func(page ServicesClientListByResourceGroupResponse) bool { @@ -534,7 +543,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -551,11 +560,11 @@ func (client *ServicesClient) listByResourceGroupHandleResponse(resp *http.Respo // 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// options - ServicesClientListSKUsOptions contains the optional parameters for the ServicesClient.ListSKUs method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - options - ServicesClientListSKUsOptions contains the optional parameters for the ServicesClient.NewListSKUsPager method. func (client *ServicesClient) NewListSKUsPager(groupName string, serviceName string, options *ServicesClientListSKUsOptions) *runtime.Pager[ServicesClientListSKUsResponse] { return runtime.NewPager(runtime.PagingHandler[ServicesClientListSKUsResponse]{ More: func(page ServicesClientListSKUsResponse) bool { @@ -604,7 +613,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -622,10 +631,11 @@ func (client *ServicesClient) listSKUsHandleResponse(resp *http.Response) (Servi // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// options - ServicesClientBeginStartOptions contains the optional parameters for the ServicesClient.BeginStart method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - options - ServicesClientBeginStartOptions contains the optional parameters for the ServicesClient.BeginStart method. func (client *ServicesClient) BeginStart(ctx context.Context, groupName string, serviceName string, options *ServicesClientBeginStartOptions) (*runtime.Poller[ServicesClientStartResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.start(ctx, groupName, serviceName, options) @@ -641,7 +651,8 @@ 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 +// +// Generated from API version 2022-03-30-preview func (client *ServicesClient) start(ctx context.Context, groupName string, serviceName string, options *ServicesClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, groupName, serviceName, options) if err != nil { @@ -677,7 +688,7 @@ 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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -687,10 +698,11 @@ func (client *ServicesClient) startCreateRequest(ctx context.Context, groupName // 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// options - ServicesClientBeginStopOptions contains the optional parameters for the ServicesClient.BeginStop method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - options - ServicesClientBeginStopOptions contains the optional parameters for the ServicesClient.BeginStop method. func (client *ServicesClient) BeginStop(ctx context.Context, groupName string, serviceName string, options *ServicesClientBeginStopOptions) (*runtime.Poller[ServicesClientStopResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.stop(ctx, groupName, serviceName, options) @@ -707,7 +719,8 @@ func (client *ServicesClient) BeginStop(ctx context.Context, groupName string, s // 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 2022-03-30-preview func (client *ServicesClient) stop(ctx context.Context, groupName string, serviceName string, options *ServicesClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, groupName, serviceName, options) if err != nil { @@ -743,7 +756,7 @@ 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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -753,11 +766,12 @@ func (client *ServicesClient) stopCreateRequest(ctx context.Context, groupName s // 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// parameters - Information about the service -// options - ServicesClientBeginUpdateOptions contains the optional parameters for the ServicesClient.BeginUpdate method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - parameters - Information about the service +// - options - ServicesClientBeginUpdateOptions contains the optional parameters for the ServicesClient.BeginUpdate method. func (client *ServicesClient) BeginUpdate(ctx context.Context, groupName string, serviceName string, parameters Service, options *ServicesClientBeginUpdateOptions) (*runtime.Poller[ServicesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, groupName, serviceName, parameters, options) @@ -774,7 +788,8 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, groupName string, // 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 2022-03-30-preview func (client *ServicesClient) update(ctx context.Context, groupName string, serviceName string, parameters Service, options *ServicesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, groupName, serviceName, parameters, options) if err != nil { @@ -810,7 +825,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_servicetasks_client.go b/sdk/resourcemanager/datamigration/armdatamigration/servicetasks_client.go similarity index 88% rename from sdk/resourcemanager/datamigration/armdatamigration/zz_generated_servicetasks_client.go rename to sdk/resourcemanager/datamigration/armdatamigration/servicetasks_client.go index 706fa8ad18e0..0fc156b8bb8a 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_servicetasks_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/servicetasks_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 @@ -32,9 +33,9 @@ type ServiceTasksClient struct { } // NewServiceTasksClient creates a new instance of ServiceTasksClient with the specified values. -// subscriptionID - Identifier of the subscription -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default 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 NewServiceTasksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceTasksClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,11 +59,12 @@ func NewServiceTasksClient(subscriptionID string, credential azcore.TokenCredent // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// taskName - Name of the Task -// options - ServiceTasksClientCancelOptions contains the optional parameters for the ServiceTasksClient.Cancel method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - taskName - Name of the Task +// - options - ServiceTasksClientCancelOptions contains the optional parameters for the ServiceTasksClient.Cancel method. func (client *ServiceTasksClient) Cancel(ctx context.Context, groupName string, serviceName string, taskName string, options *ServiceTasksClientCancelOptions) (ServiceTasksClientCancelResponse, error) { req, err := client.cancelCreateRequest(ctx, groupName, serviceName, taskName, options) if err != nil { @@ -102,7 +104,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -121,13 +123,14 @@ func (client *ServiceTasksClient) cancelHandleResponse(resp *http.Response) (Ser // 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// taskName - Name of the Task -// parameters - Information about the task -// options - ServiceTasksClientCreateOrUpdateOptions contains the optional parameters for the ServiceTasksClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - taskName - Name of the Task +// - parameters - Information about the task +// - options - ServiceTasksClientCreateOrUpdateOptions contains the optional parameters for the ServiceTasksClient.CreateOrUpdate +// method. func (client *ServiceTasksClient) CreateOrUpdate(ctx context.Context, groupName string, serviceName string, taskName string, parameters ProjectTask, options *ServiceTasksClientCreateOrUpdateOptions) (ServiceTasksClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, groupName, serviceName, taskName, parameters, options) if err != nil { @@ -167,7 +170,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -185,11 +188,12 @@ func (client *ServiceTasksClient) createOrUpdateHandleResponse(resp *http.Respon // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// taskName - Name of the Task -// options - ServiceTasksClientDeleteOptions contains the optional parameters for the ServiceTasksClient.Delete method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - taskName - Name of the Task +// - options - ServiceTasksClientDeleteOptions contains the optional parameters for the ServiceTasksClient.Delete method. func (client *ServiceTasksClient) Delete(ctx context.Context, groupName string, serviceName string, taskName string, options *ServiceTasksClientDeleteOptions) (ServiceTasksClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, groupName, serviceName, taskName, options) if err != nil { @@ -229,7 +233,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", "2022-03-30-preview") if options != nil && options.DeleteRunningTasks != nil { reqQP.Set("deleteRunningTasks", strconv.FormatBool(*options.DeleteRunningTasks)) } @@ -241,11 +245,12 @@ func (client *ServiceTasksClient) deleteCreateRequest(ctx context.Context, group // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// taskName - Name of the Task -// options - ServiceTasksClientGetOptions contains the optional parameters for the ServiceTasksClient.Get method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - taskName - Name of the Task +// - options - ServiceTasksClientGetOptions contains the optional parameters for the ServiceTasksClient.Get method. func (client *ServiceTasksClient) Get(ctx context.Context, groupName string, serviceName string, taskName string, options *ServiceTasksClientGetOptions) (ServiceTasksClientGetResponse, error) { req, err := client.getCreateRequest(ctx, groupName, serviceName, taskName, options) if err != nil { @@ -285,7 +290,7 @@ func (client *ServiceTasksClient) getCreateRequest(ctx context.Context, groupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-30") + reqQP.Set("api-version", "2022-03-30-preview") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -306,11 +311,11 @@ func (client *ServiceTasksClient) getHandleResponse(resp *http.Response) (Servic // 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// options - ServiceTasksClientListOptions contains the optional parameters for the ServiceTasksClient.List method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - options - ServiceTasksClientListOptions contains the optional parameters for the ServiceTasksClient.NewListPager method. func (client *ServiceTasksClient) NewListPager(groupName string, serviceName string, options *ServiceTasksClientListOptions) *runtime.Pager[ServiceTasksClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServiceTasksClientListResponse]{ More: func(page ServiceTasksClientListResponse) bool { @@ -359,7 +364,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", "2022-03-30-preview") if options != nil && options.TaskType != nil { reqQP.Set("taskType", *options.TaskType) } @@ -381,12 +386,13 @@ func (client *ServiceTasksClient) listHandleResponse(resp *http.Response) (Servi // 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// taskName - Name of the Task -// parameters - Information about the task -// options - ServiceTasksClientUpdateOptions contains the optional parameters for the ServiceTasksClient.Update method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - taskName - Name of the Task +// - parameters - Information about the task +// - options - ServiceTasksClientUpdateOptions contains the optional parameters for the ServiceTasksClient.Update method. func (client *ServiceTasksClient) Update(ctx context.Context, groupName string, serviceName string, taskName string, parameters ProjectTask, options *ServiceTasksClientUpdateOptions) (ServiceTasksClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, groupName, serviceName, taskName, parameters, options) if err != nil { @@ -426,7 +432,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/datamigration/armdatamigration/sqlmigrationservices_client.go b/sdk/resourcemanager/datamigration/armdatamigration/sqlmigrationservices_client.go new file mode 100644 index 000000000000..e4efa8f8ab4a --- /dev/null +++ b/sdk/resourcemanager/datamigration/armdatamigration/sqlmigrationservices_client.go @@ -0,0 +1,750 @@ +//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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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 { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &SQLMigrationServicesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or Update Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-30-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 + } + return runtime.NewPoller[SQLMigrationServicesClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[SQLMigrationServicesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create or Update Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-30-preview +func (client *SQLMigrationServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters SQLMigrationService, options *SQLMigrationServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Delete Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-30-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 + } + return runtime.NewPoller[SQLMigrationServicesClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[SQLMigrationServicesClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-30-preview +func (client *SQLMigrationServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, options *SQLMigrationServicesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-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 2022-03-30-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) { + req, err := client.deleteNodeCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, parameters, options) + if err != nil { + return SQLMigrationServicesClientDeleteNodeResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SQLMigrationServicesClientDeleteNodeResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SQLMigrationServicesClientDeleteNodeResponse{}, runtime.NewResponseError(resp) + } + return client.deleteNodeHandleResponse(resp) +} + +// 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// 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 2022-03-30-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) { + req, err := client.getCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, options) + if err != nil { + return SQLMigrationServicesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SQLMigrationServicesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SQLMigrationServicesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-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 2022-03-30-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) { + req, err := client.listAuthKeysCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, options) + if err != nil { + return SQLMigrationServicesClientListAuthKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SQLMigrationServicesClientListAuthKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SQLMigrationServicesClientListAuthKeysResponse{}, runtime.NewResponseError(resp) + } + return client.listAuthKeysHandleResponse(resp) +} + +// 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-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 2022-03-30-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) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SQLMigrationServicesClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SQLMigrationServicesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SQLMigrationServicesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-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 2022-03-30-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) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SQLMigrationServicesClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SQLMigrationServicesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SQLMigrationServicesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-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 2022-03-30-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) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listMigrationsCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SQLMigrationServicesClientListMigrationsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SQLMigrationServicesClientListMigrationsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SQLMigrationServicesClientListMigrationsResponse{}, runtime.NewResponseError(resp) + } + return client.listMigrationsHandleResponse(resp) + }, + }) +} + +// 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-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 2022-03-30-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) { + req, err := client.listMonitoringDataCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, options) + if err != nil { + return SQLMigrationServicesClientListMonitoringDataResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SQLMigrationServicesClientListMonitoringDataResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SQLMigrationServicesClientListMonitoringDataResponse{}, runtime.NewResponseError(resp) + } + return client.listMonitoringDataHandleResponse(resp) +} + +// 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-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 2022-03-30-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) { + req, err := client.regenerateAuthKeysCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, parameters, options) + if err != nil { + return SQLMigrationServicesClientRegenerateAuthKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SQLMigrationServicesClientRegenerateAuthKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SQLMigrationServicesClientRegenerateAuthKeysResponse{}, runtime.NewResponseError(resp) + } + return client.regenerateAuthKeysHandleResponse(resp) +} + +// 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// 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 2022-03-30-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 + } + return runtime.NewPoller[SQLMigrationServicesClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[SQLMigrationServicesClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update Database Migration Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-30-preview +func (client *SQLMigrationServicesClient) update(ctx context.Context, resourceGroupName string, sqlMigrationServiceName string, parameters SQLMigrationServiceUpdate, options *SQLMigrationServicesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, sqlMigrationServiceName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-30-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_tasks_client.go b/sdk/resourcemanager/datamigration/armdatamigration/tasks_client.go similarity index 88% rename from sdk/resourcemanager/datamigration/armdatamigration/zz_generated_tasks_client.go rename to sdk/resourcemanager/datamigration/armdatamigration/tasks_client.go index 01b1a44ff3d2..bb899cece313 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_tasks_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/tasks_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 @@ -32,9 +33,9 @@ type TasksClient struct { } // NewTasksClient creates a new instance of TasksClient with the specified values. -// subscriptionID - Identifier of the subscription -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default 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 NewTasksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TasksClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +59,13 @@ func NewTasksClient(subscriptionID string, credential azcore.TokenCredential, op // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// taskName - Name of the Task -// options - TasksClientCancelOptions contains the optional parameters for the TasksClient.Cancel method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - taskName - Name of the Task +// - options - TasksClientCancelOptions contains the optional parameters for the TasksClient.Cancel method. func (client *TasksClient) Cancel(ctx context.Context, groupName string, serviceName string, projectName string, taskName string, options *TasksClientCancelOptions) (TasksClientCancelResponse, error) { req, err := client.cancelCreateRequest(ctx, groupName, serviceName, projectName, taskName, options) if err != nil { @@ -107,7 +109,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -125,13 +127,14 @@ func (client *TasksClient) cancelHandleResponse(resp *http.Response) (TasksClien // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// taskName - Name of the Task -// parameters - Command to execute -// options - TasksClientCommandOptions contains the optional parameters for the TasksClient.Command method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - taskName - Name of the Task +// - parameters - Command to execute +// - options - TasksClientCommandOptions contains the optional parameters for the TasksClient.Command method. func (client *TasksClient) Command(ctx context.Context, groupName string, serviceName string, projectName string, taskName string, parameters CommandPropertiesClassification, options *TasksClientCommandOptions) (TasksClientCommandResponse, error) { req, err := client.commandCreateRequest(ctx, groupName, serviceName, projectName, taskName, parameters, options) if err != nil { @@ -175,7 +178,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -194,13 +197,14 @@ func (client *TasksClient) commandHandleResponse(resp *http.Response) (TasksClie // 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// taskName - Name of the Task -// parameters - Information about the task -// options - TasksClientCreateOrUpdateOptions contains the optional parameters for the TasksClient.CreateOrUpdate method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - taskName - Name of the Task +// - parameters - Information about the task +// - options - TasksClientCreateOrUpdateOptions contains the optional parameters for the TasksClient.CreateOrUpdate method. func (client *TasksClient) CreateOrUpdate(ctx context.Context, groupName string, serviceName string, projectName string, taskName string, parameters ProjectTask, options *TasksClientCreateOrUpdateOptions) (TasksClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, groupName, serviceName, projectName, taskName, parameters, options) if err != nil { @@ -244,7 +248,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -262,12 +266,13 @@ func (client *TasksClient) createOrUpdateHandleResponse(resp *http.Response) (Ta // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// taskName - Name of the Task -// options - TasksClientDeleteOptions contains the optional parameters for the TasksClient.Delete method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - taskName - Name of the Task +// - options - TasksClientDeleteOptions contains the optional parameters for the TasksClient.Delete method. func (client *TasksClient) Delete(ctx context.Context, groupName string, serviceName string, projectName string, taskName string, options *TasksClientDeleteOptions) (TasksClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, groupName, serviceName, projectName, taskName, options) if err != nil { @@ -311,7 +316,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", "2022-03-30-preview") if options != nil && options.DeleteRunningTasks != nil { reqQP.Set("deleteRunningTasks", strconv.FormatBool(*options.DeleteRunningTasks)) } @@ -323,12 +328,13 @@ func (client *TasksClient) deleteCreateRequest(ctx context.Context, groupName st // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// taskName - Name of the Task -// options - TasksClientGetOptions contains the optional parameters for the TasksClient.Get method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - taskName - Name of the Task +// - options - TasksClientGetOptions contains the optional parameters for the TasksClient.Get method. func (client *TasksClient) Get(ctx context.Context, groupName string, serviceName string, projectName string, taskName string, options *TasksClientGetOptions) (TasksClientGetResponse, error) { req, err := client.getCreateRequest(ctx, groupName, serviceName, projectName, taskName, options) if err != nil { @@ -372,7 +378,7 @@ func (client *TasksClient) 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", "2022-03-30-preview") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -393,12 +399,12 @@ func (client *TasksClient) getHandleResponse(resp *http.Response) (TasksClientGe // 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// options - TasksClientListOptions contains the optional parameters for the TasksClient.List method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - options - TasksClientListOptions contains the optional parameters for the TasksClient.NewListPager method. func (client *TasksClient) NewListPager(groupName string, serviceName string, projectName string, options *TasksClientListOptions) *runtime.Pager[TasksClientListResponse] { return runtime.NewPager(runtime.PagingHandler[TasksClientListResponse]{ More: func(page TasksClientListResponse) bool { @@ -451,7 +457,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", "2022-03-30-preview") if options != nil && options.TaskType != nil { reqQP.Set("taskType", *options.TaskType) } @@ -473,13 +479,14 @@ func (client *TasksClient) listHandleResponse(resp *http.Response) (TasksClientL // 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 -// groupName - Name of the resource group -// serviceName - Name of the service -// projectName - Name of the project -// taskName - Name of the Task -// parameters - Information about the task -// options - TasksClientUpdateOptions contains the optional parameters for the TasksClient.Update method. +// +// Generated from API version 2022-03-30-preview +// - groupName - Name of the resource group +// - serviceName - Name of the service +// - projectName - Name of the project +// - taskName - Name of the Task +// - parameters - Information about the task +// - options - TasksClientUpdateOptions contains the optional parameters for the TasksClient.Update method. func (client *TasksClient) Update(ctx context.Context, groupName string, serviceName string, projectName string, taskName string, parameters ProjectTask, options *TasksClientUpdateOptions) (TasksClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, groupName, serviceName, projectName, taskName, parameters, options) if err != nil { @@ -523,7 +530,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_time_rfc3339.go b/sdk/resourcemanager/datamigration/armdatamigration/time_rfc3339.go similarity index 96% rename from sdk/resourcemanager/datamigration/armdatamigration/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/datamigration/armdatamigration/time_rfc3339.go index d456938e753f..9cbecac40c1b 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/time_rfc3339.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 @@ -61,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_usages_client.go b/sdk/resourcemanager/datamigration/armdatamigration/usages_client.go similarity index 89% rename from sdk/resourcemanager/datamigration/armdatamigration/zz_generated_usages_client.go rename to sdk/resourcemanager/datamigration/armdatamigration/usages_client.go index 602ae294b29c..ab32b264729b 100644 --- a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_usages_client.go +++ b/sdk/resourcemanager/datamigration/armdatamigration/usages_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 @@ -31,9 +32,9 @@ type UsagesClient struct { } // NewUsagesClient creates a new instance of UsagesClient with the specified values. -// subscriptionID - Identifier of the subscription -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default 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 NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsagesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,10 +56,10 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o } // NewListPager - This method returns region-specific quotas and resource usage information for the Database Migration Service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-30 -// location - The Azure region of the operation -// options - UsagesClientListOptions contains the optional parameters for the UsagesClient.List method. +// +// Generated from API version 2022-03-30-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] { return runtime.NewPager(runtime.PagingHandler[UsagesClientListResponse]{ More: func(page UsagesClientListResponse) bool { @@ -103,7 +104,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", "2022-03-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_files_client_test.go b/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_files_client_test.go deleted file mode 100644 index cdfcd594e4eb..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_files_client_test.go +++ /dev/null @@ -1,197 +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. - -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/tree/main/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() - client, err := armdatamigration.NewFilesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("DmsSdkRg", - "DmsSdkService", - "DmsSdkProject", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewFilesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "DmsSdkRg", - "DmsSdkService", - "DmsSdkProject", - "x114d023d8", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewFilesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewFilesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armdatamigration.NewFilesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewFilesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Read(ctx, - "DmsSdkRg", - "DmsSdkService", - "DmsSdkProject", - "x114d023d8", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewFilesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ReadWrite(ctx, - "DmsSdkRg", - "DmsSdkService", - "DmsSdkProject", - "x114d023d8", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_operations_client_test.go deleted file mode 100644 index 2a637d109023..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +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. - -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/tree/main/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() - client, err := armdatamigration.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_projects_client_test.go b/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_projects_client_test.go deleted file mode 100644 index d024cc01204d..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_projects_client_test.go +++ /dev/null @@ -1,148 +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. - -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/tree/main/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() - client, err := armdatamigration.NewProjectsClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("DmsSdkRg", - "DmsSdkService", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewProjectsClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewProjectsClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "DmsSdkRg", - "DmsSdkService", - "DmsSdkProject", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewProjectsClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armdatamigration.NewProjectsClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_resourceskus_client_test.go b/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_resourceskus_client_test.go deleted file mode 100644 index f670d5b75ec9..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_resourceskus_client_test.go +++ /dev/null @@ -1,9 +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. - -package armdatamigration_test diff --git a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_services_client_test.go b/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_services_client_test.go deleted file mode 100644 index 01682724a361..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_services_client_test.go +++ /dev/null @@ -1,295 +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. - -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/tree/main/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() - client, err := armdatamigration.NewServicesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewServicesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "DmsSdkRg", - "DmsSdkService", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewServicesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/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() - client, err := armdatamigration.NewServicesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewServicesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckStatus(ctx, - "DmsSdkRg", - "DmsSdkService", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewServicesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/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() - client, err := armdatamigration.NewServicesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/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() - client, err := armdatamigration.NewServicesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckChildrenNameAvailability(ctx, - "DmsSdkRg", - "DmsSdkService", - armdatamigration.NameAvailabilityRequest{}, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewServicesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("DmsSdkRg", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewServicesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewServicesClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - "eastus", - armdatamigration.NameAvailabilityRequest{}, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_servicetasks_client_test.go b/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_servicetasks_client_test.go deleted file mode 100644 index f248414007ff..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_servicetasks_client_test.go +++ /dev/null @@ -1,173 +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. - -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/tree/main/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() - client, err := armdatamigration.NewServiceTasksClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("DmsSdkRg", - "DmsSdkService", - &armdatamigration.ServiceTasksClientListOptions{TaskType: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewServiceTasksClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewServiceTasksClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "DmsSdkRg", - "DmsSdkService", - "DmsSdkTask", - &armdatamigration.ServiceTasksClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewServiceTasksClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armdatamigration.NewServiceTasksClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewServiceTasksClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Cancel(ctx, - "DmsSdkRg", - "DmsSdkService", - "DmsSdkTask", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_tasks_client_test.go b/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_tasks_client_test.go deleted file mode 100644 index eab32670a3fc..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_tasks_client_test.go +++ /dev/null @@ -1,225 +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. - -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/tree/main/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() - client, err := armdatamigration.NewTasksClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("DmsSdkRg", - "DmsSdkService", - "DmsSdkProject", - &armdatamigration.TasksClientListOptions{TaskType: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewTasksClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewTasksClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "DmsSdkRg", - "DmsSdkService", - "DmsSdkProject", - "DmsSdkTask", - &armdatamigration.TasksClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewTasksClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armdatamigration.NewTasksClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewTasksClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Cancel(ctx, - "DmsSdkRg", - "DmsSdkService", - "DmsSdkProject", - "DmsSdkTask", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armdatamigration.NewTasksClient("fc04246f-04c5-437e-ac5e-206a19e7193f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_usages_client_test.go b/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_usages_client_test.go deleted file mode 100644 index 8ced482d0de9..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/ze_generated_example_usages_client_test.go +++ /dev/null @@ -1,42 +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. - -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/tree/main/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() - client, err := armdatamigration.NewUsagesClient("90fb80a6-0f71-4761-8f03-921e7396f3c0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("westus", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_models_serde.go b/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_models_serde.go deleted file mode 100644 index 92d06691a8c0..000000000000 --- a/sdk/resourcemanager/datamigration/armdatamigration/zz_generated_models_serde.go +++ /dev/null @@ -1,7084 +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. - -package armdatamigration - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type BackupSetInfo. -func (b BackupSetInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "backupFinishedDate", b.BackupFinishedDate) - populate(objectMap, "backupSetId", b.BackupSetID) - populateTimeRFC3339(objectMap, "backupStartDate", b.BackupStartDate) - populate(objectMap, "backupType", b.BackupType) - populate(objectMap, "databaseName", b.DatabaseName) - populate(objectMap, "firstLsn", b.FirstLsn) - populate(objectMap, "isBackupRestored", b.IsBackupRestored) - populate(objectMap, "lastLsn", b.LastLsn) - populateTimeRFC3339(objectMap, "lastModifiedTime", b.LastModifiedTime) - populate(objectMap, "listOfBackupFiles", b.ListOfBackupFiles) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupSetInfo. -func (b *BackupSetInfo) 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 "backupFinishedDate": - err = unpopulateTimeRFC3339(val, "BackupFinishedDate", &b.BackupFinishedDate) - delete(rawMsg, key) - case "backupSetId": - err = unpopulate(val, "BackupSetID", &b.BackupSetID) - delete(rawMsg, key) - case "backupStartDate": - err = unpopulateTimeRFC3339(val, "BackupStartDate", &b.BackupStartDate) - delete(rawMsg, key) - case "backupType": - err = unpopulate(val, "BackupType", &b.BackupType) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &b.DatabaseName) - delete(rawMsg, key) - case "firstLsn": - err = unpopulate(val, "FirstLsn", &b.FirstLsn) - delete(rawMsg, key) - case "isBackupRestored": - err = unpopulate(val, "IsBackupRestored", &b.IsBackupRestored) - delete(rawMsg, key) - case "lastLsn": - err = unpopulate(val, "LastLsn", &b.LastLsn) - delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateTimeRFC3339(val, "LastModifiedTime", &b.LastModifiedTime) - delete(rawMsg, key) - case "listOfBackupFiles": - err = unpopulate(val, "ListOfBackupFiles", &b.ListOfBackupFiles) - 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 CheckOCIDriverTaskOutput. -func (c CheckOCIDriverTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "installedDriver", c.InstalledDriver) - populate(objectMap, "validationErrors", c.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CheckOCIDriverTaskProperties. -func (c CheckOCIDriverTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", c.ClientData) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "input", c.Input) - populate(objectMap, "output", c.Output) - populate(objectMap, "state", c.State) - objectMap["taskType"] = "Service.Check.OCI" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CheckOCIDriverTaskProperties. -func (c *CheckOCIDriverTaskProperties) 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 "clientData": - err = unpopulate(val, "ClientData", &c.ClientData) - delete(rawMsg, key) - case "commands": - c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &c.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &c.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - 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 CommandProperties. -func (c CommandProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["commandType"] = c.CommandType - populate(objectMap, "errors", c.Errors) - populate(objectMap, "state", c.State) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectToMongoDbTaskProperties. -func (c ConnectToMongoDbTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", c.ClientData) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "input", c.Input) - populate(objectMap, "output", c.Output) - populate(objectMap, "state", c.State) - objectMap["taskType"] = "Connect.MongoDb" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToMongoDbTaskProperties. -func (c *ConnectToMongoDbTaskProperties) 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 "clientData": - err = unpopulate(val, "ClientData", &c.ClientData) - delete(rawMsg, key) - case "commands": - c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &c.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &c.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - 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 ConnectToSourceMySQLTaskProperties. -func (c ConnectToSourceMySQLTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", c.ClientData) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "input", c.Input) - populate(objectMap, "output", c.Output) - populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToSource.MySql" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceMySQLTaskProperties. -func (c *ConnectToSourceMySQLTaskProperties) 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 "clientData": - err = unpopulate(val, "ClientData", &c.ClientData) - delete(rawMsg, key) - case "commands": - c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &c.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &c.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - 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 ConnectToSourceNonSQLTaskOutput. -func (c ConnectToSourceNonSQLTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databases", c.Databases) - populate(objectMap, "id", c.ID) - populate(objectMap, "serverProperties", c.ServerProperties) - populate(objectMap, "sourceServerBrandVersion", c.SourceServerBrandVersion) - populate(objectMap, "validationErrors", c.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectToSourceOracleSyncTaskOutput. -func (c ConnectToSourceOracleSyncTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databases", c.Databases) - populate(objectMap, "sourceServerBrandVersion", c.SourceServerBrandVersion) - populate(objectMap, "sourceServerVersion", c.SourceServerVersion) - populate(objectMap, "validationErrors", c.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectToSourceOracleSyncTaskProperties. -func (c ConnectToSourceOracleSyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", c.ClientData) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "input", c.Input) - populate(objectMap, "output", c.Output) - populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToSource.Oracle.Sync" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceOracleSyncTaskProperties. -func (c *ConnectToSourceOracleSyncTaskProperties) 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 "clientData": - err = unpopulate(val, "ClientData", &c.ClientData) - delete(rawMsg, key) - case "commands": - c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &c.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &c.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - 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 ConnectToSourcePostgreSQLSyncTaskOutput. -func (c ConnectToSourcePostgreSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databases", c.Databases) - populate(objectMap, "id", c.ID) - populate(objectMap, "sourceServerBrandVersion", c.SourceServerBrandVersion) - populate(objectMap, "sourceServerVersion", c.SourceServerVersion) - populate(objectMap, "validationErrors", c.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectToSourcePostgreSQLSyncTaskProperties. -func (c ConnectToSourcePostgreSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", c.ClientData) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "input", c.Input) - populate(objectMap, "output", c.Output) - populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToSource.PostgreSql.Sync" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourcePostgreSQLSyncTaskProperties. -func (c *ConnectToSourcePostgreSQLSyncTaskProperties) 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 "clientData": - err = unpopulate(val, "ClientData", &c.ClientData) - delete(rawMsg, key) - case "commands": - c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &c.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &c.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - 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 ConnectToSourceSQLServerSyncTaskProperties. -func (c ConnectToSourceSQLServerSyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", c.ClientData) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "input", c.Input) - populate(objectMap, "output", c.Output) - populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToSource.SqlServer.Sync" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceSQLServerSyncTaskProperties. -func (c *ConnectToSourceSQLServerSyncTaskProperties) 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 "clientData": - err = unpopulate(val, "ClientData", &c.ClientData) - delete(rawMsg, key) - case "commands": - c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &c.Input) - delete(rawMsg, key) - case "output": - c.Output, err = unmarshalConnectToSourceSQLServerTaskOutputClassificationArray(val) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - 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 ConnectToSourceSQLServerTaskOutputAgentJobLevel. -func (c ConnectToSourceSQLServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "isEnabled", c.IsEnabled) - populate(objectMap, "jobCategory", c.JobCategory) - populate(objectMap, "jobOwner", c.JobOwner) - populateTimeRFC3339(objectMap, "lastExecutedOn", c.LastExecutedOn) - populate(objectMap, "migrationEligibility", c.MigrationEligibility) - populate(objectMap, "name", c.Name) - objectMap["resultType"] = "AgentJobLevelOutput" - populate(objectMap, "validationErrors", c.ValidationErrors) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceSQLServerTaskOutputAgentJobLevel. -func (c *ConnectToSourceSQLServerTaskOutputAgentJobLevel) 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 "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &c.IsEnabled) - delete(rawMsg, key) - case "jobCategory": - err = unpopulate(val, "JobCategory", &c.JobCategory) - delete(rawMsg, key) - case "jobOwner": - err = unpopulate(val, "JobOwner", &c.JobOwner) - delete(rawMsg, key) - case "lastExecutedOn": - err = unpopulateTimeRFC3339(val, "LastExecutedOn", &c.LastExecutedOn) - delete(rawMsg, key) - case "migrationEligibility": - err = unpopulate(val, "MigrationEligibility", &c.MigrationEligibility) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &c.ResultType) - delete(rawMsg, key) - case "validationErrors": - err = unpopulate(val, "ValidationErrors", &c.ValidationErrors) - 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 ConnectToSourceSQLServerTaskOutputDatabaseLevel. -func (c ConnectToSourceSQLServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "compatibilityLevel", c.CompatibilityLevel) - populate(objectMap, "databaseFiles", c.DatabaseFiles) - populate(objectMap, "databaseState", c.DatabaseState) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - objectMap["resultType"] = "DatabaseLevelOutput" - populate(objectMap, "sizeMB", c.SizeMB) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceSQLServerTaskOutputDatabaseLevel. -func (c *ConnectToSourceSQLServerTaskOutputDatabaseLevel) 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 "compatibilityLevel": - err = unpopulate(val, "CompatibilityLevel", &c.CompatibilityLevel) - delete(rawMsg, key) - case "databaseFiles": - err = unpopulate(val, "DatabaseFiles", &c.DatabaseFiles) - delete(rawMsg, key) - case "databaseState": - err = unpopulate(val, "DatabaseState", &c.DatabaseState) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &c.ResultType) - delete(rawMsg, key) - case "sizeMB": - err = unpopulate(val, "SizeMB", &c.SizeMB) - 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 ConnectToSourceSQLServerTaskOutputLoginLevel. -func (c ConnectToSourceSQLServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultDatabase", c.DefaultDatabase) - populate(objectMap, "id", c.ID) - populate(objectMap, "isEnabled", c.IsEnabled) - populate(objectMap, "loginType", c.LoginType) - populate(objectMap, "migrationEligibility", c.MigrationEligibility) - populate(objectMap, "name", c.Name) - objectMap["resultType"] = "LoginLevelOutput" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceSQLServerTaskOutputLoginLevel. -func (c *ConnectToSourceSQLServerTaskOutputLoginLevel) 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 "defaultDatabase": - err = unpopulate(val, "DefaultDatabase", &c.DefaultDatabase) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &c.IsEnabled) - delete(rawMsg, key) - case "loginType": - err = unpopulate(val, "LoginType", &c.LoginType) - delete(rawMsg, key) - case "migrationEligibility": - err = unpopulate(val, "MigrationEligibility", &c.MigrationEligibility) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &c.ResultType) - 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 ConnectToSourceSQLServerTaskOutputTaskLevel. -func (c ConnectToSourceSQLServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "agentJobs", c.AgentJobs) - populate(objectMap, "databaseTdeCertificateMapping", c.DatabaseTdeCertificateMapping) - populate(objectMap, "databases", c.Databases) - populate(objectMap, "id", c.ID) - populate(objectMap, "logins", c.Logins) - objectMap["resultType"] = "TaskLevelOutput" - populate(objectMap, "sourceServerBrandVersion", c.SourceServerBrandVersion) - populate(objectMap, "sourceServerVersion", c.SourceServerVersion) - populate(objectMap, "validationErrors", c.ValidationErrors) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceSQLServerTaskOutputTaskLevel. -func (c *ConnectToSourceSQLServerTaskOutputTaskLevel) 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 "agentJobs": - err = unpopulate(val, "AgentJobs", &c.AgentJobs) - delete(rawMsg, key) - case "databaseTdeCertificateMapping": - err = unpopulate(val, "DatabaseTdeCertificateMapping", &c.DatabaseTdeCertificateMapping) - delete(rawMsg, key) - case "databases": - err = unpopulate(val, "Databases", &c.Databases) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "logins": - err = unpopulate(val, "Logins", &c.Logins) - delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &c.ResultType) - delete(rawMsg, key) - case "sourceServerBrandVersion": - err = unpopulate(val, "SourceServerBrandVersion", &c.SourceServerBrandVersion) - delete(rawMsg, key) - case "sourceServerVersion": - err = unpopulate(val, "SourceServerVersion", &c.SourceServerVersion) - delete(rawMsg, key) - case "validationErrors": - err = unpopulate(val, "ValidationErrors", &c.ValidationErrors) - 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 ConnectToSourceSQLServerTaskProperties. -func (c ConnectToSourceSQLServerTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", c.ClientData) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "input", c.Input) - populate(objectMap, "output", c.Output) - populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToSource.SqlServer" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToSourceSQLServerTaskProperties. -func (c *ConnectToSourceSQLServerTaskProperties) 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 "clientData": - err = unpopulate(val, "ClientData", &c.ClientData) - delete(rawMsg, key) - case "commands": - c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &c.Input) - delete(rawMsg, key) - case "output": - c.Output, err = unmarshalConnectToSourceSQLServerTaskOutputClassificationArray(val) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - 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 ConnectToTargetAzureDbForMySQLTaskOutput. -func (c ConnectToTargetAzureDbForMySQLTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databases", c.Databases) - populate(objectMap, "id", c.ID) - populate(objectMap, "serverVersion", c.ServerVersion) - populate(objectMap, "targetServerBrandVersion", c.TargetServerBrandVersion) - populate(objectMap, "validationErrors", c.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectToTargetAzureDbForMySQLTaskProperties. -func (c ConnectToTargetAzureDbForMySQLTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", c.ClientData) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "input", c.Input) - populate(objectMap, "output", c.Output) - populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToTarget.AzureDbForMySql" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetAzureDbForMySQLTaskProperties. -func (c *ConnectToTargetAzureDbForMySQLTaskProperties) 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 "clientData": - err = unpopulate(val, "ClientData", &c.ClientData) - delete(rawMsg, key) - case "commands": - c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &c.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &c.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - 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 ConnectToTargetAzureDbForPostgreSQLSyncTaskOutput. -func (c ConnectToTargetAzureDbForPostgreSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databases", c.Databases) - populate(objectMap, "id", c.ID) - populate(objectMap, "targetServerBrandVersion", c.TargetServerBrandVersion) - populate(objectMap, "targetServerVersion", c.TargetServerVersion) - populate(objectMap, "validationErrors", c.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectToTargetAzureDbForPostgreSQLSyncTaskProperties. -func (c ConnectToTargetAzureDbForPostgreSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", c.ClientData) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "input", c.Input) - populate(objectMap, "output", c.Output) - populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetAzureDbForPostgreSQLSyncTaskProperties. -func (c *ConnectToTargetAzureDbForPostgreSQLSyncTaskProperties) 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 "clientData": - err = unpopulate(val, "ClientData", &c.ClientData) - delete(rawMsg, key) - case "commands": - c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &c.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &c.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - 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 ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskOutput. -func (c ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseSchemaMap", c.DatabaseSchemaMap) - populate(objectMap, "databases", c.Databases) - populate(objectMap, "targetServerBrandVersion", c.TargetServerBrandVersion) - populate(objectMap, "targetServerVersion", c.TargetServerVersion) - populate(objectMap, "validationErrors", c.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskOutputDatabaseSchemaMapItem. -func (c ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskOutputDatabaseSchemaMapItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "database", c.Database) - populate(objectMap, "schemas", c.Schemas) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskProperties. -func (c ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", c.ClientData) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "input", c.Input) - populate(objectMap, "output", c.Output) - populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskProperties. -func (c *ConnectToTargetOracleAzureDbForPostgreSQLSyncTaskProperties) 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 "clientData": - err = unpopulate(val, "ClientData", &c.ClientData) - delete(rawMsg, key) - case "commands": - c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &c.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &c.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - 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 ConnectToTargetSQLDbSyncTaskProperties. -func (c ConnectToTargetSQLDbSyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", c.ClientData) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "input", c.Input) - populate(objectMap, "output", c.Output) - populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToTarget.SqlDb.Sync" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLDbSyncTaskProperties. -func (c *ConnectToTargetSQLDbSyncTaskProperties) 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 "clientData": - err = unpopulate(val, "ClientData", &c.ClientData) - delete(rawMsg, key) - case "commands": - c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &c.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &c.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - 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 ConnectToTargetSQLDbTaskProperties. -func (c ConnectToTargetSQLDbTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", c.ClientData) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "input", c.Input) - populate(objectMap, "output", c.Output) - populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToTarget.SqlDb" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLDbTaskProperties. -func (c *ConnectToTargetSQLDbTaskProperties) 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 "clientData": - err = unpopulate(val, "ClientData", &c.ClientData) - delete(rawMsg, key) - case "commands": - c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &c.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &c.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - 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 ConnectToTargetSQLMISyncTaskOutput. -func (c ConnectToTargetSQLMISyncTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "targetServerBrandVersion", c.TargetServerBrandVersion) - populate(objectMap, "targetServerVersion", c.TargetServerVersion) - populate(objectMap, "validationErrors", c.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectToTargetSQLMISyncTaskProperties. -func (c ConnectToTargetSQLMISyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", c.ClientData) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "input", c.Input) - populate(objectMap, "output", c.Output) - populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLMISyncTaskProperties. -func (c *ConnectToTargetSQLMISyncTaskProperties) 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 "clientData": - err = unpopulate(val, "ClientData", &c.ClientData) - delete(rawMsg, key) - case "commands": - c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &c.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &c.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - 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 ConnectToTargetSQLMITaskOutput. -func (c ConnectToTargetSQLMITaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "agentJobs", c.AgentJobs) - populate(objectMap, "id", c.ID) - populate(objectMap, "logins", c.Logins) - populate(objectMap, "targetServerBrandVersion", c.TargetServerBrandVersion) - populate(objectMap, "targetServerVersion", c.TargetServerVersion) - populate(objectMap, "validationErrors", c.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectToTargetSQLMITaskProperties. -func (c ConnectToTargetSQLMITaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", c.ClientData) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "input", c.Input) - populate(objectMap, "output", c.Output) - populate(objectMap, "state", c.State) - objectMap["taskType"] = "ConnectToTarget.AzureSqlDbMI" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectToTargetSQLMITaskProperties. -func (c *ConnectToTargetSQLMITaskProperties) 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 "clientData": - err = unpopulate(val, "ClientData", &c.ClientData) - delete(rawMsg, key) - case "commands": - c.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &c.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &c.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - 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]interface{}) - populate(objectMap, "failedObjects", d.FailedObjects) - populate(objectMap, "validationErrors", d.ValidationErrors) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataItemMigrationSummaryResult. -func (d *DataItemMigrationSummaryResult) 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "endedOn": - err = unpopulateTimeRFC3339(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) - 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 "startedOn": - err = unpopulateTimeRFC3339(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", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseBackupInfo. -func (d DatabaseBackupInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupFiles", d.BackupFiles) - populateTimeRFC3339(objectMap, "backupFinishDate", d.BackupFinishDate) - populate(objectMap, "backupType", d.BackupType) - populate(objectMap, "databaseName", d.DatabaseName) - populate(objectMap, "familyCount", d.FamilyCount) - populate(objectMap, "isCompressed", d.IsCompressed) - populate(objectMap, "isDamaged", d.IsDamaged) - populate(objectMap, "position", d.Position) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseBackupInfo. -func (d *DatabaseBackupInfo) 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "backupFiles": - err = unpopulate(val, "BackupFiles", &d.BackupFiles) - delete(rawMsg, key) - case "backupFinishDate": - err = unpopulateTimeRFC3339(val, "BackupFinishDate", &d.BackupFinishDate) - delete(rawMsg, key) - case "backupType": - err = unpopulate(val, "BackupType", &d.BackupType) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &d.DatabaseName) - delete(rawMsg, key) - case "familyCount": - err = unpopulate(val, "FamilyCount", &d.FamilyCount) - delete(rawMsg, key) - case "isCompressed": - err = unpopulate(val, "IsCompressed", &d.IsCompressed) - delete(rawMsg, key) - case "isDamaged": - err = unpopulate(val, "IsDamaged", &d.IsDamaged) - delete(rawMsg, key) - case "position": - err = unpopulate(val, "Position", &d.Position) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endedOn": - err = unpopulateTimeRFC3339(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) - 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 = unpopulateTimeRFC3339(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", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExecutionStatistics. -func (e ExecutionStatistics) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type GetTdeCertificatesSQLTaskInput. -func (g GetTdeCertificatesSQLTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupFileShare", g.BackupFileShare) - populate(objectMap, "connectionInfo", g.ConnectionInfo) - populate(objectMap, "selectedCertificates", g.SelectedCertificates) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GetTdeCertificatesSQLTaskOutput. -func (g GetTdeCertificatesSQLTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "base64EncodedCertificates", g.Base64EncodedCertificates) - populate(objectMap, "validationErrors", g.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GetTdeCertificatesSQLTaskProperties. -func (g GetTdeCertificatesSQLTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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" - return json.Marshal(objectMap) -} - -// 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", 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 GetUserTablesMySQLTaskInput. -func (g GetUserTablesMySQLTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionInfo", g.ConnectionInfo) - populate(objectMap, "selectedDatabases", g.SelectedDatabases) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesMySQLTaskOutput. -func (g GetUserTablesMySQLTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databasesToTables", g.DatabasesToTables) - populate(objectMap, "id", g.ID) - populate(objectMap, "validationErrors", g.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesMySQLTaskProperties. -func (g GetUserTablesMySQLTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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" - return json.Marshal(objectMap) -} - -// 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", 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 GetUserTablesOracleTaskInput. -func (g GetUserTablesOracleTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionInfo", g.ConnectionInfo) - populate(objectMap, "selectedSchemas", g.SelectedSchemas) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesOracleTaskOutput. -func (g GetUserTablesOracleTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "schemaName", g.SchemaName) - populate(objectMap, "tables", g.Tables) - populate(objectMap, "validationErrors", g.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesOracleTaskProperties. -func (g GetUserTablesOracleTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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" - 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]interface{}) - populate(objectMap, "connectionInfo", g.ConnectionInfo) - populate(objectMap, "selectedDatabases", g.SelectedDatabases) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesPostgreSQLTaskOutput. -func (g GetUserTablesPostgreSQLTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseName", g.DatabaseName) - populate(objectMap, "tables", g.Tables) - populate(objectMap, "validationErrors", g.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesPostgreSQLTaskProperties. -func (g GetUserTablesPostgreSQLTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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" - 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]interface{}) - populate(objectMap, "selectedSourceDatabases", g.SelectedSourceDatabases) - populate(objectMap, "selectedTargetDatabases", g.SelectedTargetDatabases) - populate(objectMap, "sourceConnectionInfo", g.SourceConnectionInfo) - populate(objectMap, "targetConnectionInfo", g.TargetConnectionInfo) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLSyncTaskOutput. -func (g GetUserTablesSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databasesToSourceTables", g.DatabasesToSourceTables) - populate(objectMap, "databasesToTargetTables", g.DatabasesToTargetTables) - populate(objectMap, "tableValidationErrors", g.TableValidationErrors) - populate(objectMap, "validationErrors", g.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLSyncTaskProperties. -func (g GetUserTablesSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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" - 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]interface{}) - populate(objectMap, "connectionInfo", g.ConnectionInfo) - populate(objectMap, "selectedDatabases", g.SelectedDatabases) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLTaskOutput. -func (g GetUserTablesSQLTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databasesToTables", g.DatabasesToTables) - populate(objectMap, "id", g.ID) - populate(objectMap, "validationErrors", g.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GetUserTablesSQLTaskProperties. -func (g GetUserTablesSQLTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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" - 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 "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 InstallOCIDriverTaskOutput. -func (i InstallOCIDriverTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "validationErrors", i.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type InstallOCIDriverTaskProperties. -func (i InstallOCIDriverTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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" - 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 MiSQLConnectionInfo. -func (m MiSQLConnectionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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 MigrateMISyncCompleteCommandOutput. -func (m MigrateMISyncCompleteCommandOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errors", m.Errors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateMISyncCompleteCommandProperties. -func (m MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - 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]interface{}) - 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" - 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]interface{}) - populate(objectMap, "name", m.Name) - populate(objectMap, "tableMap", m.TableMap) - populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLOfflineTaskInput. -func (m MigrateMySQLAzureDbForMySQLOfflineTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "makeSourceServerReadOnly", m.MakeSourceServerReadOnly) - populate(objectMap, "optionalAgentSettings", m.OptionalAgentSettings) - populate(objectMap, "selectedDatabases", m.SelectedDatabases) - populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) - populateTimeRFC3339(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 "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 = unpopulateTimeRFC3339(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 MigrateMySQLAzureDbForMySQLOfflineTaskOutputDatabaseLevel. -func (m MigrateMySQLAzureDbForMySQLOfflineTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseName", m.DatabaseName) - populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "errorCount", m.ErrorCount) - populate(objectMap, "errorPrefix", m.ErrorPrefix) - populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) - populate(objectMap, "id", m.ID) - populateTimeRFC3339(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) - populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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]interface{}) - 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]interface{}) - populate(objectMap, "databaseSummary", m.DatabaseSummary) - populate(objectMap, "databases", m.Databases) - populate(objectMap, "durationInSeconds", m.DurationInSeconds) - populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) - populate(objectMap, "id", m.ID) - populateTimeRFC3339(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) - populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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]interface{}) - populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "errorPrefix", m.ErrorPrefix) - populate(objectMap, "id", m.ID) - populate(objectMap, "itemsCompletedCount", m.ItemsCompletedCount) - populate(objectMap, "itemsCount", m.ItemsCount) - populateTimeRFC3339(objectMap, "lastStorageUpdate", m.LastStorageUpdate) - populate(objectMap, "objectName", m.ObjectName) - populate(objectMap, "resultPrefix", m.ResultPrefix) - objectMap["resultType"] = "TableLevelOutput" - populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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]interface{}) - 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" - 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 "output": - m.Output, err = unmarshalMigrateMySQLAzureDbForMySQLOfflineTaskOutputClassificationArray(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 MigrateMySQLAzureDbForMySQLSyncDatabaseInput. -func (m MigrateMySQLAzureDbForMySQLSyncDatabaseInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskInput. -func (m MigrateMySQLAzureDbForMySQLSyncTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "selectedDatabases", m.SelectedDatabases) - populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) - populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseError. -func (m MigrateMySQLAzureDbForMySQLSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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]interface{}) - 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) - populateTimeRFC3339(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" - populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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]interface{}) - 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]interface{}) - populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "id", m.ID) - objectMap["resultType"] = "MigrationLevelOutput" - populate(objectMap, "sourceServer", m.SourceServer) - populate(objectMap, "sourceServerVersion", m.SourceServerVersion) - populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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]interface{}) - 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) - populateTimeRFC3339(objectMap, "fullLoadEndedOn", m.FullLoadEndedOn) - populateTimeRFC3339(objectMap, "fullLoadEstFinishTime", m.FullLoadEstFinishTime) - populateTimeRFC3339(objectMap, "fullLoadStartedOn", m.FullLoadStartedOn) - populate(objectMap, "fullLoadTotalRows", m.FullLoadTotalRows) - populate(objectMap, "id", m.ID) - populateTimeRFC3339(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 = unpopulateTimeRFC3339(val, "FullLoadEndedOn", &m.FullLoadEndedOn) - delete(rawMsg, key) - case "fullLoadEstFinishTime": - err = unpopulateTimeRFC3339(val, "FullLoadEstFinishTime", &m.FullLoadEstFinishTime) - delete(rawMsg, key) - case "fullLoadStartedOn": - err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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]interface{}) - 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.Sync" - 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]interface{}) - 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" - 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]interface{}) - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskInput. -func (m MigrateOracleAzureDbPostgreSQLSyncTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "selectedDatabases", m.SelectedDatabases) - populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) - populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseError. -func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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]interface{}) - 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) - populateTimeRFC3339(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" - populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - return json.Marshal(objectMap) -} - -// 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) - } - 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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigrateOracleAzureDbPostgreSQLSyncTaskOutputError. -func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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 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) - } - 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 MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel. -func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "id", m.ID) - objectMap["resultType"] = "MigrationLevelOutput" - populate(objectMap, "sourceServer", m.SourceServer) - populate(objectMap, "sourceServerVersion", m.SourceServerVersion) - populateTimeRFC3339(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 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "endedOn": - err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel. -func (m MigrateOracleAzureDbPostgreSQLSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - populateTimeRFC3339(objectMap, "fullLoadEndedOn", m.FullLoadEndedOn) - populateTimeRFC3339(objectMap, "fullLoadEstFinishTime", m.FullLoadEstFinishTime) - populateTimeRFC3339(objectMap, "fullLoadStartedOn", m.FullLoadStartedOn) - populate(objectMap, "fullLoadTotalRows", m.FullLoadTotalRows) - populate(objectMap, "id", m.ID) - populateTimeRFC3339(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 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) - } - 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 = unpopulateTimeRFC3339(val, "FullLoadEndedOn", &m.FullLoadEndedOn) - delete(rawMsg, key) - case "fullLoadEstFinishTime": - err = unpopulateTimeRFC3339(val, "FullLoadEstFinishTime", &m.FullLoadEstFinishTime) - delete(rawMsg, key) - case "fullLoadStartedOn": - err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncDatabaseInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "selectedDatabases", m.SelectedDatabases) - populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) - populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseError. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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 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) - } - 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 MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseLevel. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - populateTimeRFC3339(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" - populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - return json.Marshal(objectMap) -} - -// 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) - } - 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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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 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) - } - 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 MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(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) - populateTimeRFC3339(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 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "endedOn": - err = unpopulateTimeRFC3339(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 "sourceServerType": - err = unpopulate(val, "SourceServerType", &m.SourceServerType) - delete(rawMsg, key) - case "sourceServerVersion": - err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) - delete(rawMsg, key) - case "startedOn": - err = unpopulateTimeRFC3339(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) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputTableLevel. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - populateTimeRFC3339(objectMap, "fullLoadEndedOn", m.FullLoadEndedOn) - populateTimeRFC3339(objectMap, "fullLoadEstFinishTime", m.FullLoadEstFinishTime) - populateTimeRFC3339(objectMap, "fullLoadStartedOn", m.FullLoadStartedOn) - populate(objectMap, "fullLoadTotalRows", m.FullLoadTotalRows) - populate(objectMap, "id", m.ID) - populateTimeRFC3339(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 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) - } - 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 = unpopulateTimeRFC3339(val, "FullLoadEndedOn", &m.FullLoadEndedOn) - delete(rawMsg, key) - case "fullLoadEstFinishTime": - err = unpopulateTimeRFC3339(val, "FullLoadEstFinishTime", &m.FullLoadEstFinishTime) - delete(rawMsg, key) - case "fullLoadStartedOn": - err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties. -func (m MigratePostgreSQLAzureDbForPostgreSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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.PostgreSql.AzureDbForPostgreSql.SyncV2" - return json.Marshal(objectMap) -} - -// 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) - } - 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 = unmarshalMigratePostgreSQLAzureDbForPostgreSQLSyncTaskOutputClassificationArray(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 MigrateSQLServerSQLDbDatabaseInput. -func (m MigrateSQLServerSQLDbDatabaseInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "makeSourceDbReadOnly", m.MakeSourceDbReadOnly) - populate(objectMap, "name", m.Name) - populate(objectMap, "tableMap", m.TableMap) - populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncDatabaseInput. -func (m MigrateSQLServerSQLDbSyncDatabaseInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskInput. -func (m MigrateSQLServerSQLDbSyncTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "selectedDatabases", m.SelectedDatabases) - populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) - populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) - populate(objectMap, "validationOptions", m.ValidationOptions) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbSyncTaskOutputDatabaseError. -func (m MigrateSQLServerSQLDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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 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) - } - 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 MigrateSQLServerSQLDbSyncTaskOutputDatabaseLevel. -func (m MigrateSQLServerSQLDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - populateTimeRFC3339(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" - populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - return json.Marshal(objectMap) -} - -// 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) - } - 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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigrateSQLServerSQLDbSyncTaskOutputError. -func (m MigrateSQLServerSQLDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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 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) - } - 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 MigrateSQLServerSQLDbSyncTaskOutputMigrationLevel. -func (m MigrateSQLServerSQLDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseCount", m.DatabaseCount) - populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "id", m.ID) - objectMap["resultType"] = "MigrationLevelOutput" - populate(objectMap, "sourceServer", m.SourceServer) - populate(objectMap, "sourceServerVersion", m.SourceServerVersion) - populateTimeRFC3339(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 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "databaseCount": - err = unpopulate(val, "DatabaseCount", &m.DatabaseCount) - delete(rawMsg, key) - case "endedOn": - err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigrateSQLServerSQLDbSyncTaskOutputTableLevel. -func (m MigrateSQLServerSQLDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - populateTimeRFC3339(objectMap, "fullLoadEndedOn", m.FullLoadEndedOn) - populateTimeRFC3339(objectMap, "fullLoadEstFinishTime", m.FullLoadEstFinishTime) - populateTimeRFC3339(objectMap, "fullLoadStartedOn", m.FullLoadStartedOn) - populate(objectMap, "fullLoadTotalRows", m.FullLoadTotalRows) - populate(objectMap, "id", m.ID) - populateTimeRFC3339(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 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) - } - 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 = unpopulateTimeRFC3339(val, "FullLoadEndedOn", &m.FullLoadEndedOn) - delete(rawMsg, key) - case "fullLoadEstFinishTime": - err = unpopulateTimeRFC3339(val, "FullLoadEstFinishTime", &m.FullLoadEstFinishTime) - delete(rawMsg, key) - case "fullLoadStartedOn": - err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigrateSQLServerSQLDbSyncTaskProperties. -func (m MigrateSQLServerSQLDbSyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - 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 { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskInput. -func (m MigrateSQLServerSQLDbTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "selectedDatabases", m.SelectedDatabases) - populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) - populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) - populate(objectMap, "validationOptions", m.ValidationOptions) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutputDatabaseLevel. -func (m MigrateSQLServerSQLDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseName", m.DatabaseName) - populateTimeRFC3339(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, "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) - populateTimeRFC3339(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 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) - delete(rawMsg, key) - case "endedOn": - err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MigrateSQLServerSQLDbTaskOutputDatabaseLevelValidationResult. -func (m MigrateSQLServerSQLDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataIntegrityValidationResult", m.DataIntegrityValidationResult) - populateTimeRFC3339(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) - populateTimeRFC3339(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 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataIntegrityValidationResult": - err = unpopulate(val, "DataIntegrityValidationResult", &m.DataIntegrityValidationResult) - delete(rawMsg, key) - case "endedOn": - err = unpopulateTimeRFC3339(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 "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 = unpopulateTimeRFC3339(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) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskOutputError. -func (m MigrateSQLServerSQLDbTaskOutputError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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 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) - } - 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 MigrateSQLServerSQLDbTaskOutputMigrationLevel. -func (m MigrateSQLServerSQLDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseSummary", m.DatabaseSummary) - populate(objectMap, "databases", m.Databases) - populate(objectMap, "durationInSeconds", m.DurationInSeconds) - populateTimeRFC3339(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) - populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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]interface{}) - populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "errorPrefix", m.ErrorPrefix) - 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" - populateTimeRFC3339(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 { - 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 = unpopulateTimeRFC3339(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 "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 = unpopulateTimeRFC3339(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 MigrateSQLServerSQLDbTaskOutputValidationResult. -func (m MigrateSQLServerSQLDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - 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 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) - } - 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 "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) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLDbTaskProperties. -func (m MigrateSQLServerSQLDbTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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.SqlDb" - return json.Marshal(objectMap) -} - -// 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) - } - 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 = unmarshalMigrateSQLServerSQLDbTaskOutputClassificationArray(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 MigrateSQLServerSQLMIDatabaseInput. -func (m MigrateSQLServerSQLMIDatabaseInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupFilePaths", m.BackupFilePaths) - populate(objectMap, "backupFileShare", m.BackupFileShare) - populate(objectMap, "name", m.Name) - populate(objectMap, "restoreDatabaseName", m.RestoreDatabaseName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskInput. -func (m MigrateSQLServerSQLMISyncTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskOutputDatabaseLevel. -func (m MigrateSQLServerSQLMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "activeBackupSets", m.ActiveBackupSets) - populate(objectMap, "containerName", m.ContainerName) - populateTimeRFC3339(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) - populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - return json.Marshal(objectMap) -} - -// 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) - } - 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 = unpopulateTimeRFC3339(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) - delete(rawMsg, key) - case "sourceDatabaseName": - err = unpopulate(val, "SourceDatabaseName", &m.SourceDatabaseName) - delete(rawMsg, key) - case "startedOn": - err = unpopulateTimeRFC3339(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 MigrateSQLServerSQLMISyncTaskOutputError. -func (m MigrateSQLServerSQLMISyncTaskOutputError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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 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) - } - 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 MigrateSQLServerSQLMISyncTaskOutputMigrationLevel. -func (m MigrateSQLServerSQLMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseCount", m.DatabaseCount) - populate(objectMap, "databaseErrorCount", m.DatabaseErrorCount) - populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "id", m.ID) - objectMap["resultType"] = "MigrationLevelOutput" - populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) - populate(objectMap, "sourceServerName", m.SourceServerName) - populate(objectMap, "sourceServerVersion", m.SourceServerVersion) - populateTimeRFC3339(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 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) - } - 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 = unpopulateTimeRFC3339(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 "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 = unpopulateTimeRFC3339(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) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMISyncTaskProperties. -func (m MigrateSQLServerSQLMISyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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.Sync.LRS" - return json.Marshal(objectMap) -} - -// 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) - } - 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 = unmarshalMigrateSQLServerSQLMISyncTaskOutputClassificationArray(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 MigrateSQLServerSQLMITaskInput. -func (m MigrateSQLServerSQLMITaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputAgentJobLevel. -func (m MigrateSQLServerSQLMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "exceptionsAndWarnings", m.ExceptionsAndWarnings) - populate(objectMap, "id", m.ID) - populate(objectMap, "isEnabled", m.IsEnabled) - populate(objectMap, "message", m.Message) - populate(objectMap, "name", m.Name) - objectMap["resultType"] = "AgentJobLevelOutput" - populateTimeRFC3339(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 { - 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 = unpopulateTimeRFC3339(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 "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 = unpopulateTimeRFC3339(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) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputDatabaseLevel. -func (m MigrateSQLServerSQLMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseName", m.DatabaseName) - populateTimeRFC3339(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) - populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - 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 { - 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 = unpopulateTimeRFC3339(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 "sizeMB": - err = unpopulate(val, "SizeMB", &m.SizeMB) - delete(rawMsg, key) - case "stage": - err = unpopulate(val, "Stage", &m.Stage) - delete(rawMsg, key) - case "startedOn": - err = unpopulateTimeRFC3339(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) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputError. -func (m MigrateSQLServerSQLMITaskOutputError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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 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) - } - 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 MigrateSQLServerSQLMITaskOutputLoginLevel. -func (m MigrateSQLServerSQLMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(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) - populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "state", m.State) - return json.Marshal(objectMap) -} - -// 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "endedOn": - err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSQLServerSQLMITaskOutputMigrationLevel. -func (m MigrateSQLServerSQLMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "agentJobs", m.AgentJobs) - populate(objectMap, "databases", m.Databases) - populateTimeRFC3339(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) - populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "state", m.State) - 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 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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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) - 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 MigrateSQLServerSQLMITaskProperties. -func (m MigrateSQLServerSQLMITaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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" - return json.Marshal(objectMap) -} - -// 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) - } - 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 = unmarshalMigrateSQLServerSQLMITaskOutputClassificationArray(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 MigrateSchemaSQLServerSQLDbTaskInput. -func (m MigrateSchemaSQLServerSQLDbTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "selectedDatabases", m.SelectedDatabases) - populate(objectMap, "sourceConnectionInfo", m.SourceConnectionInfo) - populate(objectMap, "targetConnectionInfo", m.TargetConnectionInfo) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutputDatabaseLevel. -func (m MigrateSchemaSQLServerSQLDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseErrorResultPrefix", m.DatabaseErrorResultPrefix) - populate(objectMap, "databaseName", m.DatabaseName) - populateTimeRFC3339(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) - populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "state", m.State) - return json.Marshal(objectMap) -} - -// 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) - } - 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 = unpopulateTimeRFC3339(val, "EndedOn", &m.EndedOn) - delete(rawMsg, key) - case "fileId": - err = unpopulate(val, "FileID", &m.FileID) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "numberOfFailedOperations": - err = unpopulate(val, "NumberOfFailedOperations", &m.NumberOfFailedOperations) - delete(rawMsg, key) - 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 = unpopulateTimeRFC3339(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) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSchemaSQLServerSQLDbTaskOutputError. -func (m MigrateSchemaSQLServerSQLDbTaskOutputError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "commandText", m.CommandText) - populate(objectMap, "errorText", m.ErrorText) - populate(objectMap, "id", m.ID) - objectMap["resultType"] = "SchemaErrorOutput" - return json.Marshal(objectMap) -} - -// 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) - } - 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 "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 MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel. -func (m MigrateSchemaSQLServerSQLDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "id", m.ID) - objectMap["resultType"] = "MigrationLevelOutput" - populate(objectMap, "sourceServerBrandVersion", m.SourceServerBrandVersion) - populate(objectMap, "sourceServerVersion", m.SourceServerVersion) - populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "state", m.State) - populate(objectMap, "targetServerBrandVersion", m.TargetServerBrandVersion) - populate(objectMap, "targetServerVersion", m.TargetServerVersion) - return json.Marshal(objectMap) -} - -// 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "endedOn": - err = unpopulateTimeRFC3339(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 "sourceServerBrandVersion": - err = unpopulate(val, "SourceServerBrandVersion", &m.SourceServerBrandVersion) - delete(rawMsg, key) - case "sourceServerVersion": - err = unpopulate(val, "SourceServerVersion", &m.SourceServerVersion) - delete(rawMsg, key) - case "startedOn": - err = unpopulateTimeRFC3339(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 "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 MigrateSchemaSQLServerSQLDbTaskProperties. -func (m MigrateSchemaSQLServerSQLDbTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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" - return json.Marshal(objectMap) -} - -// 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) - } - 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) - 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 MigrateSchemaSQLTaskOutputError. -func (m MigrateSchemaSQLTaskOutputError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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 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) - } - 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 MigrateSsisTaskOutputMigrationLevel. -func (m MigrateSsisTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(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) - populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - 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 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "endedOn": - err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(val, "StartedOn", &m.StartedOn) - delete(rawMsg, key) - 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 { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSsisTaskOutputProjectLevel. -func (m MigrateSsisTaskOutputProjectLevel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(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) - populateTimeRFC3339(objectMap, "startedOn", m.StartedOn) - populate(objectMap, "state", m.State) - return json.Marshal(objectMap) -} - -// 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "endedOn": - err = unpopulateTimeRFC3339(val, "EndedOn", &m.EndedOn) - delete(rawMsg, key) - case "exceptionsAndWarnings": - err = unpopulate(val, "ExceptionsAndWarnings", &m.ExceptionsAndWarnings) - delete(rawMsg, key) - case "folderName": - err = unpopulate(val, "FolderName", &m.FolderName) - 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 "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 = unpopulateTimeRFC3339(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) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSsisTaskProperties. -func (m MigrateSsisTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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.Ssis" - return json.Marshal(objectMap) -} - -// 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) - } - 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 = unmarshalMigrateSsisTaskOutputClassificationArray(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 MigrateSyncCompleteCommandInput. -func (m MigrateSyncCompleteCommandInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "commitTimeStamp", m.CommitTimeStamp) - populate(objectMap, "databaseName", m.DatabaseName) - return json.Marshal(objectMap) -} - -// 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "commitTimeStamp": - err = unpopulateTimeRFC3339(val, "CommitTimeStamp", &m.CommitTimeStamp) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) - 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 MigrateSyncCompleteCommandOutput. -func (m MigrateSyncCompleteCommandOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errors", m.Errors) - populate(objectMap, "id", m.ID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrateSyncCompleteCommandProperties. -func (m MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - return json.Marshal(objectMap) -} - -// 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) - } - 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 MigrationEligibilityInfo. -func (m MigrationEligibilityInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "isEligibleForMigration", m.IsEligibleForMigration) - populate(objectMap, "validationMessages", m.ValidationMessages) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MigrationValidationDatabaseLevelResult. -func (m MigrationValidationDatabaseLevelResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataIntegrityValidationResult", m.DataIntegrityValidationResult) - populateTimeRFC3339(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) - populateTimeRFC3339(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 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataIntegrityValidationResult": - err = unpopulate(val, "DataIntegrityValidationResult", &m.DataIntegrityValidationResult) - delete(rawMsg, key) - case "endedOn": - err = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrationValidationDatabaseSummaryResult. -func (m MigrationValidationDatabaseSummaryResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endedOn", m.EndedOn) - populate(objectMap, "id", m.ID) - populate(objectMap, "migrationId", m.MigrationID) - populate(objectMap, "sourceDatabaseName", m.SourceDatabaseName) - populateTimeRFC3339(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 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "endedOn": - err = unpopulateTimeRFC3339(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) - delete(rawMsg, key) - case "startedOn": - err = unpopulateTimeRFC3339(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) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MigrationValidationResult. -func (m MigrationValidationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "migrationId", m.MigrationID) - populate(objectMap, "status", m.Status) - populate(objectMap, "summaryResults", m.SummaryResults) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MongoDbCancelCommand. -func (m MongoDbCancelCommand) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["commandType"] = "cancel" - 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 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) - } - 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 MongoDbClusterInfo. -func (m MongoDbClusterInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databases", m.Databases) - populate(objectMap, "supportsSharding", m.SupportsSharding) - populate(objectMap, "type", m.Type) - populate(objectMap, "version", m.Version) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MongoDbCollectionProgress. -func (m MongoDbCollectionProgress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - populateTimeRFC3339(objectMap, "lastEventTime", m.LastEventTime) - populateTimeRFC3339(objectMap, "lastReplayTime", m.LastReplayTime) - populate(objectMap, "name", m.Name) - populate(objectMap, "qualifiedName", m.QualifiedName) - objectMap["resultType"] = MongoDbProgressResultTypeCollection - 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 { - 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 "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 = unpopulateTimeRFC3339(val, "LastEventTime", &m.LastEventTime) - delete(rawMsg, key) - case "lastReplayTime": - err = unpopulateTimeRFC3339(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) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MongoDbConnectionInfo. -func (m MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionString", m.ConnectionString) - populate(objectMap, "password", m.Password) - objectMap["type"] = "MongoDbConnectionInfo" - 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 { - 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 "connectionString": - err = unpopulate(val, "ConnectionString", &m.ConnectionString) - 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 MongoDbDatabaseInfo. -func (m MongoDbDatabaseInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type MongoDbDatabaseProgress. -func (m MongoDbDatabaseProgress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - populateTimeRFC3339(objectMap, "lastEventTime", m.LastEventTime) - populateTimeRFC3339(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 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "bytesCopied": - err = unpopulate(val, "BytesCopied", &m.BytesCopied) - delete(rawMsg, key) - 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 = unpopulateTimeRFC3339(val, "LastEventTime", &m.LastEventTime) - delete(rawMsg, key) - case "lastReplayTime": - err = unpopulateTimeRFC3339(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) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MongoDbDatabaseSettings. -func (m MongoDbDatabaseSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "collections", m.Collections) - populate(objectMap, "targetRUs", m.TargetRUs) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MongoDbFinishCommand. -func (m MongoDbFinishCommand) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["commandType"] = "finish" - 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 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) - } - 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 MongoDbMigrationProgress. -func (m MongoDbMigrationProgress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - populateTimeRFC3339(objectMap, "lastEventTime", m.LastEventTime) - populateTimeRFC3339(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 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) - } - 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 = unpopulateTimeRFC3339(val, "LastEventTime", &m.LastEventTime) - delete(rawMsg, key) - case "lastReplayTime": - err = unpopulateTimeRFC3339(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) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MongoDbMigrationSettings. -func (m MongoDbMigrationSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MongoDbProgress. -func (m MongoDbProgress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - populateTimeRFC3339(objectMap, "lastEventTime", m.LastEventTime) - populateTimeRFC3339(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) - return json.Marshal(objectMap) -} - -// 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) - } - 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 = unpopulateTimeRFC3339(val, "LastEventTime", &m.LastEventTime) - delete(rawMsg, key) - case "lastReplayTime": - err = unpopulateTimeRFC3339(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) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MongoDbRestartCommand. -func (m MongoDbRestartCommand) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["commandType"] = "restart" - 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 MongoDbShardKeyInfo. -func (m MongoDbShardKeyInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "fields", m.Fields) - populate(objectMap, "isUnique", m.IsUnique) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MongoDbShardKeySetting. -func (m MongoDbShardKeySetting) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "fields", m.Fields) - populate(objectMap, "isUnique", m.IsUnique) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MySQLConnectionInfo. -func (m MySQLConnectionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - return json.Marshal(objectMap) -} - -// 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) - } - 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) - 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) - 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 -} - -// 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", n, 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 = unpopulateTimeRFC3339(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) - delete(rawMsg, key) - case "startedOn": - err = unpopulateTimeRFC3339(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", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ODataError. -func (o ODataError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", o.Code) - populate(objectMap, "details", o.Details) - populate(objectMap, "message", o.Message) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OracleConnectionInfo. -func (o OracleConnectionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataSource", o.DataSource) - populate(objectMap, "password", o.Password) - objectMap["type"] = "OracleConnectionInfo" - populate(objectMap, "userName", o.UserName) - return json.Marshal(objectMap) -} - -// 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", o, 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) - delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &o.UserName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OracleOCIDriverInfo. -func (o OracleOCIDriverInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type PostgreSQLConnectionInfo. -func (p PostgreSQLConnectionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - return json.Marshal(objectMap) -} - -// 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", p, 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) - delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &p.UserName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Project. -func (p Project) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type ProjectFile. -func (p ProjectFile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type ProjectFileProperties. -func (p ProjectFileProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extension", p.Extension) - populate(objectMap, "filePath", p.FilePath) - populateTimeRFC3339(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 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extension": - err = unpopulate(val, "Extension", &p.Extension) - delete(rawMsg, key) - case "filePath": - err = unpopulate(val, "FilePath", &p.FilePath) - delete(rawMsg, key) - case "lastModified": - err = unpopulateTimeRFC3339(val, "LastModified", &p.LastModified) - delete(rawMsg, key) - case "mediaType": - err = unpopulate(val, "MediaType", &p.MediaType) - delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &p.Size) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProjectProperties. -func (p ProjectProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(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 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "creationTime": - err = unpopulateTimeRFC3339(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", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProjectTask. -func (p ProjectTask) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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 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", p, 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) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProjectTaskProperties. -func (p ProjectTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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 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", p, 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) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &p.Errors) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &p.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &p.TaskType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SQLConnectionInfo. -func (s SQLConnectionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - return json.Marshal(objectMap) -} - -// 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", s, err) - } - 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) - 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 SQLServerSQLMISyncTaskInput. -func (s SQLServerSQLMISyncTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "azureApp", s.AzureApp) - populate(objectMap, "backupFileShare", s.BackupFileShare) - populate(objectMap, "selectedDatabases", s.SelectedDatabases) - populate(objectMap, "sourceConnectionInfo", s.SourceConnectionInfo) - populate(objectMap, "storageResourceId", s.StorageResourceID) - populate(objectMap, "targetConnectionInfo", s.TargetConnectionInfo) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SchemaComparisonValidationResult. -func (s SchemaComparisonValidationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "schemaDifferences", s.SchemaDifferences) - populate(objectMap, "sourceDatabaseObjectCount", s.SourceDatabaseObjectCount) - populate(objectMap, "targetDatabaseObjectCount", s.TargetDatabaseObjectCount) - populate(objectMap, "validationErrors", s.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Service. -func (s Service) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "kind", s.Kind) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(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 SystemData. -func (s *SystemData) 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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type UploadOCIDriverTaskOutput. -func (u UploadOCIDriverTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "driverPackageName", u.DriverPackageName) - populate(objectMap, "validationErrors", u.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type UploadOCIDriverTaskProperties. -func (u UploadOCIDriverTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", u.ClientData) - populate(objectMap, "commands", u.Commands) - populate(objectMap, "errors", u.Errors) - populate(objectMap, "input", u.Input) - populate(objectMap, "output", u.Output) - populate(objectMap, "state", u.State) - objectMap["taskType"] = "Service.Upload.OCI" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UploadOCIDriverTaskProperties. -func (u *UploadOCIDriverTaskProperties) 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", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientData": - err = unpopulate(val, "ClientData", &u.ClientData) - delete(rawMsg, key) - case "commands": - u.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &u.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &u.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &u.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &u.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &u.TaskType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ValidateMigrationInputSQLServerSQLDbSyncTaskProperties. -func (v ValidateMigrationInputSQLServerSQLDbSyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", v.ClientData) - populate(objectMap, "commands", v.Commands) - populate(objectMap, "errors", v.Errors) - populate(objectMap, "input", v.Input) - populate(objectMap, "output", v.Output) - populate(objectMap, "state", v.State) - objectMap["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateMigrationInputSQLServerSQLDbSyncTaskProperties. -func (v *ValidateMigrationInputSQLServerSQLDbSyncTaskProperties) 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", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientData": - err = unpopulate(val, "ClientData", &v.ClientData) - delete(rawMsg, key) - case "commands": - v.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &v.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &v.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &v.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &v.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &v.TaskType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ValidateMigrationInputSQLServerSQLMISyncTaskInput. -func (v ValidateMigrationInputSQLServerSQLMISyncTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "azureApp", v.AzureApp) - populate(objectMap, "backupFileShare", v.BackupFileShare) - populate(objectMap, "selectedDatabases", v.SelectedDatabases) - populate(objectMap, "sourceConnectionInfo", v.SourceConnectionInfo) - populate(objectMap, "storageResourceId", v.StorageResourceID) - populate(objectMap, "targetConnectionInfo", v.TargetConnectionInfo) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ValidateMigrationInputSQLServerSQLMISyncTaskOutput. -func (v ValidateMigrationInputSQLServerSQLMISyncTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "validationErrors", v.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ValidateMigrationInputSQLServerSQLMISyncTaskProperties. -func (v ValidateMigrationInputSQLServerSQLMISyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", v.ClientData) - populate(objectMap, "commands", v.Commands) - populate(objectMap, "errors", v.Errors) - populate(objectMap, "input", v.Input) - populate(objectMap, "output", v.Output) - populate(objectMap, "state", v.State) - objectMap["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateMigrationInputSQLServerSQLMISyncTaskProperties. -func (v *ValidateMigrationInputSQLServerSQLMISyncTaskProperties) 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", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientData": - err = unpopulate(val, "ClientData", &v.ClientData) - delete(rawMsg, key) - case "commands": - v.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &v.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &v.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &v.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &v.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &v.TaskType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ValidateMigrationInputSQLServerSQLMITaskInput. -func (v ValidateMigrationInputSQLServerSQLMITaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupBlobShare", v.BackupBlobShare) - populate(objectMap, "backupFileShare", v.BackupFileShare) - populate(objectMap, "backupMode", v.BackupMode) - populate(objectMap, "selectedDatabases", v.SelectedDatabases) - populate(objectMap, "selectedLogins", v.SelectedLogins) - populate(objectMap, "sourceConnectionInfo", v.SourceConnectionInfo) - populate(objectMap, "targetConnectionInfo", v.TargetConnectionInfo) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ValidateMigrationInputSQLServerSQLMITaskOutput. -func (v ValidateMigrationInputSQLServerSQLMITaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupFolderErrors", v.BackupFolderErrors) - populate(objectMap, "backupShareCredentialsErrors", v.BackupShareCredentialsErrors) - populate(objectMap, "backupStorageAccountErrors", v.BackupStorageAccountErrors) - populate(objectMap, "databaseBackupInfo", v.DatabaseBackupInfo) - populate(objectMap, "existingBackupErrors", v.ExistingBackupErrors) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "restoreDatabaseNameErrors", v.RestoreDatabaseNameErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ValidateMigrationInputSQLServerSQLMITaskProperties. -func (v ValidateMigrationInputSQLServerSQLMITaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", v.ClientData) - populate(objectMap, "commands", v.Commands) - populate(objectMap, "errors", v.Errors) - populate(objectMap, "input", v.Input) - populate(objectMap, "output", v.Output) - populate(objectMap, "state", v.State) - objectMap["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateMigrationInputSQLServerSQLMITaskProperties. -func (v *ValidateMigrationInputSQLServerSQLMITaskProperties) 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", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientData": - err = unpopulate(val, "ClientData", &v.ClientData) - delete(rawMsg, key) - case "commands": - v.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &v.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &v.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &v.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &v.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &v.TaskType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ValidateMongoDbTaskProperties. -func (v ValidateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", v.ClientData) - populate(objectMap, "commands", v.Commands) - populate(objectMap, "errors", v.Errors) - populate(objectMap, "input", v.Input) - populate(objectMap, "output", v.Output) - populate(objectMap, "state", v.State) - objectMap["taskType"] = "Validate.MongoDb" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateMongoDbTaskProperties. -func (v *ValidateMongoDbTaskProperties) 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", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientData": - err = unpopulate(val, "ClientData", &v.ClientData) - delete(rawMsg, key) - case "commands": - v.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &v.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &v.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &v.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &v.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &v.TaskType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ValidateOracleAzureDbForPostgreSQLSyncTaskProperties. -func (v ValidateOracleAzureDbForPostgreSQLSyncTaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientData", v.ClientData) - populate(objectMap, "commands", v.Commands) - populate(objectMap, "errors", v.Errors) - populate(objectMap, "input", v.Input) - populate(objectMap, "output", v.Output) - populate(objectMap, "state", v.State) - objectMap["taskType"] = "Validate.Oracle.AzureDbPostgreSql.Sync" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateOracleAzureDbForPostgreSQLSyncTaskProperties. -func (v *ValidateOracleAzureDbForPostgreSQLSyncTaskProperties) 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", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientData": - err = unpopulate(val, "ClientData", &v.ClientData) - delete(rawMsg, key) - case "commands": - v.Commands, err = unmarshalCommandPropertiesClassificationArray(val) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &v.Errors) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &v.Input) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &v.Output) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &v.State) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &v.TaskType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ValidateOracleAzureDbPostgreSQLSyncTaskOutput. -func (v ValidateOracleAzureDbPostgreSQLSyncTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "validationErrors", v.ValidationErrors) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ValidateSyncMigrationInputSQLServerTaskInput. -func (v ValidateSyncMigrationInputSQLServerTaskInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "selectedDatabases", v.SelectedDatabases) - populate(objectMap, "sourceConnectionInfo", v.SourceConnectionInfo) - populate(objectMap, "targetConnectionInfo", v.TargetConnectionInfo) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ValidateSyncMigrationInputSQLServerTaskOutput. -func (v ValidateSyncMigrationInputSQLServerTaskOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "validationErrors", v.ValidationErrors) - return json.Marshal(objectMap) -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}