diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/CHANGELOG.md b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/CHANGELOG.md
index 37c95b5fb9244..6debeb27c0532 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/CHANGELOG.md
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/CHANGELOG.md
@@ -1,14 +1,1509 @@
# Release History
-## 1.5.0-beta.1 (Unreleased)
+## 1.0.0-beta.1 (2024-11-12)
-### Features Added
+- Azure Resource Manager RecoveryServicesBackup client library for Java. This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-preview-2024-11-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
### Breaking Changes
-### Bugs Fixed
+#### `models.DataSourceType` was removed
+
+#### `models.BackupStatusRequest` was modified
+
+* `withResourceType(models.DataSourceType)` was removed
+* `models.DataSourceType resourceType()` -> `models.DataSourceTypeAutoGenerated2 resourceType()`
+
+#### `models.ProtectedItem` was modified
+
+* `models.DataSourceType workloadType()` -> `models.DataSourceTypeAutoGenerated3 workloadType()`
+
+#### `models.PreValidateEnableBackupRequest` was modified
+
+* `models.DataSourceType resourceType()` -> `models.DataSourceTypeAutoGenerated resourceType()`
+* `withResourceType(models.DataSourceType)` was removed
+
+### Features Added
+
+* `models.AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest` was added
+
+* `models.AzureWorkloadSapAsePointInTimeRestoreRequest` was added
+
+* `models.AzureWorkloadAnyDatabaseRecoveryPoint` was added
+
+* `models.AzureVmWorkloadOracleDatabaseProtectableItem` was added
+
+* `models.AzureVmWorkloadOracleDatabaseProtectedItem` was added
+
+* `models.AzureWorkloadAnyDatabaseRestoreRequest` was added
+
+* `models.AzureWorkloadAnyDatabasePointInTimeRestoreRequest` was added
+
+* `models.AzureVmWorkloadAnyDatabaseProtectedItem` was added
+
+* `models.AzureWorkloadOraclePointInTimeRestoreRequest` was added
+
+* `models.AzureWorkloadSapAseRestoreRequest` was added
+
+* `models.DataSourceTypeAutoGenerated2` was added
+
+* `models.DataSourceTypeAutoGenerated3` was added
+
+* `models.AzureWorkloadOracleRestoreWithRehydrateRequest` was added
+
+* `models.AzureWorkloadSapAsePointInTimeRecoveryPoint` was added
+
+* `models.DataSourceTypeAutoGenerated` was added
+
+* `models.AzureVmWorkloadOracleDatabaseWorkloadItem` was added
+
+* `models.AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest` was added
+
+* `models.AzureWorkloadOracleRecoveryPoint` was added
+
+* `models.AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest` was added
+
+* `models.AzureWorkloadOracleRestoreRequest` was added
+
+* `models.AzureWorkloadSapAsePointInTimeRestoreWithRehydrateRequest` was added
+
+* `models.AzureWorkloadAnyDatabasePointInTimeRecoveryPoint` was added
+
+* `models.VMWorkloadPolicyType` was added
+
+* `models.AzureVmWorkloadAnyDatabaseWorkloadItem` was added
+
+* `models.AzureVmWorkloadSapHanaScaleoutProtectableItem` was added
+
+* `models.UpdateRecoveryPointRequest` was added
+
+* `models.PatchRecoveryPointPropertiesInput` was added
+
+* `models.AzureWorkloadOraclePointInTimeRecoveryPoint` was added
+
+* `models.AzureWorkloadSapAseRecoveryPoint` was added
+
+* `models.AzureVmWorkloadAnyDatabaseProtectableItem` was added
+
+* `models.AzureWorkloadSapAseRestoreWithRehydrateRequest` was added
+
+* `models.PatchRecoveryPointInput` was added
+
+#### `models.AzureWorkloadSqlPointInTimeRecoveryPoint` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.MabJobTaskDetails` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureIaaSClassicComputeVMContainer` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.IaaSvmContainer` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.OperationStatusExtendedInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.TargetRestoreInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.RestoreFileSpecs` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureIaaSComputeVMProtectedItem` was modified
+
+* `healthStatus()` was added
+* `vaultId()` was added
+* `backupManagementType()` was added
+* `workloadType()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `friendlyName()` was added
+* `lastBackupTime()` was added
+* `protectedItemDataId()` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+* `virtualMachineId()` was added
+
+#### `models.AzureWorkloadPointInTimeRecoveryPoint` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureFileShareProvisionIlrRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.RetentionDuration` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVmWorkloadSapHanaHsr` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureWorkloadRecoveryPoint` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.OperationStatusValidateOperationExtendedInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ProtectionIntentResourceList` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureVMAppContainerProtectableContainer` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureVmWorkloadSapHanaSystemWorkloadItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.IaasVMRestoreRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.OperationStatusProvisionIlrExtendedInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureVmWorkloadSapHanaDatabaseWorkloadItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.MabFileFolderProtectedItem` was modified
+
+* `backupManagementType()` was added
+* `workloadType()` was added
+* `vaultId()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.GenericRecoveryPoint` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.IaasVMBackupRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ListRecoveryPointsRecommendedForMoveRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.DpmBackupEngine` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.MabContainerExtendedInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureWorkloadSqlRecoveryPoint` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.RecoveryPoints` was modified
+
+* `updateWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.UpdateRecoveryPointRequest,com.azure.core.util.Context)` was added
+* `update(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.UpdateRecoveryPointRequest)` was added
+
+#### `models.GenericContainerExtendedInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureStorageProtectableContainer` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.NameInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.MoveRPAcrossTiersRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVmWorkloadSapHanaDBInstance` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.FetchTieringCostInfoForRehydrationRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.BackupEngineBase` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.OperationWorkerResponse` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.RestoreRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ProtectableContainer` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.PrepareDataMoveRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureFileShareBackupRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.IdentityInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureVmWorkloadSapHanaDatabaseProtectedItem` was modified
+
+* `vaultId()` was added
+* `workloadType()` was added
+* `protectionStatus()` was added
+* `backupManagementType()` was added
+* `friendlyName()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.LongTermSchedulePolicy` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVmWorkloadSqlInstanceProtectableItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVmWorkloadSqlAvailabilityGroupProtectableItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.YearlyRetentionSchedule` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVmWorkloadSapAseDatabaseProtectedItem` was modified
+
+* `backupManagementType()` was added
+* `workloadType()` was added
+* `protectionStatus()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+* `vaultId()` was added
+* `friendlyName()` was added
+
+#### `models.AzureFileShareProtectableItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.RecoveryPointMoveReadinessInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.PointInTimeRange` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureWorkloadErrorInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureWorkloadSqlRestoreWithRehydrateRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.MabContainer` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.UserAssignedIdentityProperties` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureIaaSvmJobExtendedInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ResourceHealthDetails` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureWorkloadJobTaskDetails` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureIaaSvmErrorInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.BackupResourceVaultConfig` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.GenericProtectionPolicy` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.SqlDataDirectory` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.BackupResourceEncryptionConfig` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ClientDiscoveryForServiceSpecification` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.IaasVMRestoreWithRehydrationRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ValidateOperationRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureWorkloadSapHanaPointInTimeRestoreRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureWorkloadSqlPointInTimeRestoreRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureWorkloadSqlAutoProtectionIntent` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.BackupRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ResourceGuardOperationDetail` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.SubProtectionPolicy` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.DpmContainerExtendedInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.MabJob` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureStorageJobTaskDetails` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureFileShareRestoreRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.KeyAndSecretDetails` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ErrorDetail` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ProtectionContainer` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureWorkloadContainerExtendedInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureWorkloadSapHanaPointInTimeRecoveryPoint` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureIaaSComputeVMProtectableItem` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.MonthlyRetentionSchedule` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.RetentionPolicy` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.TargetDiskNetworkAccessSettings` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.PrivateEndpoint` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.JobResourceList` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureWorkloadSapHanaRestoreWithRehydrateRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.BackupResourceEncryptionConfigExtended` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.MabErrorInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.RecoveryPointResourceList` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.Settings` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureIaaSvmProtectedItem` was modified
+
+* `backupManagementType()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `vaultId()` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+* `workloadType()` was added
+
+#### `models.ContainerIdentityInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureWorkloadContainerAutoProtectionIntent` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.InstantItemRecoveryTarget` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ProtectionPolicy` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ValidateOperationResponse` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ProtectableContainerResourceList` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.DpmErrorInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.InstantRPAdditionalDetails` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.WorkloadItem` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.HourlySchedule` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.VaultJobExtendedInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.RecoveryPointProperties` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureWorkloadJob` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.OperationResultInfoBase` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.DpmProtectedItemExtendedInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureIaaSvmJob` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.FetchTieringCostSavingsInfoForVaultRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureStorageErrorInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ExtendedProperties` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.DailyRetentionFormat` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.SimpleRetentionPolicy` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.BackupStatusRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `withResourceType(models.DataSourceTypeAutoGenerated2)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.WorkloadInquiryDetails` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.DpmJobExtendedInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.WorkloadItemResourceList` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.EncryptionDetails` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.PreBackupValidation` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.UserAssignedManagedIdentityDetails` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureIaaSvmProtectionPolicy` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.LongTermRetentionPolicy` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureVmWorkloadSapAseSystemWorkloadItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.IaasVmilrRegistrationRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.InquiryValidation` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.DpmJobTaskDetails` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.MabFileFolderProtectedItemExtendedInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureSqlProtectedItemExtendedInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.DailyRetentionSchedule` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.RecoveryPointDiskConfiguration` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ResourceGuardProxyBaseResourceList` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.RestoreRequestResource` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+* `type()` was added
+* `id()` was added
+* `name()` was added
+
+#### `models.ProtectedItemResourceList` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.UnlockDeleteRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureSqlProtectionPolicy` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ProtectionContainerResourceList` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ValidateIaasVMRestoreOperationRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureStorageJob` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.WeeklyRetentionSchedule` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.WeeklySchedule` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVmWorkloadSqlDatabaseProtectedItem` was modified
+
+* `vaultId()` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+* `workloadType()` was added
+* `friendlyName()` was added
+* `backupManagementType()` was added
+* `protectionStatus()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.RecoveryPointRehydrationInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.WorkloadProtectableItem` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.SimpleSchedulePolicyV2` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.VaultRetentionPolicy` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureVmWorkloadProtectedItem` was modified
+
+* `vaultId()` was added
+* `backupManagementType()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `workloadType()` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureVmWorkloadItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVmWorkloadSqlInstanceWorkloadItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.IdentityBasedRestoreDetails` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.BackupManagementUsageList` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureVmWorkloadProtectionPolicy` was modified
+
+* `withVmWorkloadPolicyType(models.VMWorkloadPolicyType)` was added
+* `vmWorkloadPolicyType()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.SchedulePolicy` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ProtectionIntent` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ProtectionPolicyResourceList` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureResourceProtectionIntent` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.SecurityPinBase` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.BackupEngineBaseResourceList` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ProtectedItem` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureSqlContainer` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVmWorkloadSapHanaSystemProtectableItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureSqlagWorkloadContainerProtectionContainer` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.RecoveryPointTierInformationV2` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.BackupResourceEncryptionConfigResource` was modified
+
+* `type()` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+* `id()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `name()` was added
+
+#### `models.AzureWorkloadSqlRecoveryPointExtendedInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureIaaSvmJobTaskDetails` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.InquiryInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureVmWorkloadSapAseDatabaseWorkloadItem` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.KekDetails` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.MabJobExtendedInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.TriggerDataMoveRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureWorkloadRestoreRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.VaultJob` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.IlrRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVmWorkloadSqlDatabaseWorkloadItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVmWorkloadProtectableItem` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.SecuredVMDetails` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.GenericContainer` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureVMAppContainerProtectionContainer` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ClientDiscoveryDisplay` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.TieringCostRehydrationInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.IaasVMRecoveryPoint` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ClientDiscoveryForProperties` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.IlrRequestResource` was modified
+
+* `type()` was added
+* `id()` was added
+* `name()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureVmWorkloadSapHanaDBInstanceProtectedItem` was modified
+
+* `workloadType()` was added
+* `friendlyName()` was added
+* `vaultId()` was added
+* `backupManagementType()` was added
+* `protectionStatus()` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.IaaSvmProtectableItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureBackupServerContainer` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureBackupServerEngine` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.DailySchedule` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureIaaSClassicComputeVMProtectableItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ExportJobsOperationResultInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.TieringPolicy` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ValidateOperationRequestResource` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureFileShareRecoveryPoint` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.OperationStatusJobExtendedInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ResourceList` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureWorkloadBackupRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureWorkloadContainer` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ResourceGuardProxyBase` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.FeatureSupportRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ValidateRestoreOperationRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.RecoveryPointTierInformation` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureWorkloadAutoProtectionIntent` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.WorkloadProtectableItemResourceList` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.FetchTieringCostInfoRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.Day` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.DpmJob` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVMResourceFeatureSupportRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.BackupEngineExtendedInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureIaaSvmHealthDetails` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `code()` was added
+* `title()` was added
+* `recommendations()` was added
+* `message()` was added
+
+#### `models.PrivateLinkServiceConnectionState` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.SnapshotRestoreParameters` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureIaaSClassicComputeVMProtectedItem` was modified
+
+* `vaultId()` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+* `healthStatus()` was added
+* `protectedItemDataId()` was added
+* `virtualMachineId()` was added
+* `workloadType()` was added
+* `lastBackupTime()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `backupManagementType()` was added
+* `friendlyName()` was added
+
+#### `models.GenericProtectedItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `backupManagementType()` was added
+* `vaultId()` was added
+* `workloadType()` was added
+
+#### `models.VaultJobErrorInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVmWorkloadProtectedItemExtendedInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureWorkloadSapHanaRecoveryPoint` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.OperationStatusJobsExtendedInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.RecoveryPoint` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.OperationStatusError` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.PrivateEndpointConnection` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureBackupGoalFeatureSupportRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVmWorkloadSqlDatabaseProtectableItem` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.SimpleSchedulePolicy` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.SqlDataDirectoryMapping` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVmWorkloadSapAseSystemProtectableItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ClientScriptForConnect` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.MabProtectionPolicy` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.SnapshotBackupAdditionalDetails` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureFileshareProtectedItem` was modified
+
+* `workloadType()` was added
+* `vaultId()` was added
+* `backupManagementType()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureStorageJobExtendedInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.Job` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.PreValidateEnableBackupRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `withResourceType(models.DataSourceTypeAutoGenerated)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.KpiResourceHealthDetails` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.WeeklyRetentionFormat` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.DistributedNodesInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureWorkloadJobExtendedInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureRecoveryServiceVaultProtectionIntent` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureFileshareProtectedItemExtendedInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureFileShareProtectionPolicy` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.DiskExclusionProperties` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.FetchTieringCostSavingsInfoForProtectedItemRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureSqlProtectedItem` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `backupManagementType()` was added
+* `workloadType()` was added
+* `vaultId()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.BackupRequestResource` was modified
+
+* `type()` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+* `name()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `id()` was added
+
+#### `models.AzureIaaSvmProtectedItemExtendedInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.OperationResultInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ClientDiscoveryForLogSpecification` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureWorkloadSapHanaRestoreRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.LogSchedulePolicy` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ExtendedLocation` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.DiskInformation` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureWorkloadPointInTimeRestoreRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureWorkloadSqlRestoreRequest` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.BekDetails` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureIaaSvmJobV2` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.PrepareDataMoveResponse` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureStorageContainer` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.TieringCostSavingInfo` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.FetchTieringCostSavingsInfoForPolicyRequest` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.MabContainerHealthDetails` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.TargetAfsRestoreInfo` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureIaaSComputeVMContainer` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.ClientDiscoveryResponse` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.DpmContainer` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.BackupResourceConfig` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.DpmProtectedItem` was modified
+
+* `vaultId()` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+* `backupManagementType()` was added
+* `workloadType()` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AzureVmWorkloadSapHanaDatabaseProtectableItem` was modified
-### Other Changes
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
## 1.4.0 (2024-05-23)
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/README.md b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/README.md
index 7509e47d5f71f..6ce21751a0f6f 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/README.md
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/README.md
@@ -2,7 +2,7 @@
Azure Resource Manager RecoveryServicesBackup client library for Java.
-This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-2024-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
+This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-preview-2024-11-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
## We'd love to hear your feedback
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
com.azure.resourcemanager
azure-resourcemanager-recoveryservicesbackup
- 1.4.0
+ 1.5.0-beta.1
```
[//]: # ({x-version-update-end})
@@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen
### Authentication
-By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables.
+Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package.
-- `AZURE_CLIENT_ID` for Azure client ID.
-- `AZURE_TENANT_ID` for Azure tenant ID.
-- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
+Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.
-In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.
-
-With above configuration, `azure` client can be authenticated using the following code:
+Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:
```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
@@ -75,100 +71,77 @@ See [API design][design] for general introduction on design and key concepts on
## Examples
```java
-OffsetDateTime scheduleDateTime = OffsetDateTime.parse(
- OffsetDateTime.now(Clock.systemUTC())
- .withNano(0).withMinute(0).withSecond(0)
- .plusDays(1).format(DateTimeFormatter.ISO_INSTANT));
-
-List lstSubProtectionPolicy = Arrays.asList(
- new SubProtectionPolicy()
- .withPolicyType(PolicyType.FULL)
- .withSchedulePolicy(
- new SimpleSchedulePolicy()
- .withScheduleRunFrequency(ScheduleRunType.WEEKLY)
- .withScheduleRunDays(Arrays.asList(DayOfWeek.SUNDAY, DayOfWeek.TUESDAY))
- .withScheduleRunTimes(Arrays.asList(scheduleDateTime)))
- .withRetentionPolicy(
- new LongTermRetentionPolicy()
- .withWeeklySchedule(
- new WeeklyRetentionSchedule()
- .withDaysOfTheWeek(Arrays.asList(DayOfWeek.SUNDAY, DayOfWeek.TUESDAY))
- .withRetentionTimes(Arrays.asList(scheduleDateTime))
- .withRetentionDuration(
- new RetentionDuration()
- .withCount(2)
+OffsetDateTime scheduleDateTime = OffsetDateTime.parse(OffsetDateTime.now(Clock.systemUTC())
+ .withNano(0)
+ .withMinute(0)
+ .withSecond(0)
+ .plusDays(1)
+ .format(DateTimeFormatter.ISO_INSTANT));
+
+List lstSubProtectionPolicy
+ = Arrays
+ .asList(
+ new SubProtectionPolicy().withPolicyType(PolicyType.FULL)
+ .withSchedulePolicy(
+ new SimpleSchedulePolicy().withScheduleRunFrequency(ScheduleRunType.WEEKLY)
+ .withScheduleRunDays(Arrays.asList(DayOfWeek.SUNDAY, DayOfWeek.TUESDAY))
+ .withScheduleRunTimes(Arrays.asList(scheduleDateTime)))
+ .withRetentionPolicy(
+ new LongTermRetentionPolicy()
+ .withWeeklySchedule(new WeeklyRetentionSchedule()
+ .withDaysOfTheWeek(Arrays.asList(DayOfWeek.SUNDAY, DayOfWeek.TUESDAY))
+ .withRetentionTimes(Arrays.asList(scheduleDateTime))
+ .withRetentionDuration(new RetentionDuration().withCount(2)
.withDurationType(RetentionDurationType.WEEKS)))
- .withMonthlySchedule(
- new MonthlyRetentionSchedule()
- .withRetentionScheduleFormatType(RetentionScheduleFormat.WEEKLY)
- .withRetentionScheduleWeekly(
- new WeeklyRetentionFormat()
+ .withMonthlySchedule(new MonthlyRetentionSchedule()
+ .withRetentionScheduleFormatType(RetentionScheduleFormat.WEEKLY)
+ .withRetentionScheduleWeekly(new WeeklyRetentionFormat()
.withDaysOfTheWeek(Arrays.asList(DayOfWeek.SUNDAY))
.withWeeksOfTheMonth(Arrays.asList(WeekOfMonth.SECOND)))
- .withRetentionTimes(Arrays.asList(scheduleDateTime))
- .withRetentionDuration(
- new RetentionDuration()
+ .withRetentionTimes(Arrays.asList(scheduleDateTime))
+ .withRetentionDuration(new RetentionDuration()
.withCount(1)
.withDurationType(RetentionDurationType.MONTHS)))
- .withYearlySchedule(
- new YearlyRetentionSchedule()
- .withRetentionScheduleFormatType(RetentionScheduleFormat.WEEKLY)
- .withMonthsOfYear(Arrays.asList(MonthOfYear.JANUARY, MonthOfYear.JUNE, MonthOfYear.DECEMBER))
- .withRetentionScheduleWeekly(
- new WeeklyRetentionFormat()
+ .withYearlySchedule(new YearlyRetentionSchedule()
+ .withRetentionScheduleFormatType(RetentionScheduleFormat.WEEKLY)
+ .withMonthsOfYear(
+ Arrays.asList(MonthOfYear.JANUARY, MonthOfYear.JUNE, MonthOfYear.DECEMBER))
+ .withRetentionScheduleWeekly(new WeeklyRetentionFormat()
.withDaysOfTheWeek(Arrays.asList(DayOfWeek.SUNDAY))
.withWeeksOfTheMonth(Arrays.asList(WeekOfMonth.LAST)))
- .withRetentionTimes(Arrays.asList(scheduleDateTime))
- .withRetentionDuration(
- new RetentionDuration()
- .withCount(1)
+ .withRetentionTimes(Arrays.asList(scheduleDateTime))
+ .withRetentionDuration(new RetentionDuration().withCount(1)
.withDurationType(RetentionDurationType.YEARS)))),
- new SubProtectionPolicy()
- .withPolicyType(PolicyType.DIFFERENTIAL)
- .withSchedulePolicy(
- new SimpleSchedulePolicy()
- .withScheduleRunFrequency(ScheduleRunType.WEEKLY)
- .withScheduleRunDays(Arrays.asList(DayOfWeek.FRIDAY))
- .withScheduleRunTimes(Arrays.asList(scheduleDateTime)))
- .withRetentionPolicy(
- new SimpleRetentionPolicy()
- .withRetentionDuration(
- new RetentionDuration()
- .withCount(8)
- .withDurationType(RetentionDurationType.DAYS))),
- new SubProtectionPolicy()
- .withPolicyType(PolicyType.LOG)
- .withSchedulePolicy(new LogSchedulePolicy().withScheduleFrequencyInMins(60))
- .withRetentionPolicy(
- new SimpleRetentionPolicy()
- .withRetentionDuration(
- new RetentionDuration()
- .withCount(7)
- .withDurationType(RetentionDurationType.DAYS))));
+ new SubProtectionPolicy().withPolicyType(PolicyType.DIFFERENTIAL)
+ .withSchedulePolicy(
+ new SimpleSchedulePolicy().withScheduleRunFrequency(ScheduleRunType.WEEKLY)
+ .withScheduleRunDays(Arrays.asList(DayOfWeek.FRIDAY))
+ .withScheduleRunTimes(Arrays.asList(scheduleDateTime)))
+ .withRetentionPolicy(new SimpleRetentionPolicy().withRetentionDuration(
+ new RetentionDuration().withCount(8).withDurationType(RetentionDurationType.DAYS))),
+ new SubProtectionPolicy().withPolicyType(PolicyType.LOG)
+ .withSchedulePolicy(new LogSchedulePolicy().withScheduleFrequencyInMins(60))
+ .withRetentionPolicy(new SimpleRetentionPolicy().withRetentionDuration(
+ new RetentionDuration().withCount(7).withDurationType(RetentionDurationType.DAYS))));
vault = recoveryServicesManager.vaults()
.define(vaultName)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroupName)
.withSku(new Sku().withName(SkuName.RS0).withTier("Standard"))
- .withProperties(new VaultProperties()
- .withPublicNetworkAccess(PublicNetworkAccess.ENABLED)
+ .withProperties(new VaultProperties().withPublicNetworkAccess(PublicNetworkAccess.ENABLED)
.withRestoreSettings(new RestoreSettings()
- .withCrossSubscriptionRestoreSettings(
- new CrossSubscriptionRestoreSettings()
- .withCrossSubscriptionRestoreState(CrossSubscriptionRestoreState.ENABLED))))
+ .withCrossSubscriptionRestoreSettings(new CrossSubscriptionRestoreSettings()
+ .withCrossSubscriptionRestoreState(CrossSubscriptionRestoreState.ENABLED))))
.create();
protectionPolicyResource = recoveryServicesBackupManager.protectionPolicies()
.define(policyName)
.withRegion(REGION)
.withExistingVault(vaultName, resourceGroupName)
- .withProperties(
- new AzureVmWorkloadProtectionPolicy()
- .withWorkLoadType(WorkloadType.SQLDATA_BASE)
- .withSettings(new Settings().withTimeZone("Pacific Standard Time").withIssqlcompression(false))
- .withSubProtectionPolicy(lstSubProtectionPolicy)
- )
+ .withProperties(new AzureVmWorkloadProtectionPolicy().withWorkLoadType(WorkloadType.SQLDATA_BASE)
+ .withSettings(new Settings().withTimeZone("Pacific Standard Time").withIssqlcompression(false))
+ .withSubProtectionPolicy(lstSubProtectionPolicy))
.create();
```
[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/SAMPLE.md)
@@ -194,6 +167,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
[azure_subscription]: https://azure.microsoft.com/free/
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
+[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/SAMPLE.md b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/SAMPLE.md
index 35020655e9fb5..4dbf2ceb9a914 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/SAMPLE.md
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/SAMPLE.md
@@ -193,6 +193,7 @@
- [Get](#recoverypoints_get)
- [List](#recoverypoints_list)
+- [Update](#recoverypoints_update)
## RecoveryPointsRecommendedForMove
@@ -247,7 +248,9 @@
*/
public final class BackupEnginesGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Dpm/BackupEngines_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Dpm/BackupEngines_Get.json
*/
/**
* Sample code: Get Dpm/AzureBackupServer/Lajolla Backup Engine Details.
@@ -270,7 +273,9 @@ public final class BackupEnginesGetSamples {
*/
public final class BackupEnginesListSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Dpm/BackupEngines_List.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Dpm/BackupEngines_List.json
*/
/**
* Sample code: List Dpm/AzureBackupServer/Lajolla Backup Engines.
@@ -292,7 +297,9 @@ public final class BackupEnginesListSamples {
*/
public final class BackupJobsListSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ListJobs.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/ListJobs.json
*/
/**
* Sample code: List All Jobs.
@@ -305,7 +312,9 @@ public final class BackupJobsListSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ListJobsWithAllSupportedFilters.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/ListJobsWithAllSupportedFilters.json
*/
/**
* Sample code: List Jobs With Filters.
@@ -321,7 +330,9 @@ public final class BackupJobsListSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ListJobsWithStartTimeAndEndTimeFilters.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/ListJobsWithStartTimeAndEndTimeFilters.json
*/
/**
* Sample code: List Jobs With Time Filter.
@@ -346,7 +357,9 @@ public final class BackupJobsListSamples {
*/
public final class BackupOperationResultsGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ProtectedItem_Delete_OperationResult.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/ProtectedItem_Delete_OperationResult.json
*/
/**
* Sample code: Get Result for Protected Item Delete Operation.
@@ -370,7 +383,9 @@ public final class BackupOperationResultsGetSamples {
*/
public final class BackupOperationStatusesGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ProtectedItem_Delete_OperationStatus.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/ProtectedItem_Delete_OperationStatus.json
*/
/**
* Sample code: Get Protected Item Delete Operation Status.
@@ -394,7 +409,9 @@ public final class BackupOperationStatusesGetSamples {
*/
public final class BackupPoliciesListSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupPolicies_List.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureWorkload/BackupPolicies_List.json
*/
/**
* Sample code: List protection policies with backupManagementType filter as AzureWorkload.
@@ -409,7 +426,9 @@ public final class BackupPoliciesListSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/V2Policy/v2-List-Policies.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/V2Policy/v2-List-Policies.json
*/
/**
* Sample code: List protection policies with backupManagementType filter as AzureIaasVm with both V1 and V2
@@ -425,7 +444,9 @@ public final class BackupPoliciesListSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/BackupPolicies_List.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/BackupPolicies_List.json
*/
/**
* Sample code: List protection policies with backupManagementType filter as AzureIaasVm.
@@ -449,7 +470,9 @@ public final class BackupPoliciesListSamples {
*/
public final class BackupProtectableItemsListSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/BackupProtectableItems_List.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/BackupProtectableItems_List.json
*/
/**
* Sample code: List protectable items with backupManagementType filter as AzureIaasVm.
@@ -473,7 +496,9 @@ public final class BackupProtectableItemsListSamples {
*/
public final class BackupProtectedItemsListSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/BackupProtectedItems_List.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/BackupProtectedItems_List.json
*/
/**
* Sample code: List protected items with backupManagementType filter as AzureIaasVm.
@@ -497,7 +522,9 @@ public final class BackupProtectedItemsListSamples {
*/
public final class BackupProtectionContainersListSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionContainers_List.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureStorage/ProtectionContainers_List.json
*/
/**
* Sample code: List Backup Protection Containers.
@@ -520,7 +547,9 @@ public final class BackupProtectionContainersListSamples {
*/
public final class BackupProtectionIntentListSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupProtectionIntent_List.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureWorkload/BackupProtectionIntent_List.json
*/
/**
* Sample code: List protection intent with backupManagementType filter.
@@ -542,7 +571,9 @@ public final class BackupProtectionIntentListSamples {
*/
public final class BackupResourceEncryptionConfigsGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupResourceEncryptionConfig_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/BackupResourceEncryptionConfig_Get.json
*/
/**
* Sample code: Get Vault Encryption Configuration.
@@ -570,7 +601,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.InfrastructureEnc
*/
public final class BackupResourceEncryptionConfigsUpdateSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupResourceEncryptionConfig_Put.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/BackupResourceEncryptionConfig_Put.json
*/
/**
* Sample code: Update Vault Encryption Configuration.
@@ -599,7 +632,9 @@ public final class BackupResourceEncryptionConfigsUpdateSamples {
*/
public final class BackupResourceStorageConfigsNonCrrGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupStorageConfig_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/BackupStorageConfig_Get.json
*/
/**
* Sample code: Get Vault Storage Configuration.
@@ -627,7 +662,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.StorageTypeState;
*/
public final class BackupResourceStorageConfigsNonCrrPatchSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupStorageConfig_Patch.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/BackupStorageConfig_Patch.json
*/
/**
* Sample code: Update Vault Storage Configuration.
@@ -659,7 +696,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.StorageTypeState;
*/
public final class BackupResourceStorageConfigsNonCrrUpdateSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupStorageConfig_Put.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/BackupStorageConfig_Put.json
*/
/**
* Sample code: Update Vault Storage Configuration.
@@ -686,7 +725,9 @@ public final class BackupResourceStorageConfigsNonCrrUpdateSamples {
*/
public final class BackupResourceVaultConfigsGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupResourceVaultConfigs_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/BackupResourceVaultConfigs_Get.json
*/
/**
* Sample code: Get Vault Security Config.
@@ -714,7 +755,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.SoftDeleteFeature
*/
public final class BackupResourceVaultConfigsPutSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupResourceVaultConfigs_Put.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/BackupResourceVaultConfigs_Put.json
*/
/**
* Sample code: Update Vault Security Config.
@@ -745,7 +788,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.EnhancedSecurityS
*/
public final class BackupResourceVaultConfigsUpdateSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupResourceVaultConfigs_Patch.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/BackupResourceVaultConfigs_Patch.json
*/
/**
* Sample code: Update Vault Security Config.
@@ -767,14 +812,16 @@ public final class BackupResourceVaultConfigsUpdateSamples {
```java
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatusRequest;
-import com.azure.resourcemanager.recoveryservicesbackup.models.DataSourceType;
+import com.azure.resourcemanager.recoveryservicesbackup.models.DataSourceTypeAutoGenerated2;
/**
* Samples for BackupStatus Get.
*/
public final class BackupStatusGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/GetBackupStatus.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/GetBackupStatus.json
*/
/**
* Sample code: Get Azure Virtual Machine Backup Status.
@@ -784,7 +831,8 @@ public final class BackupStatusGetSamples {
public static void getAzureVirtualMachineBackupStatus(
com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) {
manager.backupStatus()
- .getWithResponse("southeastasia", new BackupStatusRequest().withResourceType(DataSourceType.VM)
+ .getWithResponse("southeastasia", new BackupStatusRequest()
+ .withResourceType(DataSourceTypeAutoGenerated2.VM)
.withResourceId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Compute/VirtualMachines/testVm"),
com.azure.core.util.Context.NONE);
@@ -800,7 +848,9 @@ public final class BackupStatusGetSamples {
*/
public final class BackupUsageSummariesListSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupProtectedItem_UsageSummary_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/BackupProtectedItem_UsageSummary_Get.json
*/
/**
* Sample code: Get Protected Items Usages Summary.
@@ -815,7 +865,9 @@ public final class BackupUsageSummariesListSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupProtectionContainers_UsageSummary_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/BackupProtectionContainers_UsageSummary_Get.json
*/
/**
* Sample code: Get Protected Containers Usages Summary.
@@ -839,7 +891,9 @@ public final class BackupUsageSummariesListSamples {
*/
public final class BackupWorkloadItemsListSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupWorkloadItems_List.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureWorkload/BackupWorkloadItems_List.json
*/
/**
* Sample code: List Workload Items in Container.
@@ -866,7 +920,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.IaasVMBackupReque
*/
public final class BackupsTriggerSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/TriggerBackup_Post.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/TriggerBackup_Post.json
*/
/**
* Sample code: Trigger Backup.
@@ -892,7 +948,9 @@ public final class BackupsTriggerSamples {
*/
public final class BmsPrepareDataMoveOperationResultGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json
*/
/**
* Sample code: Get operation result for PrepareDataMove.
@@ -916,7 +974,9 @@ public final class BmsPrepareDataMoveOperationResultGetSamples {
*/
public final class DeletedProtectionContainersListSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/SoftDeletedContainers_List.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureStorage/SoftDeletedContainers_List.json
*/
/**
* Sample code: List Backup Protection Containers.
@@ -939,7 +999,9 @@ public final class DeletedProtectionContainersListSamples {
*/
public final class ExportJobsOperationResultsGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ExportJobsOperationResult.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/ExportJobsOperationResult.json
*/
/**
* Sample code: Export Jobs Operation Results.
@@ -965,7 +1027,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.AzureVMResourceFe
*/
public final class FeatureSupportValidateSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/BackupFeature_Validate.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/BackupFeature_Validate.json
*/
/**
* Sample code: Check Azure Vm Backup Feature Support.
@@ -997,7 +1061,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.RehydrationPriori
*/
public final class FetchTieringCostPostSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/FetchTieringCostForRehydrate.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/TieringCost/FetchTieringCostForRehydrate.json
*/
/**
* Sample code: Get the rehydration cost for recovery point.
@@ -1018,7 +1084,9 @@ public final class FetchTieringCostPostSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/FetchTieringCostForProtectedItem.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/TieringCost/FetchTieringCostForProtectedItem.json
*/
/**
* Sample code: Get the tiering savings cost info for protected item.
@@ -1038,7 +1106,9 @@ public final class FetchTieringCostPostSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/FetchTieringCostForPolicy.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/TieringCost/FetchTieringCostForPolicy.json
*/
/**
* Sample code: Get the tiering savings cost info for policy.
@@ -1056,7 +1126,9 @@ public final class FetchTieringCostPostSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/FetchTieringCostForVault.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/TieringCost/FetchTieringCostForVault.json
*/
/**
* Sample code: Get the tiering savings cost info for vault.
@@ -1082,7 +1154,9 @@ public final class FetchTieringCostPostSamples {
*/
public final class GetTieringCostOperationResultGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/GetTieringCostOperationResult.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/TieringCost/GetTieringCostOperationResult.json
*/
/**
* Sample code: Fetch Tiering Cost Operation Result.
@@ -1109,7 +1183,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.IlrRequestResourc
*/
public final class ItemLevelRecoveryConnectionsProvisionSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/Provision_Ilr.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/Provision_Ilr.json
*/
/**
* Sample code: Provision Instant Item Level Recovery for Azure Vm.
@@ -1141,7 +1217,9 @@ public final class ItemLevelRecoveryConnectionsProvisionSamples {
*/
public final class ItemLevelRecoveryConnectionsRevokeSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/Revoke_Ilr.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/Revoke_Ilr.json
*/
/**
* Sample code: Revoke Instant Item Level Recovery for Azure Vm.
@@ -1166,7 +1244,9 @@ public final class ItemLevelRecoveryConnectionsRevokeSamples {
*/
public final class JobCancellationsTriggerSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/TriggerCancelJob.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/TriggerCancelJob.json
*/
/**
* Sample code: Cancel Job.
@@ -1190,7 +1270,9 @@ public final class JobCancellationsTriggerSamples {
*/
public final class JobDetailsGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/GetJobDetails.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/GetJobDetails.json
*/
/**
* Sample code: Get Job Details.
@@ -1214,7 +1296,9 @@ public final class JobDetailsGetSamples {
*/
public final class JobOperationResultsGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/CancelJobOperationResult.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/CancelJobOperationResult.json
*/
/**
* Sample code: Cancel Job Operation Result.
@@ -1238,7 +1322,9 @@ public final class JobOperationResultsGetSamples {
*/
public final class JobsExportSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/TriggerExportJobs.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/TriggerExportJobs.json
*/
/**
* Sample code: Export Jobs.
@@ -1268,7 +1354,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperation
*/
public final class OperationOperationValidateSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ValidateOperation_RestoreDisk.json
*/
/**
* Sample code: Validate Operation.
@@ -1298,7 +1386,9 @@ public final class OperationOperationValidateSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk_IdentityBasedRestoreDetails.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ValidateOperation_RestoreDisk_IdentityBasedRestoreDetails.json
*/
/**
* Sample code: Validate Operation with identityBasedRestoreDetails.
@@ -1337,7 +1427,9 @@ public final class OperationOperationValidateSamples {
*/
public final class OperationsListSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListOperations.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/ListOperations.json
*/
/**
* Sample code: ListOperations.
@@ -1359,7 +1451,9 @@ public final class OperationsListSamples {
*/
public final class PrivateEndpointGetOperationStatusSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnectionOperationStatus.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/PrivateEndpointConnection/GetPrivateEndpointConnectionOperationStatus.json
*/
/**
* Sample code: Get OperationStatus.
@@ -1384,7 +1478,9 @@ public final class PrivateEndpointGetOperationStatusSamples {
*/
public final class PrivateEndpointConnectionDeleteSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PrivateEndpointConnection/DeletePrivateEndpointConnection.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/PrivateEndpointConnection/DeletePrivateEndpointConnection.json
*/
/**
* Sample code: Delete PrivateEndpointConnection.
@@ -1408,7 +1504,9 @@ public final class PrivateEndpointConnectionDeleteSamples {
*/
public final class PrivateEndpointConnectionGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnection.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/PrivateEndpointConnection/GetPrivateEndpointConnection.json
*/
/**
* Sample code: Get PrivateEndpointConnection.
@@ -1441,7 +1539,9 @@ import java.util.Arrays;
*/
public final class PrivateEndpointConnectionPutSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PrivateEndpointConnection/PutPrivateEndpointConnection.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/PrivateEndpointConnection/PutPrivateEndpointConnection.json
*/
/**
* Sample code: Update PrivateEndpointConnection.
@@ -1475,7 +1575,9 @@ public final class PrivateEndpointConnectionPutSamples {
*/
public final class ProtectableContainersListSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectableContainers_List.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureStorage/ProtectableContainers_List.json
*/
/**
* Sample code: List protectable items with backupManagementType filter as AzureStorage.
@@ -1500,7 +1602,9 @@ public final class ProtectableContainersListSamples {
*/
public final class ProtectedItemOperationResultsGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectedItemOperationResults.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ProtectedItemOperationResults.json
*/
/**
* Sample code: Get Operation Results of Protected Vm.
@@ -1526,7 +1630,9 @@ public final class ProtectedItemOperationResultsGetSamples {
*/
public final class ProtectedItemOperationStatusesGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectedItemOperationStatus.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ProtectedItemOperationStatus.json
*/
/**
* Sample code: Get Operation Status of Protected Vm.
@@ -1555,7 +1661,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionState;
*/
public final class ProtectedItemsCreateOrUpdateSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/StopProtection.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/StopProtection.json
*/
/**
* Sample code: Stop Protection with retain data on Azure IaasVm.
@@ -1576,7 +1684,9 @@ public final class ProtectedItemsCreateOrUpdateSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ConfigureProtection.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ConfigureProtection.json
*/
/**
* Sample code: Enable Protection on Azure IaasVm.
@@ -1607,7 +1717,9 @@ public final class ProtectedItemsCreateOrUpdateSamples {
*/
public final class ProtectedItemsDeleteSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ProtectedItem_Delete.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/ProtectedItem_Delete.json
*/
/**
* Sample code: Delete Protection from Azure Virtual Machine.
@@ -1632,7 +1744,9 @@ public final class ProtectedItemsDeleteSamples {
*/
public final class ProtectedItemsGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ClassicCompute_ProtectedItem_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ClassicCompute_ProtectedItem_Get.json
*/
/**
* Sample code: Get Protected Classic Virtual Machine Details.
@@ -1648,7 +1762,9 @@ public final class ProtectedItemsGetSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/Compute_ProtectedItem_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/Compute_ProtectedItem_Get.json
*/
/**
* Sample code: Get Protected Virtual Machine Details.
@@ -1673,7 +1789,9 @@ public final class ProtectedItemsGetSamples {
*/
public final class ProtectionContainerOperationResultsGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionContainers_Inquire_Result.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureStorage/ProtectionContainers_Inquire_Result.json
*/
/**
* Sample code: Get Azure Storage Protection Container Operation Result.
@@ -1697,7 +1815,9 @@ public final class ProtectionContainerOperationResultsGetSamples {
*/
public final class ProtectionContainerRefreshOperationResultsGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/RefreshContainers_OperationResults.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/RefreshContainers_OperationResults.json
*/
/**
* Sample code: Azure Vm Discovery Operation Result.
@@ -1721,7 +1841,9 @@ public final class ProtectionContainerRefreshOperationResultsGetSamples {
*/
public final class ProtectionContainersGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/ProtectionContainers_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureWorkload/ProtectionContainers_Get.json
*/
/**
* Sample code: Get Protection Container Details.
@@ -1745,7 +1867,9 @@ public final class ProtectionContainersGetSamples {
*/
public final class ProtectionContainersInquireSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionContainers_Inquire.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureStorage/ProtectionContainers_Inquire.json
*/
/**
* Sample code: Inquire Azure Storage Protection Containers.
@@ -1769,7 +1893,9 @@ public final class ProtectionContainersInquireSamples {
*/
public final class ProtectionContainersRefreshSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/RefreshContainers.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/RefreshContainers.json
*/
/**
* Sample code: Trigger Azure Vm Discovery.
@@ -1796,7 +1922,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementT
*/
public final class ProtectionContainersRegisterSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionContainers_Register.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureStorage/ProtectionContainers_Register.json
*/
/**
* Sample code: RegisterAzure Storage ProtectionContainers.
@@ -1827,7 +1955,9 @@ public final class ProtectionContainersRegisterSamples {
*/
public final class ProtectionContainersUnregisterSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/ProtectionContainers_Unregister.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureWorkload/ProtectionContainers_Unregister.json
*/
/**
* Sample code: Unregister Protection Container.
@@ -1853,7 +1983,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.AzureResourceProt
*/
public final class ProtectionIntentCreateOrUpdateSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionIntent_CreateOrUpdate.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ProtectionIntent_CreateOrUpdate.json
*/
/**
* Sample code: Create or Update Azure Vm Protection Intent.
@@ -1883,7 +2015,9 @@ public final class ProtectionIntentCreateOrUpdateSamples {
*/
public final class ProtectionIntentDeleteSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupProtectionIntent_Delete.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureWorkload/BackupProtectionIntent_Delete.json
*/
/**
* Sample code: Delete Protection intent from item.
@@ -1907,7 +2041,9 @@ public final class ProtectionIntentDeleteSamples {
*/
public final class ProtectionIntentGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupProtectionIntent_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureWorkload/BackupProtectionIntent_Get.json
*/
/**
* Sample code: Get ProtectionIntent for an item.
@@ -1926,7 +2062,7 @@ public final class ProtectionIntentGetSamples {
### ProtectionIntent_Validate
```java
-import com.azure.resourcemanager.recoveryservicesbackup.models.DataSourceType;
+import com.azure.resourcemanager.recoveryservicesbackup.models.DataSourceTypeAutoGenerated;
import com.azure.resourcemanager.recoveryservicesbackup.models.PreValidateEnableBackupRequest;
/**
@@ -1934,7 +2070,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.PreValidateEnable
*/
public final class ProtectionIntentValidateSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionIntent_Validate.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ProtectionIntent_Validate.json
*/
/**
* Sample code: Validate Enable Protection on Azure Vm.
@@ -1945,7 +2083,7 @@ public final class ProtectionIntentValidateSamples {
com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) {
manager.protectionIntents()
.validateWithResponse("southeastasia", new PreValidateEnableBackupRequest()
- .withResourceType(DataSourceType.VM)
+ .withResourceType(DataSourceTypeAutoGenerated.VM)
.withResourceId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arunaupgrade/providers/Microsoft.Compute/VirtualMachines/upgrade1")
.withVaultId(
@@ -1965,12 +2103,12 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.DailyRetentionSch
import com.azure.resourcemanager.recoveryservicesbackup.models.DailySchedule;
import com.azure.resourcemanager.recoveryservicesbackup.models.DayOfWeek;
import com.azure.resourcemanager.recoveryservicesbackup.models.HourlySchedule;
-import com.azure.resourcemanager.recoveryservicesbackup.models.IaasvmPolicyType;
import com.azure.resourcemanager.recoveryservicesbackup.models.IaasVMSnapshotConsistencyType;
+import com.azure.resourcemanager.recoveryservicesbackup.models.IaasvmPolicyType;
import com.azure.resourcemanager.recoveryservicesbackup.models.LogSchedulePolicy;
import com.azure.resourcemanager.recoveryservicesbackup.models.LongTermRetentionPolicy;
-import com.azure.resourcemanager.recoveryservicesbackup.models.MonthlyRetentionSchedule;
import com.azure.resourcemanager.recoveryservicesbackup.models.MonthOfYear;
+import com.azure.resourcemanager.recoveryservicesbackup.models.MonthlyRetentionSchedule;
import com.azure.resourcemanager.recoveryservicesbackup.models.PolicyType;
import com.azure.resourcemanager.recoveryservicesbackup.models.RetentionDuration;
import com.azure.resourcemanager.recoveryservicesbackup.models.RetentionDurationType;
@@ -1982,9 +2120,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.SimpleSchedulePol
import com.azure.resourcemanager.recoveryservicesbackup.models.SimpleSchedulePolicyV2;
import com.azure.resourcemanager.recoveryservicesbackup.models.SubProtectionPolicy;
import com.azure.resourcemanager.recoveryservicesbackup.models.VaultRetentionPolicy;
+import com.azure.resourcemanager.recoveryservicesbackup.models.WeekOfMonth;
import com.azure.resourcemanager.recoveryservicesbackup.models.WeeklyRetentionFormat;
import com.azure.resourcemanager.recoveryservicesbackup.models.WeeklyRetentionSchedule;
-import com.azure.resourcemanager.recoveryservicesbackup.models.WeekOfMonth;
import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadType;
import com.azure.resourcemanager.recoveryservicesbackup.models.YearlyRetentionSchedule;
import java.time.OffsetDateTime;
@@ -1995,7 +2133,9 @@ import java.util.Arrays;
*/
public final class ProtectionPoliciesCreateOrUpdateSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/ProtectionPolicies_CreateOrUpdate_Complex.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureWorkload/ProtectionPolicies_CreateOrUpdate_Complex.json
*/
/**
* Sample code: Create or Update Full Azure Workload Protection Policy.
@@ -2059,7 +2199,9 @@ public final class ProtectionPoliciesCreateOrUpdateSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Simple.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Simple.json
*/
/**
* Sample code: Create or Update Simple Azure Vm Protection Policy.
@@ -2084,7 +2226,9 @@ public final class ProtectionPoliciesCreateOrUpdateSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Daily.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Daily.json
*/
/**
* Sample code: Create or Update Daily Azure Storage Protection Policy.
@@ -2135,7 +2279,9 @@ public final class ProtectionPoliciesCreateOrUpdateSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hardened.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hardened.json
*/
/**
* Sample code: Create or Update Azure Storage Vault Standard Protection Policy.
@@ -2191,7 +2337,9 @@ public final class ProtectionPoliciesCreateOrUpdateSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hourly.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hourly.json
*/
/**
* Sample code: Create or Update Hourly Azure Storage Protection Policy.
@@ -2237,7 +2385,9 @@ public final class ProtectionPoliciesCreateOrUpdateSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Complex.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Complex.json
*/
/**
* Sample code: Create or Update Full Azure Vm Protection Policy.
@@ -2288,7 +2438,9 @@ public final class ProtectionPoliciesCreateOrUpdateSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/V2Policy/IaaS_v2_hourly.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/V2Policy/IaaS_v2_hourly.json
*/
/**
* Sample code: Create or Update Enhanced Azure Vm Protection Policy with Hourly backup.
@@ -2343,7 +2495,9 @@ public final class ProtectionPoliciesCreateOrUpdateSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/V2Policy/IaaS_v2_daily.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/V2Policy/IaaS_v2_daily.json
*/
/**
* Sample code: Create or Update Enhanced Azure Vm Protection Policy with daily backup.
@@ -2406,7 +2560,9 @@ public final class ProtectionPoliciesCreateOrUpdateSamples {
*/
public final class ProtectionPoliciesDeleteSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicies_Delete.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ProtectionPolicies_Delete.json
*/
/**
* Sample code: Delete Azure Vm Protection Policy.
@@ -2429,7 +2585,9 @@ public final class ProtectionPoliciesDeleteSamples {
*/
public final class ProtectionPoliciesGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicies_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ProtectionPolicies_Get.json
*/
/**
* Sample code: Get Azure IaasVm Protection Policy Details.
@@ -2443,7 +2601,9 @@ public final class ProtectionPoliciesGetSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/V2Policy/v2-Get-Policy.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/V2Policy/v2-Get-Policy.json
*/
/**
* Sample code: Get Azure IaasVm Enhanced Protection Policy Details.
@@ -2466,7 +2626,9 @@ public final class ProtectionPoliciesGetSamples {
*/
public final class ProtectionPolicyOperationResultsGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicyOperationResults_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ProtectionPolicyOperationResults_Get.json
*/
/**
* Sample code: Get Protection Policy Operation Results.
@@ -2490,7 +2652,9 @@ public final class ProtectionPolicyOperationResultsGetSamples {
*/
public final class ProtectionPolicyOperationStatusesGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicyOperationStatuses_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ProtectionPolicyOperationStatuses_Get.json
*/
/**
* Sample code: Get Protection Policy Operation Status.
@@ -2514,7 +2678,9 @@ public final class ProtectionPolicyOperationStatusesGetSamples {
*/
public final class RecoveryPointsGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/RecoveryPoints_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/RecoveryPoints_Get.json
*/
/**
* Sample code: Get Azure Vm Recovery Point Details.
@@ -2539,7 +2705,9 @@ public final class RecoveryPointsGetSamples {
*/
public final class RecoveryPointsListSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/RecoveryPoints_List.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/RecoveryPoints_List.json
*/
/**
* Sample code: Get Protected Azure Vm Recovery Points.
@@ -2556,6 +2724,42 @@ public final class RecoveryPointsListSamples {
}
```
+### RecoveryPoints_Update
+
+```java
+import com.azure.resourcemanager.recoveryservicesbackup.models.PatchRecoveryPointInput;
+import com.azure.resourcemanager.recoveryservicesbackup.models.PatchRecoveryPointPropertiesInput;
+import com.azure.resourcemanager.recoveryservicesbackup.models.UpdateRecoveryPointRequest;
+import java.time.OffsetDateTime;
+
+/**
+ * Samples for RecoveryPoints Update.
+ */
+public final class RecoveryPointsUpdateSamples {
+ /*
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/RecoveryPoints_Update.json
+ */
+ /**
+ * Sample code: Update Azure Vm Recovery Point Details.
+ *
+ * @param manager Entry point to RecoveryServicesBackupManager.
+ */
+ public static void updateAzureVmRecoveryPointDetails(
+ com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) {
+ manager.recoveryPoints()
+ .updateWithResponse("hanasnapshottesting", "HanaSnapshotTest", "Azure",
+ "VMAppContainer;compute;hanasnapshottesting;hana-eacan-2", "SAPHanaDatabase;hye;hye",
+ "2265668074516978193",
+ new UpdateRecoveryPointRequest().withProperties(
+ new PatchRecoveryPointInput().withRecoveryPointProperties(new PatchRecoveryPointPropertiesInput()
+ .withExpiryTime(OffsetDateTime.parse("2025-01-02T00:00:00.0000000Z")))),
+ com.azure.core.util.Context.NONE);
+ }
+}
+```
+
### RecoveryPointsRecommendedForMove_List
```java
@@ -2567,7 +2771,9 @@ import java.util.Arrays;
*/
public final class RecoveryPointsRecommendedForMoveListSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/RecoveryPointsRecommendedForMove_List.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/RecoveryPointsRecommendedForMove_List.json
*/
/**
* Sample code: Get Protected Azure Vm Recovery Points Recommended for Move.
@@ -2596,7 +2802,9 @@ public final class RecoveryPointsRecommendedForMoveListSamples {
*/
public final class ResourceGuardProxiesGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json
*/
/**
* Sample code: Get VaultGuardProxies.
@@ -2618,7 +2826,9 @@ public final class ResourceGuardProxiesGetSamples {
*/
public final class ResourceGuardProxyOperationDeleteSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json
*/
/**
* Sample code: Delete ResourceGuardProxy.
@@ -2642,7 +2852,9 @@ public final class ResourceGuardProxyOperationDeleteSamples {
*/
public final class ResourceGuardProxyOperationGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json
*/
/**
* Sample code: Get ResourceGuardProxy.
@@ -2667,7 +2879,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProx
*/
public final class ResourceGuardProxyOperationPutSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json
*/
/**
* Sample code: Create ResourceGuardProxy.
@@ -2698,7 +2912,9 @@ import java.util.Arrays;
*/
public final class ResourceGuardProxyOperationUnlockDeleteSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json
*/
/**
* Sample code: UnlockDelete ResourceGuardProxy.
@@ -2729,7 +2945,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.PrepareDataMoveRe
*/
public final class ResourceProviderBmsPrepareDataMoveSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupDataMove/PrepareDataMove_Post.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/BackupDataMove/PrepareDataMove_Post.json
*/
/**
* Sample code: Prepare Data Move.
@@ -2758,7 +2976,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.TriggerDataMoveRe
*/
public final class ResourceProviderBmsTriggerDataMoveSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupDataMove/TriggerDataMove_Post.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/BackupDataMove/TriggerDataMove_Post.json
*/
/**
* Sample code: Trigger Data Move.
@@ -2786,7 +3006,9 @@ public final class ResourceProviderBmsTriggerDataMoveSamples {
*/
public final class ResourceProviderGetOperationStatusSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json
*/
/**
* Sample code: Get OperationStatus.
@@ -2813,7 +3035,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointTier
*/
public final class ResourceProviderMoveRecoveryPointSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TriggerRecoveryPointMove_Post.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/TriggerRecoveryPointMove_Post.json
*/
/**
* Sample code: Trigger RP Move Operation.
@@ -2848,13 +3072,51 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.RehydrationPriori
import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestResource;
import com.azure.resourcemanager.recoveryservicesbackup.models.TargetDiskNetworkAccessOption;
import com.azure.resourcemanager.recoveryservicesbackup.models.TargetDiskNetworkAccessSettings;
+import java.util.Arrays;
/**
* Samples for Restores Trigger.
*/
public final class RestoresTriggerSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreWithRehydrationRequest.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/TriggerRestore_ResourceGuardEnabled.json
+ */
+ /**
+ * Sample code: Trigger Restore with MUA.
+ *
+ * @param manager Entry point to RecoveryServicesBackupManager.
+ */
+ public static void
+ triggerRestoreWithMUA(com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) {
+ manager.restores()
+ .trigger("testVault", "netsdktestrg", "Azure",
+ "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1",
+ "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334",
+ new RestoreRequestResource().withProperties(new IaasVMRestoreRequest()
+ .withResourceGuardOperationRequests(Arrays.asList(
+ "/subscriptions/063bf7bc-e4dc-4cde-8840-8416fbd7921e/resourcegroups/ankurRG1/providers/Microsoft.DataProtection/resourceGuards/RG341/triggerRestoreRequests/default"))
+ .withRecoveryPointId("348916168024334")
+ .withRecoveryType(RecoveryType.RESTORE_DISKS)
+ .withSourceResourceId(
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1")
+ .withRegion("southeastasia")
+ .withCreateNewCloudService(true)
+ .withOriginalStorageAccountOption(false)
+ .withEncryptionDetails(new EncryptionDetails().withEncryptionEnabled(false))
+ .withIdentityInfo(new IdentityInfo().withIsSystemAssignedIdentity(false)
+ .withManagedIdentityResourceId(
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"))
+ .withIdentityBasedRestoreDetails(new IdentityBasedRestoreDetails().withTargetStorageAccountId(
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"))),
+ com.azure.core.util.Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreWithRehydrationRequest.json
*/
/**
* Sample code: Restore to New Azure IaasVm with IaasVMRestoreWithRehydrationRequest.
@@ -2893,7 +3155,9 @@ public final class RestoresTriggerSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest.json
*/
/**
* Sample code: Restore to New Azure IaasVm with IaasVMRestoreRequest.
@@ -2930,7 +3194,9 @@ public final class RestoresTriggerSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreWithRehydrationRequest.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreWithRehydrationRequest.json
*/
/**
* Sample code: Restore Disks with IaasVMRestoreWithRehydrationRequest.
@@ -2961,7 +3227,9 @@ public final class RestoresTriggerSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json
*/
/**
* Sample code: Restore to New Azure IaasVm with IaasVMRestoreRequest with identityBasedRestoreDetails.
@@ -2998,7 +3266,9 @@ public final class RestoresTriggerSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest.json
*/
/**
* Sample code: Restore Disks with IaasVMRestoreRequest.
@@ -3034,7 +3304,9 @@ public final class RestoresTriggerSamples {
}
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json
*/
/**
* Sample code: Restore Disks with IaasVMRestoreRequest with IdentityBasedRestoreDetails.
@@ -3075,7 +3347,9 @@ public final class RestoresTriggerSamples {
*/
public final class SecurityPINsGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupSecurityPin_Get.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/Common/BackupSecurityPin_Get.json
*/
/**
* Sample code: Get Vault Security Pin.
@@ -3097,7 +3371,9 @@ public final class SecurityPINsGetSamples {
*/
public final class TieringCostOperationStatusGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/GetTieringCostOperationStatus.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/TieringCost/GetTieringCostOperationStatus.json
*/
/**
* Sample code: Fetch Tiering Cost Operation Status.
@@ -3128,7 +3404,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperation
*/
public final class ValidateOperationTriggerSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerValidateOperation_RestoreDisk.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/TriggerValidateOperation_RestoreDisk.json
*/
/**
* Sample code: Trigger Validate Operation.
@@ -3167,7 +3445,9 @@ public final class ValidateOperationTriggerSamples {
*/
public final class ValidateOperationResultsGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ValidateOperationResults.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ValidateOperationResults.json
*/
/**
* Sample code: Get Operation Results of Validate Operation.
@@ -3191,7 +3471,9 @@ public final class ValidateOperationResultsGetSamples {
*/
public final class ValidateOperationStatusesGetSamples {
/*
- * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ValidateOperationStatus.json
+ * x-ms-original-file:
+ * specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/preview/2024-11-01-preview/
+ * examples/AzureIaasVm/ValidateOperationStatus.json
*/
/**
* Sample code: Get Operation Status of Validate Operation.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/pom.xml b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/pom.xml
index 6ac547d6f605a..9002b5d5edaac 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/pom.xml
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/pom.xml
@@ -1,7 +1,7 @@
4.0.0
@@ -18,7 +18,7 @@ Code generated by Microsoft (R) AutoRest Code Generator.
jar
Microsoft Azure SDK for RecoveryServicesBackup Management
- This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-2024-04.
+ This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-preview-2024-11-01.
https://github.com/Azure/azure-sdk-for-java
@@ -46,6 +46,7 @@ Code generated by Microsoft (R) AutoRest Code Generator.
0
0
true
+ false
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java
index c03cd74c053ee..57a5e9bdfad5d 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java
@@ -11,8 +11,8 @@
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
-import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpLogOptions;
+import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
@@ -36,10 +36,10 @@
import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceEncryptionConfigsImpl;
import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceStorageConfigsNonCrrsImpl;
import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceVaultConfigsImpl;
-import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupsImpl;
import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupStatusImpl;
import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupUsageSummariesImpl;
import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupWorkloadItemsImpl;
+import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupsImpl;
import com.azure.resourcemanager.recoveryservicesbackup.implementation.BmsPrepareDataMoveOperationResultsImpl;
import com.azure.resourcemanager.recoveryservicesbackup.implementation.DeletedProtectionContainersImpl;
import com.azure.resourcemanager.recoveryservicesbackup.implementation.ExportJobsOperationResultsImpl;
@@ -76,8 +76,8 @@
import com.azure.resourcemanager.recoveryservicesbackup.implementation.SecurityPINsImpl;
import com.azure.resourcemanager.recoveryservicesbackup.implementation.TieringCostOperationStatusImpl;
import com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationResultsImpl;
-import com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationsImpl;
import com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationStatusesImpl;
+import com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationsImpl;
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngines;
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupJobs;
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupOperationResults;
@@ -90,10 +90,10 @@
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigs;
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceStorageConfigsNonCrrs;
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfigs;
-import com.azure.resourcemanager.recoveryservicesbackup.models.Backups;
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatus;
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupUsageSummaries;
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupWorkloadItems;
+import com.azure.resourcemanager.recoveryservicesbackup.models.Backups;
import com.azure.resourcemanager.recoveryservicesbackup.models.BmsPrepareDataMoveOperationResults;
import com.azure.resourcemanager.recoveryservicesbackup.models.DeletedProtectionContainers;
import com.azure.resourcemanager.recoveryservicesbackup.models.ExportJobsOperationResults;
@@ -129,8 +129,8 @@
import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPINs;
import com.azure.resourcemanager.recoveryservicesbackup.models.TieringCostOperationStatus;
import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationResults;
-import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperations;
import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationStatuses;
+import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperations;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
@@ -415,7 +415,7 @@ public RecoveryServicesBackupManager authenticate(TokenCredential credential, Az
.append("-")
.append("com.azure.resourcemanager.recoveryservicesbackup")
.append("/")
- .append("1.4.0");
+ .append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java
index 22d909dc12302..3efd754cc7793 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java
@@ -10,6 +10,7 @@
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner;
+import com.azure.resourcemanager.recoveryservicesbackup.models.UpdateRecoveryPointRequest;
/**
* An instance of this class provides access to all the operations defined in RecoveryPointsClient.
@@ -91,4 +92,44 @@ Response getWithResponse(String vaultName, String re
@ServiceMethod(returns = ReturnType.SINGLE)
RecoveryPointResourceInner get(String vaultName, String resourceGroupName, String fabricName, String containerName,
String protectedItemName, String recoveryPointId);
+
+ /**
+ * UpdateRecoveryPoint to update recovery point for given RecoveryPointID.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param vaultName The name of the recovery services vault.
+ * @param fabricName Fabric name associated with backed up item.
+ * @param containerName Container name associated with backed up item.
+ * @param protectedItemName Backed up item name whose backup data needs to be fetched.
+ * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return base class for backup copies along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateWithResponse(String resourceGroupName, String vaultName,
+ String fabricName, String containerName, String protectedItemName, String recoveryPointId,
+ UpdateRecoveryPointRequest parameters, Context context);
+
+ /**
+ * UpdateRecoveryPoint to update recovery point for given RecoveryPointID.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param vaultName The name of the recovery services vault.
+ * @param fabricName Fabric name associated with backed up item.
+ * @param containerName Container name associated with backed up item.
+ * @param protectedItemName Backed up item name whose backup data needs to be fetched.
+ * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return base class for backup copies.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RecoveryPointResourceInner update(String resourceGroupName, String vaultName, String fabricName,
+ String containerName, String protectedItemName, String recoveryPointId, UpdateRecoveryPointRequest parameters);
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AzureVMResourceFeatureSupportResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AzureVMResourceFeatureSupportResponseInner.java
index e2daa1dbe6df2..aa91d018d1f1a 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AzureVMResourceFeatureSupportResponseInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AzureVMResourceFeatureSupportResponseInner.java
@@ -5,18 +5,22 @@
package com.azure.resourcemanager.recoveryservicesbackup.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.SupportStatus;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* Response for feature support requests for Azure IaasVm.
*/
@Fluent
-public final class AzureVMResourceFeatureSupportResponseInner {
+public final class AzureVMResourceFeatureSupportResponseInner
+ implements JsonSerializable {
/*
* Support status of feature
*/
- @JsonProperty(value = "supportStatus")
private SupportStatus supportStatus;
/**
@@ -52,4 +56,42 @@ public AzureVMResourceFeatureSupportResponseInner withSupportStatus(SupportStatu
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("supportStatus", this.supportStatus == null ? null : this.supportStatus.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVMResourceFeatureSupportResponseInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVMResourceFeatureSupportResponseInner if the JsonReader was pointing to an instance
+ * of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVMResourceFeatureSupportResponseInner.
+ */
+ public static AzureVMResourceFeatureSupportResponseInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVMResourceFeatureSupportResponseInner deserializedAzureVMResourceFeatureSupportResponseInner
+ = new AzureVMResourceFeatureSupportResponseInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("supportStatus".equals(fieldName)) {
+ deserializedAzureVMResourceFeatureSupportResponseInner.supportStatus
+ = SupportStatus.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVMResourceFeatureSupportResponseInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupEngineBaseResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupEngineBaseResourceInner.java
index bc070238f517e..20f1fcdaa4ec2 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupEngineBaseResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupEngineBaseResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngineBase;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class BackupEngineBaseResourceInner extends Resource {
/*
* BackupEngineBaseResource properties
*/
- @JsonProperty(value = "properties")
private BackupEngineBase properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of BackupEngineBaseResourceInner class.
*/
@@ -73,6 +89,36 @@ public BackupEngineBaseResourceInner withEtag(String etag) {
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,58 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of BackupEngineBaseResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of BackupEngineBaseResourceInner if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the BackupEngineBaseResourceInner.
+ */
+ public static BackupEngineBaseResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ BackupEngineBaseResourceInner deserializedBackupEngineBaseResourceInner
+ = new BackupEngineBaseResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedBackupEngineBaseResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedBackupEngineBaseResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedBackupEngineBaseResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedBackupEngineBaseResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedBackupEngineBaseResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedBackupEngineBaseResourceInner.properties = BackupEngineBase.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedBackupEngineBaseResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedBackupEngineBaseResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupManagementUsageInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupManagementUsageInner.java
index d3021d58d84aa..243febb2cb24b 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupManagementUsageInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupManagementUsageInner.java
@@ -5,50 +5,50 @@
package com.azure.resourcemanager.recoveryservicesbackup.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.NameInfo;
import com.azure.resourcemanager.recoveryservicesbackup.models.UsagesUnit;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
/**
* Backup management usages of a vault.
*/
@Fluent
-public final class BackupManagementUsageInner {
+public final class BackupManagementUsageInner implements JsonSerializable {
/*
* Unit of the usage.
*/
- @JsonProperty(value = "unit")
private UsagesUnit unit;
/*
* Quota period of usage.
*/
- @JsonProperty(value = "quotaPeriod")
private String quotaPeriod;
/*
* Next reset time of usage.
*/
- @JsonProperty(value = "nextResetTime")
private OffsetDateTime nextResetTime;
/*
* Current value of usage.
*/
- @JsonProperty(value = "currentValue")
private Long currentValue;
/*
* Limit of usage.
*/
- @JsonProperty(value = "limit")
private Long limit;
/*
* Name of usage.
*/
- @JsonProperty(value = "name")
private NameInfo name;
/**
@@ -187,4 +187,57 @@ public void validate() {
name().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString());
+ jsonWriter.writeStringField("quotaPeriod", this.quotaPeriod);
+ jsonWriter.writeStringField("nextResetTime",
+ this.nextResetTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.nextResetTime));
+ jsonWriter.writeNumberField("currentValue", this.currentValue);
+ jsonWriter.writeNumberField("limit", this.limit);
+ jsonWriter.writeJsonField("name", this.name);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of BackupManagementUsageInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of BackupManagementUsageInner if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the BackupManagementUsageInner.
+ */
+ public static BackupManagementUsageInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ BackupManagementUsageInner deserializedBackupManagementUsageInner = new BackupManagementUsageInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("unit".equals(fieldName)) {
+ deserializedBackupManagementUsageInner.unit = UsagesUnit.fromString(reader.getString());
+ } else if ("quotaPeriod".equals(fieldName)) {
+ deserializedBackupManagementUsageInner.quotaPeriod = reader.getString();
+ } else if ("nextResetTime".equals(fieldName)) {
+ deserializedBackupManagementUsageInner.nextResetTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("currentValue".equals(fieldName)) {
+ deserializedBackupManagementUsageInner.currentValue = reader.getNullable(JsonReader::getLong);
+ } else if ("limit".equals(fieldName)) {
+ deserializedBackupManagementUsageInner.limit = reader.getNullable(JsonReader::getLong);
+ } else if ("name".equals(fieldName)) {
+ deserializedBackupManagementUsageInner.name = NameInfo.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedBackupManagementUsageInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceConfigResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceConfigResourceInner.java
index 75040f022a409..7a6590061db49 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceConfigResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceConfigResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceConfig;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class BackupResourceConfigResourceInner extends Resource {
/*
* BackupResourceConfigResource properties
*/
- @JsonProperty(value = "properties")
private BackupResourceConfig properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of BackupResourceConfigResourceInner class.
*/
@@ -73,6 +89,36 @@ public BackupResourceConfigResourceInner withEtag(String etag) {
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,58 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of BackupResourceConfigResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of BackupResourceConfigResourceInner if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the BackupResourceConfigResourceInner.
+ */
+ public static BackupResourceConfigResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ BackupResourceConfigResourceInner deserializedBackupResourceConfigResourceInner
+ = new BackupResourceConfigResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedBackupResourceConfigResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedBackupResourceConfigResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedBackupResourceConfigResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedBackupResourceConfigResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedBackupResourceConfigResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedBackupResourceConfigResourceInner.properties = BackupResourceConfig.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedBackupResourceConfigResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedBackupResourceConfigResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigExtendedResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigExtendedResourceInner.java
index 288123f4d123a..35c88d48cb76b 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigExtendedResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigExtendedResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigExtended;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class BackupResourceEncryptionConfigExtendedResourceInner extends R
/*
* BackupResourceEncryptionConfigExtendedResource properties
*/
- @JsonProperty(value = "properties")
private BackupResourceEncryptionConfigExtended properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of BackupResourceEncryptionConfigExtendedResourceInner class.
*/
@@ -74,6 +90,36 @@ public BackupResourceEncryptionConfigExtendedResourceInner withEtag(String etag)
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -102,4 +148,60 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of BackupResourceEncryptionConfigExtendedResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of BackupResourceEncryptionConfigExtendedResourceInner if the JsonReader was pointing to an
+ * instance of it, or null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the BackupResourceEncryptionConfigExtendedResourceInner.
+ */
+ public static BackupResourceEncryptionConfigExtendedResourceInner fromJson(JsonReader jsonReader)
+ throws IOException {
+ return jsonReader.readObject(reader -> {
+ BackupResourceEncryptionConfigExtendedResourceInner deserializedBackupResourceEncryptionConfigExtendedResourceInner
+ = new BackupResourceEncryptionConfigExtendedResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedBackupResourceEncryptionConfigExtendedResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedBackupResourceEncryptionConfigExtendedResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedBackupResourceEncryptionConfigExtendedResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedBackupResourceEncryptionConfigExtendedResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedBackupResourceEncryptionConfigExtendedResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedBackupResourceEncryptionConfigExtendedResourceInner.properties
+ = BackupResourceEncryptionConfigExtended.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedBackupResourceEncryptionConfigExtendedResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedBackupResourceEncryptionConfigExtendedResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceVaultConfigResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceVaultConfigResourceInner.java
index 536be11b951d3..7c7b29803cb23 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceVaultConfigResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceVaultConfigResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfig;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class BackupResourceVaultConfigResourceInner extends Resource {
/*
* BackupResourceVaultConfigResource properties
*/
- @JsonProperty(value = "properties")
private BackupResourceVaultConfig properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of BackupResourceVaultConfigResourceInner class.
*/
@@ -73,6 +89,36 @@ public BackupResourceVaultConfigResourceInner withEtag(String etag) {
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,59 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of BackupResourceVaultConfigResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of BackupResourceVaultConfigResourceInner if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the BackupResourceVaultConfigResourceInner.
+ */
+ public static BackupResourceVaultConfigResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ BackupResourceVaultConfigResourceInner deserializedBackupResourceVaultConfigResourceInner
+ = new BackupResourceVaultConfigResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedBackupResourceVaultConfigResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedBackupResourceVaultConfigResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedBackupResourceVaultConfigResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedBackupResourceVaultConfigResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedBackupResourceVaultConfigResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedBackupResourceVaultConfigResourceInner.properties
+ = BackupResourceVaultConfig.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedBackupResourceVaultConfigResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedBackupResourceVaultConfigResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupStatusResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupStatusResponseInner.java
index ed04a300f9047..fe64909171912 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupStatusResponseInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupStatusResponseInner.java
@@ -5,80 +5,73 @@
package com.azure.resourcemanager.recoveryservicesbackup.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.AcquireStorageAccountLock;
import com.azure.resourcemanager.recoveryservicesbackup.models.FabricName;
import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionStatus;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* BackupStatus response.
*/
@Fluent
-public final class BackupStatusResponseInner {
+public final class BackupStatusResponseInner implements JsonSerializable {
/*
* Specifies whether the container is registered or not
*/
- @JsonProperty(value = "protectionStatus")
private ProtectionStatus protectionStatus;
/*
* Specifies the arm resource id of the vault
*/
- @JsonProperty(value = "vaultId")
private String vaultId;
/*
* Specifies the fabric name - Azure or AD
*/
- @JsonProperty(value = "fabricName")
private FabricName fabricName;
/*
* Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname.
*/
- @JsonProperty(value = "containerName")
private String containerName;
/*
* Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname.
*/
- @JsonProperty(value = "protectedItemName")
private String protectedItemName;
/*
* ErrorCode in case of intent failed
*/
- @JsonProperty(value = "errorCode")
private String errorCode;
/*
* ErrorMessage in case of intent failed.
*/
- @JsonProperty(value = "errorMessage")
private String errorMessage;
/*
* Specifies the policy name which is used for protection
*/
- @JsonProperty(value = "policyName")
private String policyName;
/*
* Container registration status
*/
- @JsonProperty(value = "registrationStatus")
private String registrationStatus;
/*
* Number of protected items
*/
- @JsonProperty(value = "protectedItemsCount")
private Integer protectedItemsCount;
/*
* Specifies whether the storage account lock has been acquired or not
*/
- @JsonProperty(value = "acquireStorageAccountLock")
private AcquireStorageAccountLock acquireStorageAccountLock;
/**
@@ -319,4 +312,74 @@ public AcquireStorageAccountLock acquireStorageAccountLock() {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("protectionStatus",
+ this.protectionStatus == null ? null : this.protectionStatus.toString());
+ jsonWriter.writeStringField("vaultId", this.vaultId);
+ jsonWriter.writeStringField("fabricName", this.fabricName == null ? null : this.fabricName.toString());
+ jsonWriter.writeStringField("containerName", this.containerName);
+ jsonWriter.writeStringField("protectedItemName", this.protectedItemName);
+ jsonWriter.writeStringField("errorCode", this.errorCode);
+ jsonWriter.writeStringField("errorMessage", this.errorMessage);
+ jsonWriter.writeStringField("policyName", this.policyName);
+ jsonWriter.writeStringField("registrationStatus", this.registrationStatus);
+ jsonWriter.writeNumberField("protectedItemsCount", this.protectedItemsCount);
+ jsonWriter.writeStringField("acquireStorageAccountLock",
+ this.acquireStorageAccountLock == null ? null : this.acquireStorageAccountLock.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of BackupStatusResponseInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of BackupStatusResponseInner if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the BackupStatusResponseInner.
+ */
+ public static BackupStatusResponseInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ BackupStatusResponseInner deserializedBackupStatusResponseInner = new BackupStatusResponseInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("protectionStatus".equals(fieldName)) {
+ deserializedBackupStatusResponseInner.protectionStatus
+ = ProtectionStatus.fromString(reader.getString());
+ } else if ("vaultId".equals(fieldName)) {
+ deserializedBackupStatusResponseInner.vaultId = reader.getString();
+ } else if ("fabricName".equals(fieldName)) {
+ deserializedBackupStatusResponseInner.fabricName = FabricName.fromString(reader.getString());
+ } else if ("containerName".equals(fieldName)) {
+ deserializedBackupStatusResponseInner.containerName = reader.getString();
+ } else if ("protectedItemName".equals(fieldName)) {
+ deserializedBackupStatusResponseInner.protectedItemName = reader.getString();
+ } else if ("errorCode".equals(fieldName)) {
+ deserializedBackupStatusResponseInner.errorCode = reader.getString();
+ } else if ("errorMessage".equals(fieldName)) {
+ deserializedBackupStatusResponseInner.errorMessage = reader.getString();
+ } else if ("policyName".equals(fieldName)) {
+ deserializedBackupStatusResponseInner.policyName = reader.getString();
+ } else if ("registrationStatus".equals(fieldName)) {
+ deserializedBackupStatusResponseInner.registrationStatus = reader.getString();
+ } else if ("protectedItemsCount".equals(fieldName)) {
+ deserializedBackupStatusResponseInner.protectedItemsCount = reader.getNullable(JsonReader::getInt);
+ } else if ("acquireStorageAccountLock".equals(fieldName)) {
+ deserializedBackupStatusResponseInner.acquireStorageAccountLock
+ = AcquireStorageAccountLock.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedBackupStatusResponseInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ClientDiscoveryValueForSingleApiInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ClientDiscoveryValueForSingleApiInner.java
index 1a0dba677e60d..b27e4331ff9bf 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ClientDiscoveryValueForSingleApiInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ClientDiscoveryValueForSingleApiInner.java
@@ -5,37 +5,38 @@
package com.azure.resourcemanager.recoveryservicesbackup.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryDisplay;
import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryForProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* Available operation details.
*/
@Fluent
-public final class ClientDiscoveryValueForSingleApiInner {
+public final class ClientDiscoveryValueForSingleApiInner
+ implements JsonSerializable {
/*
* Name of the Operation.
*/
- @JsonProperty(value = "name")
private String name;
/*
* Contains the localized display information for this particular operation
*/
- @JsonProperty(value = "display")
private ClientDiscoveryDisplay display;
/*
* The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX
*/
- @JsonProperty(value = "origin")
private String origin;
/*
* ShoeBox properties for the given operation.
*/
- @JsonProperty(value = "properties")
private ClientDiscoveryForProperties properties;
/**
@@ -139,4 +140,51 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("name", this.name);
+ jsonWriter.writeJsonField("display", this.display);
+ jsonWriter.writeStringField("origin", this.origin);
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ClientDiscoveryValueForSingleApiInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ClientDiscoveryValueForSingleApiInner if the JsonReader was pointing to an instance of it,
+ * or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the ClientDiscoveryValueForSingleApiInner.
+ */
+ public static ClientDiscoveryValueForSingleApiInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ClientDiscoveryValueForSingleApiInner deserializedClientDiscoveryValueForSingleApiInner
+ = new ClientDiscoveryValueForSingleApiInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("name".equals(fieldName)) {
+ deserializedClientDiscoveryValueForSingleApiInner.name = reader.getString();
+ } else if ("display".equals(fieldName)) {
+ deserializedClientDiscoveryValueForSingleApiInner.display = ClientDiscoveryDisplay.fromJson(reader);
+ } else if ("origin".equals(fieldName)) {
+ deserializedClientDiscoveryValueForSingleApiInner.origin = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedClientDiscoveryValueForSingleApiInner.properties
+ = ClientDiscoveryForProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedClientDiscoveryValueForSingleApiInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/JobResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/JobResourceInner.java
index 447b7f6fd1233..f270ac4dbe135 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/JobResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/JobResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.Job;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class JobResourceInner extends Resource {
/*
* JobResource properties
*/
- @JsonProperty(value = "properties")
private Job properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of JobResourceInner class.
*/
@@ -73,6 +89,36 @@ public JobResourceInner withEtag(String etag) {
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,57 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of JobResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of JobResourceInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the JobResourceInner.
+ */
+ public static JobResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ JobResourceInner deserializedJobResourceInner = new JobResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedJobResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedJobResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedJobResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedJobResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedJobResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedJobResourceInner.properties = Job.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedJobResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedJobResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationResultInfoBaseResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationResultInfoBaseResourceInner.java
index 81894ddccb587..bacc0dcec57a6 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationResultInfoBaseResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationResultInfoBaseResourceInner.java
@@ -5,10 +5,13 @@
package com.azure.resourcemanager.recoveryservicesbackup.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.HttpStatusCode;
import com.azure.resourcemanager.recoveryservicesbackup.models.OperationResultInfoBase;
import com.azure.resourcemanager.recoveryservicesbackup.models.OperationWorkerResponse;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -20,7 +23,6 @@ public final class OperationResultInfoBaseResourceInner extends OperationWorkerR
/*
* OperationResultInfoBaseResource operation
*/
- @JsonProperty(value = "operation")
private OperationResultInfoBase operation;
/**
@@ -74,9 +76,56 @@ public OperationResultInfoBaseResourceInner withHeaders(Map
*/
@Override
public void validate() {
- super.validate();
if (operation() != null) {
operation().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("statusCode", statusCode() == null ? null : statusCode().toString());
+ jsonWriter.writeMapField("headers", headers(),
+ (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1)));
+ jsonWriter.writeJsonField("operation", this.operation);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationResultInfoBaseResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationResultInfoBaseResourceInner if the JsonReader was pointing to an instance of it,
+ * or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the OperationResultInfoBaseResourceInner.
+ */
+ public static OperationResultInfoBaseResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationResultInfoBaseResourceInner deserializedOperationResultInfoBaseResourceInner
+ = new OperationResultInfoBaseResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("statusCode".equals(fieldName)) {
+ deserializedOperationResultInfoBaseResourceInner
+ .withStatusCode(HttpStatusCode.fromString(reader.getString()));
+ } else if ("headers".equals(fieldName)) {
+ Map> headers
+ = reader.readMap(reader1 -> reader1.readArray(reader2 -> reader2.getString()));
+ deserializedOperationResultInfoBaseResourceInner.withHeaders(headers);
+ } else if ("operation".equals(fieldName)) {
+ deserializedOperationResultInfoBaseResourceInner.operation
+ = OperationResultInfoBase.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationResultInfoBaseResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationStatusInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationStatusInner.java
index b385c22733eae..a4d748ee05a8a 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationStatusInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationStatusInner.java
@@ -5,57 +5,56 @@
package com.azure.resourcemanager.recoveryservicesbackup.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusError;
import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusExtendedInfo;
import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusValues;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
/**
* Operation status.
*/
@Fluent
-public final class OperationStatusInner {
+public final class OperationStatusInner implements JsonSerializable {
/*
* ID of the operation.
*/
- @JsonProperty(value = "id")
private String id;
/*
* Name of the operation.
*/
- @JsonProperty(value = "name")
private String name;
/*
* Operation status.
*/
- @JsonProperty(value = "status")
private OperationStatusValues status;
/*
* Operation start time. Format: ISO-8601.
*/
- @JsonProperty(value = "startTime")
private OffsetDateTime startTime;
/*
* Operation end time. Format: ISO-8601.
*/
- @JsonProperty(value = "endTime")
private OffsetDateTime endTime;
/*
* Error information related to this operation.
*/
- @JsonProperty(value = "error")
private OperationStatusError error;
/*
* Additional information associated with this operation.
*/
- @JsonProperty(value = "properties")
private OperationStatusExtendedInfo properties;
/**
@@ -217,4 +216,62 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("id", this.id);
+ jsonWriter.writeStringField("name", this.name);
+ jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString());
+ jsonWriter.writeStringField("startTime",
+ this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime));
+ jsonWriter.writeStringField("endTime",
+ this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime));
+ jsonWriter.writeJsonField("error", this.error);
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationStatusInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationStatusInner if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the OperationStatusInner.
+ */
+ public static OperationStatusInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationStatusInner deserializedOperationStatusInner = new OperationStatusInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedOperationStatusInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedOperationStatusInner.name = reader.getString();
+ } else if ("status".equals(fieldName)) {
+ deserializedOperationStatusInner.status = OperationStatusValues.fromString(reader.getString());
+ } else if ("startTime".equals(fieldName)) {
+ deserializedOperationStatusInner.startTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("endTime".equals(fieldName)) {
+ deserializedOperationStatusInner.endTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("error".equals(fieldName)) {
+ deserializedOperationStatusInner.error = OperationStatusError.fromJson(reader);
+ } else if ("properties".equals(fieldName)) {
+ deserializedOperationStatusInner.properties = OperationStatusExtendedInfo.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationStatusInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PreValidateEnableBackupResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PreValidateEnableBackupResponseInner.java
index 06c4e8747583a..e2054e1bf868f 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PreValidateEnableBackupResponseInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PreValidateEnableBackupResponseInner.java
@@ -5,49 +5,49 @@
package com.azure.resourcemanager.recoveryservicesbackup.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.ValidationStatus;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* Response contract for enable backup validation request.
*/
@Fluent
-public final class PreValidateEnableBackupResponseInner {
+public final class PreValidateEnableBackupResponseInner
+ implements JsonSerializable {
/*
* Validation Status
*/
- @JsonProperty(value = "status")
private ValidationStatus status;
/*
* Response error code
*/
- @JsonProperty(value = "errorCode")
private String errorCode;
/*
* Response error message
*/
- @JsonProperty(value = "errorMessage")
private String errorMessage;
/*
* Recommended action for user
*/
- @JsonProperty(value = "recommendation")
private String recommendation;
/*
- * Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required
+ * Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is
+ * required
* for portal
*/
- @JsonProperty(value = "containerName")
private String containerName;
/*
* Specifies the product specific ds name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for portal
*/
- @JsonProperty(value = "protectedItemName")
private String protectedItemName;
/**
@@ -189,4 +189,57 @@ public PreValidateEnableBackupResponseInner withProtectedItemName(String protect
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString());
+ jsonWriter.writeStringField("errorCode", this.errorCode);
+ jsonWriter.writeStringField("errorMessage", this.errorMessage);
+ jsonWriter.writeStringField("recommendation", this.recommendation);
+ jsonWriter.writeStringField("containerName", this.containerName);
+ jsonWriter.writeStringField("protectedItemName", this.protectedItemName);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PreValidateEnableBackupResponseInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PreValidateEnableBackupResponseInner if the JsonReader was pointing to an instance of it,
+ * or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the PreValidateEnableBackupResponseInner.
+ */
+ public static PreValidateEnableBackupResponseInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PreValidateEnableBackupResponseInner deserializedPreValidateEnableBackupResponseInner
+ = new PreValidateEnableBackupResponseInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("status".equals(fieldName)) {
+ deserializedPreValidateEnableBackupResponseInner.status
+ = ValidationStatus.fromString(reader.getString());
+ } else if ("errorCode".equals(fieldName)) {
+ deserializedPreValidateEnableBackupResponseInner.errorCode = reader.getString();
+ } else if ("errorMessage".equals(fieldName)) {
+ deserializedPreValidateEnableBackupResponseInner.errorMessage = reader.getString();
+ } else if ("recommendation".equals(fieldName)) {
+ deserializedPreValidateEnableBackupResponseInner.recommendation = reader.getString();
+ } else if ("containerName".equals(fieldName)) {
+ deserializedPreValidateEnableBackupResponseInner.containerName = reader.getString();
+ } else if ("protectedItemName".equals(fieldName)) {
+ deserializedPreValidateEnableBackupResponseInner.protectedItemName = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPreValidateEnableBackupResponseInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PrivateEndpointConnectionResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PrivateEndpointConnectionResourceInner.java
index 8ac62a25af21b..7e13904804f03 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PrivateEndpointConnectionResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PrivateEndpointConnectionResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnection;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class PrivateEndpointConnectionResourceInner extends Resource {
/*
* PrivateEndpointConnectionResource properties
*/
- @JsonProperty(value = "properties")
private PrivateEndpointConnection properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of PrivateEndpointConnectionResourceInner class.
*/
@@ -73,6 +89,36 @@ public PrivateEndpointConnectionResourceInner withEtag(String etag) {
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,59 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PrivateEndpointConnectionResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PrivateEndpointConnectionResourceInner if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the PrivateEndpointConnectionResourceInner.
+ */
+ public static PrivateEndpointConnectionResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PrivateEndpointConnectionResourceInner deserializedPrivateEndpointConnectionResourceInner
+ = new PrivateEndpointConnectionResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedPrivateEndpointConnectionResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedPrivateEndpointConnectionResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedPrivateEndpointConnectionResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedPrivateEndpointConnectionResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedPrivateEndpointConnectionResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedPrivateEndpointConnectionResourceInner.properties
+ = PrivateEndpointConnection.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedPrivateEndpointConnectionResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPrivateEndpointConnectionResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectableContainerResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectableContainerResourceInner.java
index b8138f96d9dee..ae6416a440410 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectableContainerResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectableContainerResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainer;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class ProtectableContainerResourceInner extends Resource {
/*
* ProtectableContainerResource properties
*/
- @JsonProperty(value = "properties")
private ProtectableContainer properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of ProtectableContainerResourceInner class.
*/
@@ -73,6 +89,36 @@ public ProtectableContainerResourceInner withEtag(String etag) {
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,58 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ProtectableContainerResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ProtectableContainerResourceInner if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ProtectableContainerResourceInner.
+ */
+ public static ProtectableContainerResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ProtectableContainerResourceInner deserializedProtectableContainerResourceInner
+ = new ProtectableContainerResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedProtectableContainerResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedProtectableContainerResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedProtectableContainerResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedProtectableContainerResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedProtectableContainerResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedProtectableContainerResourceInner.properties = ProtectableContainer.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedProtectableContainerResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedProtectableContainerResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectedItemResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectedItemResourceInner.java
index d6c2455da75a3..42f943c659c7c 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectedItemResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectedItemResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItem;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class ProtectedItemResourceInner extends Resource {
/*
* ProtectedItemResource properties
*/
- @JsonProperty(value = "properties")
private ProtectedItem properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of ProtectedItemResourceInner class.
*/
@@ -73,6 +89,36 @@ public ProtectedItemResourceInner withEtag(String etag) {
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,57 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ProtectedItemResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ProtectedItemResourceInner if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ProtectedItemResourceInner.
+ */
+ public static ProtectedItemResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ProtectedItemResourceInner deserializedProtectedItemResourceInner = new ProtectedItemResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedProtectedItemResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedProtectedItemResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedProtectedItemResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedProtectedItemResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedProtectedItemResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedProtectedItemResourceInner.properties = ProtectedItem.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedProtectedItemResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedProtectedItemResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionContainerResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionContainerResourceInner.java
index b1ce44d6c063d..128477b680158 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionContainerResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionContainerResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainer;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class ProtectionContainerResourceInner extends Resource {
/*
* ProtectionContainerResource properties
*/
- @JsonProperty(value = "properties")
private ProtectionContainer properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of ProtectionContainerResourceInner class.
*/
@@ -73,6 +89,36 @@ public ProtectionContainerResourceInner withEtag(String etag) {
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,58 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ProtectionContainerResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ProtectionContainerResourceInner if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ProtectionContainerResourceInner.
+ */
+ public static ProtectionContainerResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ProtectionContainerResourceInner deserializedProtectionContainerResourceInner
+ = new ProtectionContainerResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedProtectionContainerResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedProtectionContainerResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedProtectionContainerResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedProtectionContainerResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedProtectionContainerResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedProtectionContainerResourceInner.properties = ProtectionContainer.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedProtectionContainerResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedProtectionContainerResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionIntentResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionIntentResourceInner.java
index f96743ae08568..1f3de4c4c077b 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionIntentResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionIntentResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntent;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class ProtectionIntentResourceInner extends Resource {
/*
* ProtectionIntentResource properties
*/
- @JsonProperty(value = "properties")
private ProtectionIntent properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of ProtectionIntentResourceInner class.
*/
@@ -73,6 +89,36 @@ public ProtectionIntentResourceInner withEtag(String etag) {
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,58 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ProtectionIntentResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ProtectionIntentResourceInner if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ProtectionIntentResourceInner.
+ */
+ public static ProtectionIntentResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ProtectionIntentResourceInner deserializedProtectionIntentResourceInner
+ = new ProtectionIntentResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedProtectionIntentResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedProtectionIntentResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedProtectionIntentResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedProtectionIntentResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedProtectionIntentResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedProtectionIntentResourceInner.properties = ProtectionIntent.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedProtectionIntentResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedProtectionIntentResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionPolicyResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionPolicyResourceInner.java
index 73bfd2b8a5f2b..374e9b0bb218e 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionPolicyResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionPolicyResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicy;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class ProtectionPolicyResourceInner extends Resource {
/*
* ProtectionPolicyResource properties
*/
- @JsonProperty(value = "properties")
private ProtectionPolicy properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of ProtectionPolicyResourceInner class.
*/
@@ -73,6 +89,36 @@ public ProtectionPolicyResourceInner withEtag(String etag) {
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,58 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ProtectionPolicyResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ProtectionPolicyResourceInner if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ProtectionPolicyResourceInner.
+ */
+ public static ProtectionPolicyResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ProtectionPolicyResourceInner deserializedProtectionPolicyResourceInner
+ = new ProtectionPolicyResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedProtectionPolicyResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedProtectionPolicyResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedProtectionPolicyResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedProtectionPolicyResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedProtectionPolicyResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedProtectionPolicyResourceInner.properties = ProtectionPolicy.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedProtectionPolicyResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedProtectionPolicyResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/RecoveryPointResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/RecoveryPointResourceInner.java
index 16ddbcdec63c7..17bf49c9253ec 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/RecoveryPointResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/RecoveryPointResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPoint;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class RecoveryPointResourceInner extends Resource {
/*
* RecoveryPointResource properties
*/
- @JsonProperty(value = "properties")
private RecoveryPoint properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of RecoveryPointResourceInner class.
*/
@@ -73,6 +89,36 @@ public RecoveryPointResourceInner withEtag(String etag) {
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,57 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of RecoveryPointResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of RecoveryPointResourceInner if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the RecoveryPointResourceInner.
+ */
+ public static RecoveryPointResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ RecoveryPointResourceInner deserializedRecoveryPointResourceInner = new RecoveryPointResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedRecoveryPointResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedRecoveryPointResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedRecoveryPointResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedRecoveryPointResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedRecoveryPointResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedRecoveryPointResourceInner.properties = RecoveryPoint.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedRecoveryPointResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedRecoveryPointResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ResourceGuardProxyBaseResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ResourceGuardProxyBaseResourceInner.java
index 5cc1956db1637..c4da158cb823f 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ResourceGuardProxyBaseResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ResourceGuardProxyBaseResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyBase;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class ResourceGuardProxyBaseResourceInner extends Resource {
/*
* ResourceGuardProxyBaseResource properties
*/
- @JsonProperty(value = "properties")
private ResourceGuardProxyBase properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of ResourceGuardProxyBaseResourceInner class.
*/
@@ -73,6 +89,36 @@ public ResourceGuardProxyBaseResourceInner withEtag(String etag) {
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,59 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ResourceGuardProxyBaseResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ResourceGuardProxyBaseResourceInner if the JsonReader was pointing to an instance of it,
+ * or null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ResourceGuardProxyBaseResourceInner.
+ */
+ public static ResourceGuardProxyBaseResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ResourceGuardProxyBaseResourceInner deserializedResourceGuardProxyBaseResourceInner
+ = new ResourceGuardProxyBaseResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedResourceGuardProxyBaseResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedResourceGuardProxyBaseResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedResourceGuardProxyBaseResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedResourceGuardProxyBaseResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedResourceGuardProxyBaseResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedResourceGuardProxyBaseResourceInner.properties
+ = ResourceGuardProxyBase.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedResourceGuardProxyBaseResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedResourceGuardProxyBaseResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TieringCostInfoInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TieringCostInfoInner.java
index 9fb3a2fb94b4c..cade748cd43f9 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TieringCostInfoInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TieringCostInfoInner.java
@@ -5,40 +5,29 @@
package com.azure.resourcemanager.recoveryservicesbackup.fluent.models;
import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.TieringCostRehydrationInfo;
import com.azure.resourcemanager.recoveryservicesbackup.models.TieringCostSavingInfo;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import java.io.IOException;
/**
* Base class for tiering cost response.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "objectType",
- defaultImpl = TieringCostInfoInner.class,
- visible = true)
-@JsonTypeName("TieringCostInfo")
-@JsonSubTypes({
- @JsonSubTypes.Type(name = "TieringCostRehydrationInfo", value = TieringCostRehydrationInfo.class),
- @JsonSubTypes.Type(name = "TieringCostSavingInfo", value = TieringCostSavingInfo.class) })
@Immutable
-public class TieringCostInfoInner {
+public class TieringCostInfoInner implements JsonSerializable {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "objectType", required = true)
- private String objectType;
+ private String objectType = "TieringCostInfo";
/**
* Creates an instance of TieringCostInfoInner class.
*/
public TieringCostInfoInner() {
- this.objectType = "TieringCostInfo";
}
/**
@@ -58,4 +47,67 @@ public String objectType() {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("objectType", this.objectType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of TieringCostInfoInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of TieringCostInfoInner if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the TieringCostInfoInner.
+ */
+ public static TieringCostInfoInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("objectType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("TieringCostRehydrationInfo".equals(discriminatorValue)) {
+ return TieringCostRehydrationInfo.fromJson(readerToUse.reset());
+ } else if ("TieringCostSavingInfo".equals(discriminatorValue)) {
+ return TieringCostSavingInfo.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static TieringCostInfoInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ TieringCostInfoInner deserializedTieringCostInfoInner = new TieringCostInfoInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("objectType".equals(fieldName)) {
+ deserializedTieringCostInfoInner.objectType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedTieringCostInfoInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TokenInformationInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TokenInformationInner.java
index 4bbd2e78d5353..b08ac4b7c0d0a 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TokenInformationInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TokenInformationInner.java
@@ -5,29 +5,30 @@
package com.azure.resourcemanager.recoveryservicesbackup.fluent.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* The token information details.
*/
@Fluent
-public final class TokenInformationInner {
+public final class TokenInformationInner implements JsonSerializable {
/*
* Token value.
*/
- @JsonProperty(value = "token")
private String token;
/*
* Expiry time of token.
*/
- @JsonProperty(value = "expiryTimeInUtcTicks")
private Long expiryTimeInUtcTicks;
/*
* Security PIN
*/
- @JsonProperty(value = "securityPIN")
private String securityPin;
/**
@@ -103,4 +104,46 @@ public TokenInformationInner withSecurityPin(String securityPin) {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("token", this.token);
+ jsonWriter.writeNumberField("expiryTimeInUtcTicks", this.expiryTimeInUtcTicks);
+ jsonWriter.writeStringField("securityPIN", this.securityPin);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of TokenInformationInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of TokenInformationInner if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the TokenInformationInner.
+ */
+ public static TokenInformationInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ TokenInformationInner deserializedTokenInformationInner = new TokenInformationInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("token".equals(fieldName)) {
+ deserializedTokenInformationInner.token = reader.getString();
+ } else if ("expiryTimeInUtcTicks".equals(fieldName)) {
+ deserializedTokenInformationInner.expiryTimeInUtcTicks = reader.getNullable(JsonReader::getLong);
+ } else if ("securityPIN".equals(fieldName)) {
+ deserializedTokenInformationInner.securityPin = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedTokenInformationInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/UnlockDeleteResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/UnlockDeleteResponseInner.java
index d2d9c71a90aa7..dfffa2a946e49 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/UnlockDeleteResponseInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/UnlockDeleteResponseInner.java
@@ -5,17 +5,20 @@
package com.azure.resourcemanager.recoveryservicesbackup.fluent.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Response of Unlock Delete API.
*/
@Fluent
-public final class UnlockDeleteResponseInner {
+public final class UnlockDeleteResponseInner implements JsonSerializable {
/*
* This is the time when unlock delete privileges will get expired.
*/
- @JsonProperty(value = "unlockDeleteExpiryTime")
private String unlockDeleteExpiryTime;
/**
@@ -51,4 +54,40 @@ public UnlockDeleteResponseInner withUnlockDeleteExpiryTime(String unlockDeleteE
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("unlockDeleteExpiryTime", this.unlockDeleteExpiryTime);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of UnlockDeleteResponseInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of UnlockDeleteResponseInner if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the UnlockDeleteResponseInner.
+ */
+ public static UnlockDeleteResponseInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ UnlockDeleteResponseInner deserializedUnlockDeleteResponseInner = new UnlockDeleteResponseInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("unlockDeleteExpiryTime".equals(fieldName)) {
+ deserializedUnlockDeleteResponseInner.unlockDeleteExpiryTime = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedUnlockDeleteResponseInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ValidateOperationsResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ValidateOperationsResponseInner.java
index 01cb1a9eac3b6..4a2186e938721 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ValidateOperationsResponseInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ValidateOperationsResponseInner.java
@@ -5,18 +5,21 @@
package com.azure.resourcemanager.recoveryservicesbackup.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationResponse;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* The ValidateOperationsResponse model.
*/
@Fluent
-public final class ValidateOperationsResponseInner {
+public final class ValidateOperationsResponseInner implements JsonSerializable {
/*
* Base class for validate operation response.
*/
- @JsonProperty(value = "validateOperationResponse")
private ValidateOperationResponse validateOperationResponse;
/**
@@ -56,4 +59,42 @@ public void validate() {
validateOperationResponse().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("validateOperationResponse", this.validateOperationResponse);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ValidateOperationsResponseInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ValidateOperationsResponseInner if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the ValidateOperationsResponseInner.
+ */
+ public static ValidateOperationsResponseInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ValidateOperationsResponseInner deserializedValidateOperationsResponseInner
+ = new ValidateOperationsResponseInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("validateOperationResponse".equals(fieldName)) {
+ deserializedValidateOperationsResponseInner.validateOperationResponse
+ = ValidateOperationResponse.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedValidateOperationsResponseInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/VaultStorageConfigOperationResultResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/VaultStorageConfigOperationResultResponseInner.java
index 4b43b1485ffde..0dcad8af2a4c7 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/VaultStorageConfigOperationResultResponseInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/VaultStorageConfigOperationResultResponseInner.java
@@ -5,37 +5,29 @@
package com.azure.resourcemanager.recoveryservicesbackup.fluent.models;
import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.PrepareDataMoveResponse;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import java.io.IOException;
/**
* Operation result response for Vault Storage Config.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "objectType",
- defaultImpl = VaultStorageConfigOperationResultResponseInner.class,
- visible = true)
-@JsonTypeName("VaultStorageConfigOperationResultResponse")
-@JsonSubTypes({ @JsonSubTypes.Type(name = "PrepareDataMoveResponse", value = PrepareDataMoveResponse.class) })
@Immutable
-public class VaultStorageConfigOperationResultResponseInner {
+public class VaultStorageConfigOperationResultResponseInner
+ implements JsonSerializable {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "objectType", required = true)
- private String objectType;
+ private String objectType = "VaultStorageConfigOperationResultResponse";
/**
* Creates an instance of VaultStorageConfigOperationResultResponseInner class.
*/
public VaultStorageConfigOperationResultResponseInner() {
- this.objectType = "VaultStorageConfigOperationResultResponse";
}
/**
@@ -55,4 +47,67 @@ public String objectType() {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("objectType", this.objectType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of VaultStorageConfigOperationResultResponseInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of VaultStorageConfigOperationResultResponseInner if the JsonReader was pointing to an
+ * instance of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the VaultStorageConfigOperationResultResponseInner.
+ */
+ public static VaultStorageConfigOperationResultResponseInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("objectType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("PrepareDataMoveResponse".equals(discriminatorValue)) {
+ return PrepareDataMoveResponse.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static VaultStorageConfigOperationResultResponseInner fromJsonKnownDiscriminator(JsonReader jsonReader)
+ throws IOException {
+ return jsonReader.readObject(reader -> {
+ VaultStorageConfigOperationResultResponseInner deserializedVaultStorageConfigOperationResultResponseInner
+ = new VaultStorageConfigOperationResultResponseInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("objectType".equals(fieldName)) {
+ deserializedVaultStorageConfigOperationResultResponseInner.objectType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedVaultStorageConfigOperationResultResponseInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadItemResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadItemResourceInner.java
index d705166ccc4cf..3c96ee32b8e87 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadItemResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadItemResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadItem;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class WorkloadItemResourceInner extends Resource {
/*
* WorkloadItemResource properties
*/
- @JsonProperty(value = "properties")
private WorkloadItem properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of WorkloadItemResourceInner class.
*/
@@ -73,6 +89,36 @@ public WorkloadItemResourceInner withEtag(String etag) {
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,57 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of WorkloadItemResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of WorkloadItemResourceInner if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the WorkloadItemResourceInner.
+ */
+ public static WorkloadItemResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ WorkloadItemResourceInner deserializedWorkloadItemResourceInner = new WorkloadItemResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedWorkloadItemResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedWorkloadItemResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedWorkloadItemResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedWorkloadItemResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedWorkloadItemResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedWorkloadItemResourceInner.properties = WorkloadItem.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedWorkloadItemResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedWorkloadItemResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadProtectableItemResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadProtectableItemResourceInner.java
index 56471724a4b40..3777991a61639 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadProtectableItemResourceInner.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadProtectableItemResourceInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadProtectableItem;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class WorkloadProtectableItemResourceInner extends Resource {
/*
* WorkloadProtectableItemResource properties
*/
- @JsonProperty(value = "properties")
private WorkloadProtectableItem properties;
/*
* Optional ETag.
*/
- @JsonProperty(value = "eTag")
private String etag;
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
/**
* Creates an instance of WorkloadProtectableItemResourceInner class.
*/
@@ -73,6 +89,36 @@ public WorkloadProtectableItemResourceInner withEtag(String etag) {
return this;
}
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,59 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("eTag", this.etag);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of WorkloadProtectableItemResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of WorkloadProtectableItemResourceInner if the JsonReader was pointing to an instance of it,
+ * or null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the WorkloadProtectableItemResourceInner.
+ */
+ public static WorkloadProtectableItemResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ WorkloadProtectableItemResourceInner deserializedWorkloadProtectableItemResourceInner
+ = new WorkloadProtectableItemResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedWorkloadProtectableItemResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedWorkloadProtectableItemResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedWorkloadProtectableItemResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedWorkloadProtectableItemResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedWorkloadProtectableItemResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedWorkloadProtectableItemResourceInner.properties
+ = WorkloadProtectableItem.fromJson(reader);
+ } else if ("eTag".equals(fieldName)) {
+ deserializedWorkloadProtectableItemResourceInner.etag = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedWorkloadProtectableItemResourceInner;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java
index 6b87250d6e472..5142352b9fbb1 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java
@@ -413,9 +413,7 @@ public BackupEngineBaseResourceInner get(String vaultName, String resourceGroupN
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -441,9 +439,7 @@ private Mono> listNextSinglePageAsy
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java
index dec2583451db4..6dd7795b9c1c3 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java
@@ -255,9 +255,7 @@ public PagedIterable list(String vaultName, String resourceGro
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -282,9 +280,7 @@ private Mono> listNextSinglePageAsync(String nex
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java
index bcca9d3281023..9ed54afc70d99 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java
@@ -258,9 +258,7 @@ public PagedIterable list(String vaultName, Strin
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -286,9 +284,7 @@ private Mono> listNextSinglePageAsy
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java
index e82d08902beac..bf24bc701a105 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java
@@ -265,9 +265,7 @@ public PagedIterable list(String vaultName
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -293,9 +291,7 @@ private Mono> listNextSingle
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java
index 6908ea57d1a90..2bcea62aa4131 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java
@@ -258,9 +258,7 @@ public PagedIterable list(String vaultName, String r
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -286,9 +284,7 @@ private Mono> listNextSinglePageAsync(
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java
index 0e1f11f97a25c..5d29a5b8c6c9f 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java
@@ -251,9 +251,7 @@ public PagedIterable list(String vaultName, St
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -279,9 +277,7 @@ private Mono> listNextSinglePage
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java
index 255f4f33526db..1ec03c0b30952 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java
@@ -258,9 +258,7 @@ public PagedIterable list(String vaultName, Strin
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -286,9 +284,7 @@ private Mono> listNextSinglePageAsy
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java
index dea479bee0b6c..310ef5a9b2727 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java
@@ -305,9 +305,7 @@ public PagedIterable list(String vaultName, String re
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -332,9 +330,7 @@ private Mono> listNextSinglePageAsync(S
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/DeletedProtectionContainersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/DeletedProtectionContainersClientImpl.java
index 0b1b8f36382d8..18ad2be0e4886 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/DeletedProtectionContainersClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/DeletedProtectionContainersClientImpl.java
@@ -251,9 +251,7 @@ public PagedIterable list(String resourceGroup
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -279,9 +277,7 @@ private Mono> listNextSinglePage
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java
index 9c607b75886c5..abfbcd99ea443 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java
@@ -183,9 +183,7 @@ public PagedIterable list(Context context
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -211,9 +209,7 @@ private Mono> listNextSingl
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java
index 7db0e84d254a2..7f2753f7d2baa 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java
@@ -266,9 +266,7 @@ public PagedIterable list(String vaultName, S
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -294,9 +292,7 @@ private Mono> listNextSinglePag
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java
index 6672a093c3576..48466fc0b40d3 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java
@@ -4,12 +4,14 @@
package com.azure.resourcemanager.recoveryservicesbackup.implementation;
+import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
@@ -28,6 +30,7 @@
import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsClient;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner;
import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResourceList;
+import com.azure.resourcemanager.recoveryservicesbackup.models.UpdateRecoveryPointRequest;
import reactor.core.publisher.Mono;
/**
@@ -85,6 +88,19 @@ Mono> get(@HostParam("$host") String endpoi
@PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Accept") String accept,
Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> update(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName,
+ @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName,
+ @PathParam("protectedItemName") String protectedItemName,
+ @PathParam("recoveryPointId") String recoveryPointId,
+ @BodyParam("application/json") UpdateRecoveryPointRequest parameters, @HeaderParam("Accept") String accept,
+ Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@@ -491,11 +507,199 @@ public RecoveryPointResourceInner get(String vaultName, String resourceGroupName
}
/**
- * Get the next page of items.
+ * UpdateRecoveryPoint to update recovery point for given RecoveryPointID.
*
- * @param nextLink The URL to get the next list of items
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param vaultName The name of the recovery services vault.
+ * @param fabricName Fabric name associated with backed up item.
+ * @param containerName Container name associated with backed up item.
+ * @param protectedItemName Backed up item name whose backup data needs to be fetched.
+ * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return base class for backup copies along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(String resourceGroupName,
+ String vaultName, String fabricName, String containerName, String protectedItemName, String recoveryPointId,
+ UpdateRecoveryPointRequest parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (fabricName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null."));
+ }
+ if (containerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
+ }
+ if (protectedItemName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null."));
+ }
+ if (recoveryPointId == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName,
+ protectedItemName, recoveryPointId, parameters, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * UpdateRecoveryPoint to update recovery point for given RecoveryPointID.
*
- * The nextLink parameter.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param vaultName The name of the recovery services vault.
+ * @param fabricName Fabric name associated with backed up item.
+ * @param containerName Container name associated with backed up item.
+ * @param protectedItemName Backed up item name whose backup data needs to be fetched.
+ * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return base class for backup copies along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(String resourceGroupName,
+ String vaultName, String fabricName, String containerName, String protectedItemName, String recoveryPointId,
+ UpdateRecoveryPointRequest parameters, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (fabricName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null."));
+ }
+ if (containerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
+ }
+ if (protectedItemName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null."));
+ }
+ if (recoveryPointId == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, parameters,
+ accept, context);
+ }
+
+ /**
+ * UpdateRecoveryPoint to update recovery point for given RecoveryPointID.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param vaultName The name of the recovery services vault.
+ * @param fabricName Fabric name associated with backed up item.
+ * @param containerName Container name associated with backed up item.
+ * @param protectedItemName Backed up item name whose backup data needs to be fetched.
+ * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return base class for backup copies on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String vaultName, String fabricName,
+ String containerName, String protectedItemName, String recoveryPointId, UpdateRecoveryPointRequest parameters) {
+ return updateWithResponseAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName,
+ recoveryPointId, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * UpdateRecoveryPoint to update recovery point for given RecoveryPointID.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param vaultName The name of the recovery services vault.
+ * @param fabricName Fabric name associated with backed up item.
+ * @param containerName Container name associated with backed up item.
+ * @param protectedItemName Backed up item name whose backup data needs to be fetched.
+ * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return base class for backup copies along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateWithResponse(String resourceGroupName, String vaultName,
+ String fabricName, String containerName, String protectedItemName, String recoveryPointId,
+ UpdateRecoveryPointRequest parameters, Context context) {
+ return updateWithResponseAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName,
+ recoveryPointId, parameters, context).block();
+ }
+
+ /**
+ * UpdateRecoveryPoint to update recovery point for given RecoveryPointID.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param vaultName The name of the recovery services vault.
+ * @param fabricName Fabric name associated with backed up item.
+ * @param containerName Container name associated with backed up item.
+ * @param protectedItemName Backed up item name whose backup data needs to be fetched.
+ * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return base class for backup copies.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public RecoveryPointResourceInner update(String resourceGroupName, String vaultName, String fabricName,
+ String containerName, String protectedItemName, String recoveryPointId, UpdateRecoveryPointRequest parameters) {
+ return updateWithResponse(resourceGroupName, vaultName, fabricName, containerName, protectedItemName,
+ recoveryPointId, parameters, Context.NONE).getValue();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -521,9 +725,7 @@ private Mono> listNextSinglePageAsync(
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java
index b06e1487ecbaf..c248842702b31 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java
@@ -13,6 +13,7 @@
import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner;
import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResource;
import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPoints;
+import com.azure.resourcemanager.recoveryservicesbackup.models.UpdateRecoveryPointRequest;
public final class RecoveryPointsImpl implements RecoveryPoints {
private static final ClientLogger LOGGER = new ClientLogger(RecoveryPointsImpl.class);
@@ -65,6 +66,32 @@ public RecoveryPointResource get(String vaultName, String resourceGroupName, Str
}
}
+ public Response updateWithResponse(String resourceGroupName, String vaultName,
+ String fabricName, String containerName, String protectedItemName, String recoveryPointId,
+ UpdateRecoveryPointRequest parameters, Context context) {
+ Response inner = this.serviceClient()
+ .updateWithResponse(resourceGroupName, vaultName, fabricName, containerName, protectedItemName,
+ recoveryPointId, parameters, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new RecoveryPointResourceImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public RecoveryPointResource update(String resourceGroupName, String vaultName, String fabricName,
+ String containerName, String protectedItemName, String recoveryPointId, UpdateRecoveryPointRequest parameters) {
+ RecoveryPointResourceInner inner = this.serviceClient()
+ .update(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId,
+ parameters);
+ if (inner != null) {
+ return new RecoveryPointResourceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
private RecoveryPointsClient serviceClient() {
return this.innerClient;
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java
index 1c5b37108a63c..b4e6600191674 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java
@@ -295,9 +295,7 @@ public PagedIterable list(String vaultName, String r
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -323,9 +321,7 @@ private Mono> listNextSinglePageAsync(
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupClientImpl.java
index f10da8170d090..866bfd3260904 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupClientImpl.java
@@ -13,8 +13,8 @@
import com.azure.core.management.AzureEnvironment;
import com.azure.core.management.exception.ManagementError;
import com.azure.core.management.exception.ManagementException;
-import com.azure.core.management.polling.PollerFactory;
import com.azure.core.management.polling.PollResult;
+import com.azure.core.management.polling.PollerFactory;
import com.azure.core.util.Context;
import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
@@ -35,10 +35,10 @@
import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceEncryptionConfigsClient;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceStorageConfigsNonCrrsClient;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceVaultConfigsClient;
-import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupsClient;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupStatusClient;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupUsageSummariesClient;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupWorkloadItemsClient;
+import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupsClient;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.BmsPrepareDataMoveOperationResultsClient;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.DeletedProtectionContainersClient;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.ExportJobsOperationResultsClient;
@@ -75,8 +75,8 @@
import com.azure.resourcemanager.recoveryservicesbackup.fluent.SecurityPINsClient;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.TieringCostOperationStatusClient;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationResultsClient;
-import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationsClient;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationStatusesClient;
+import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationsClient;
import java.io.IOException;
import java.lang.reflect.Type;
import java.nio.ByteBuffer;
@@ -934,7 +934,7 @@ public TieringCostOperationStatusClient getTieringCostOperationStatus() {
this.defaultPollInterval = defaultPollInterval;
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
- this.apiVersion = "2024-04-01";
+ this.apiVersion = "2024-11-01-preview";
this.backupResourceStorageConfigsNonCrrs = new BackupResourceStorageConfigsNonCrrsClientImpl(this);
this.protectionIntents = new ProtectionIntentsClientImpl(this);
this.backupStatus = new BackupStatusClientImpl(this);
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxiesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxiesClientImpl.java
index 2709a5532fe9f..ad4b0ad547142 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxiesClientImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxiesClientImpl.java
@@ -226,9 +226,7 @@ public PagedIterable get(String vaultName,
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -254,9 +252,7 @@ private Mono> getNextSinglePa
/**
* Get the next page of items.
*
- * @param nextLink The URL to get the next list of items
- *
- * The nextLink parameter.
+ * @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java
index c5a3dd3497251..4d5454cd8a616 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java
@@ -10,8 +10,8 @@
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.SecurityPINsClient;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner;
-import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPinBase;
import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPINs;
+import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPinBase;
import com.azure.resourcemanager.recoveryservicesbackup.models.TokenInformation;
public final class SecurityPINsImpl implements SecurityPINs {
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AcquireStorageAccountLock.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AcquireStorageAccountLock.java
index e10e9f03ee772..5535b1c923a5a 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AcquireStorageAccountLock.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AcquireStorageAccountLock.java
@@ -5,7 +5,6 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.util.ExpandableStringEnum;
-import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;
/**
@@ -37,7 +36,6 @@ public AcquireStorageAccountLock() {
* @param name a name to look for.
* @return the corresponding AcquireStorageAccountLock.
*/
- @JsonCreator
public static AcquireStorageAccountLock fromString(String name) {
return fromString(name, AcquireStorageAccountLock.class);
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupGoalFeatureSupportRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupGoalFeatureSupportRequest.java
index 392eae08aa045..89277d08d986d 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupGoalFeatureSupportRequest.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupGoalFeatureSupportRequest.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Immutable;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure backup goal feature specific request.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "featureType",
- defaultImpl = AzureBackupGoalFeatureSupportRequest.class,
- visible = true)
-@JsonTypeName("AzureBackupGoals")
@Immutable
public final class AzureBackupGoalFeatureSupportRequest extends FeatureSupportRequest {
/*
* backup support feature type.
*/
- @JsonTypeId
- @JsonProperty(value = "featureType", required = true)
private String featureType = "AzureBackupGoals";
/**
@@ -51,6 +43,42 @@ public String featureType() {
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("featureType", this.featureType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureBackupGoalFeatureSupportRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureBackupGoalFeatureSupportRequest if the JsonReader was pointing to an instance of it,
+ * or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureBackupGoalFeatureSupportRequest.
+ */
+ public static AzureBackupGoalFeatureSupportRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureBackupGoalFeatureSupportRequest deserializedAzureBackupGoalFeatureSupportRequest
+ = new AzureBackupGoalFeatureSupportRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("featureType".equals(fieldName)) {
+ deserializedAzureBackupGoalFeatureSupportRequest.featureType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureBackupGoalFeatureSupportRequest;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java
index 60801edbdc9f5..847d26f6cb17a 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java
@@ -5,31 +5,24 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
/**
* AzureBackupServer (DPMVenus) workload-specific protection container.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "containerType",
- defaultImpl = AzureBackupServerContainer.class,
- visible = true)
-@JsonTypeName("AzureBackupServerContainer")
@Fluent
public final class AzureBackupServerContainer extends DpmContainer {
/*
- * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2.
+ * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines
+ * 2.
* Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is
* Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload
* Backup is VMAppContainer
*/
- @JsonTypeId
- @JsonProperty(value = "containerType", required = true)
private ProtectableContainerType containerType = ProtectableContainerType.AZURE_BACKUP_SERVER_CONTAINER;
/**
@@ -176,6 +169,90 @@ public AzureBackupServerContainer withProtectableObjectType(String protectableOb
*/
@Override
public void validate() {
- super.validate();
+ if (extendedInfo() != null) {
+ extendedInfo().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("registrationStatus", registrationStatus());
+ jsonWriter.writeStringField("healthStatus", healthStatus());
+ jsonWriter.writeStringField("protectableObjectType", protectableObjectType());
+ jsonWriter.writeBooleanField("canReRegister", canReRegister());
+ jsonWriter.writeStringField("containerId", containerId());
+ jsonWriter.writeNumberField("protectedItemCount", protectedItemCount());
+ jsonWriter.writeStringField("dpmAgentVersion", dpmAgentVersion());
+ jsonWriter.writeArrayField("dpmServers", dpmServers(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeBooleanField("upgradeAvailable", upgradeAvailable());
+ jsonWriter.writeStringField("protectionStatus", protectionStatus());
+ jsonWriter.writeJsonField("extendedInfo", extendedInfo());
+ jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureBackupServerContainer from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureBackupServerContainer if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureBackupServerContainer.
+ */
+ public static AzureBackupServerContainer fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureBackupServerContainer deserializedAzureBackupServerContainer = new AzureBackupServerContainer();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("friendlyName".equals(fieldName)) {
+ deserializedAzureBackupServerContainer.withFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureBackupServerContainer
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("registrationStatus".equals(fieldName)) {
+ deserializedAzureBackupServerContainer.withRegistrationStatus(reader.getString());
+ } else if ("healthStatus".equals(fieldName)) {
+ deserializedAzureBackupServerContainer.withHealthStatus(reader.getString());
+ } else if ("protectableObjectType".equals(fieldName)) {
+ deserializedAzureBackupServerContainer.withProtectableObjectType(reader.getString());
+ } else if ("canReRegister".equals(fieldName)) {
+ deserializedAzureBackupServerContainer
+ .withCanReRegister(reader.getNullable(JsonReader::getBoolean));
+ } else if ("containerId".equals(fieldName)) {
+ deserializedAzureBackupServerContainer.withContainerId(reader.getString());
+ } else if ("protectedItemCount".equals(fieldName)) {
+ deserializedAzureBackupServerContainer
+ .withProtectedItemCount(reader.getNullable(JsonReader::getLong));
+ } else if ("dpmAgentVersion".equals(fieldName)) {
+ deserializedAzureBackupServerContainer.withDpmAgentVersion(reader.getString());
+ } else if ("dpmServers".equals(fieldName)) {
+ List dpmServers = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureBackupServerContainer.withDpmServers(dpmServers);
+ } else if ("upgradeAvailable".equals(fieldName)) {
+ deserializedAzureBackupServerContainer
+ .withUpgradeAvailable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("protectionStatus".equals(fieldName)) {
+ deserializedAzureBackupServerContainer.withProtectionStatus(reader.getString());
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureBackupServerContainer.withExtendedInfo(DpmContainerExtendedInfo.fromJson(reader));
+ } else if ("containerType".equals(fieldName)) {
+ deserializedAzureBackupServerContainer.containerType
+ = ProtectableContainerType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureBackupServerContainer;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java
index b001b526c0270..a6794b436efe6 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Backup engine type when Azure Backup Server is used to manage the backups.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "backupEngineType",
- defaultImpl = AzureBackupServerEngine.class,
- visible = true)
-@JsonTypeName("AzureBackupServerEngine")
@Fluent
public final class AzureBackupServerEngine extends BackupEngineBase {
/*
* Type of the backup engine.
*/
- @JsonTypeId
- @JsonProperty(value = "backupEngineType", required = true)
private BackupEngineType backupEngineType = BackupEngineType.AZURE_BACKUP_SERVER_ENGINE;
/**
@@ -159,6 +151,86 @@ public AzureBackupServerEngine withExtendedInfo(BackupEngineExtendedInfo extende
*/
@Override
public void validate() {
- super.validate();
+ if (extendedInfo() != null) {
+ extendedInfo().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("registrationStatus", registrationStatus());
+ jsonWriter.writeStringField("backupEngineState", backupEngineState());
+ jsonWriter.writeStringField("healthStatus", healthStatus());
+ jsonWriter.writeBooleanField("canReRegister", canReRegister());
+ jsonWriter.writeStringField("backupEngineId", backupEngineId());
+ jsonWriter.writeStringField("dpmVersion", dpmVersion());
+ jsonWriter.writeStringField("azureBackupAgentVersion", azureBackupAgentVersion());
+ jsonWriter.writeBooleanField("isAzureBackupAgentUpgradeAvailable", isAzureBackupAgentUpgradeAvailable());
+ jsonWriter.writeBooleanField("isDpmUpgradeAvailable", isDpmUpgradeAvailable());
+ jsonWriter.writeJsonField("extendedInfo", extendedInfo());
+ jsonWriter.writeStringField("backupEngineType",
+ this.backupEngineType == null ? null : this.backupEngineType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureBackupServerEngine from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureBackupServerEngine if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureBackupServerEngine.
+ */
+ public static AzureBackupServerEngine fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureBackupServerEngine deserializedAzureBackupServerEngine = new AzureBackupServerEngine();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("friendlyName".equals(fieldName)) {
+ deserializedAzureBackupServerEngine.withFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureBackupServerEngine
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("registrationStatus".equals(fieldName)) {
+ deserializedAzureBackupServerEngine.withRegistrationStatus(reader.getString());
+ } else if ("backupEngineState".equals(fieldName)) {
+ deserializedAzureBackupServerEngine.withBackupEngineState(reader.getString());
+ } else if ("healthStatus".equals(fieldName)) {
+ deserializedAzureBackupServerEngine.withHealthStatus(reader.getString());
+ } else if ("canReRegister".equals(fieldName)) {
+ deserializedAzureBackupServerEngine.withCanReRegister(reader.getNullable(JsonReader::getBoolean));
+ } else if ("backupEngineId".equals(fieldName)) {
+ deserializedAzureBackupServerEngine.withBackupEngineId(reader.getString());
+ } else if ("dpmVersion".equals(fieldName)) {
+ deserializedAzureBackupServerEngine.withDpmVersion(reader.getString());
+ } else if ("azureBackupAgentVersion".equals(fieldName)) {
+ deserializedAzureBackupServerEngine.withAzureBackupAgentVersion(reader.getString());
+ } else if ("isAzureBackupAgentUpgradeAvailable".equals(fieldName)) {
+ deserializedAzureBackupServerEngine
+ .withIsAzureBackupAgentUpgradeAvailable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isDpmUpgradeAvailable".equals(fieldName)) {
+ deserializedAzureBackupServerEngine
+ .withIsDpmUpgradeAvailable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureBackupServerEngine.withExtendedInfo(BackupEngineExtendedInfo.fromJson(reader));
+ } else if ("backupEngineType".equals(fieldName)) {
+ deserializedAzureBackupServerEngine.backupEngineType
+ = BackupEngineType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureBackupServerEngine;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareBackupRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareBackupRequest.java
index 5d676bd18d326..9cdbc7799bd06 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareBackupRequest.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareBackupRequest.java
@@ -5,34 +5,28 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
/**
* AzureFileShare workload-specific backup request.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "objectType",
- defaultImpl = AzureFileShareBackupRequest.class,
- visible = true)
-@JsonTypeName("AzureFileShareBackupRequest")
@Fluent
public final class AzureFileShareBackupRequest extends BackupRequest {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "objectType", required = true)
private String objectType = "AzureFileShareBackupRequest";
/*
* Backup copy will expire after the time specified (UTC).
*/
- @JsonProperty(value = "recoveryPointExpiryTimeInUTC")
private OffsetDateTime recoveryPointExpiryTimeInUtc;
/**
@@ -79,6 +73,48 @@ public AzureFileShareBackupRequest withRecoveryPointExpiryTimeInUtc(OffsetDateTi
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeStringField("recoveryPointExpiryTimeInUTC",
+ this.recoveryPointExpiryTimeInUtc == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.recoveryPointExpiryTimeInUtc));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureFileShareBackupRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureFileShareBackupRequest if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureFileShareBackupRequest.
+ */
+ public static AzureFileShareBackupRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureFileShareBackupRequest deserializedAzureFileShareBackupRequest = new AzureFileShareBackupRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("objectType".equals(fieldName)) {
+ deserializedAzureFileShareBackupRequest.objectType = reader.getString();
+ } else if ("recoveryPointExpiryTimeInUTC".equals(fieldName)) {
+ deserializedAzureFileShareBackupRequest.recoveryPointExpiryTimeInUtc = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureFileShareBackupRequest;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectableItem.java
index 4a03d2beeeb88..888c7559786f4 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectableItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectableItem.java
@@ -5,45 +5,34 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Protectable item for Azure Fileshare workloads.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectableItemType",
- defaultImpl = AzureFileShareProtectableItem.class,
- visible = true)
-@JsonTypeName("AzureFileShare")
@Fluent
public final class AzureFileShareProtectableItem extends WorkloadProtectableItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "protectableItemType", required = true)
private String protectableItemType = "AzureFileShare";
/*
* Full Fabric ID of container to which this protectable item belongs. For example, ARM ID.
*/
- @JsonProperty(value = "parentContainerFabricId")
private String parentContainerFabricId;
/*
* Friendly name of container to which this protectable item belongs.
*/
- @JsonProperty(value = "parentContainerFriendlyName")
private String parentContainerFriendlyName;
/*
* File Share type XSync or XSMB.
*/
- @JsonProperty(value = "azureFileShareType")
private AzureFileShareType azureFileShareType;
/**
@@ -167,6 +156,66 @@ public AzureFileShareProtectableItem withProtectionState(ProtectionStatus protec
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ jsonWriter.writeStringField("parentContainerFabricId", this.parentContainerFabricId);
+ jsonWriter.writeStringField("parentContainerFriendlyName", this.parentContainerFriendlyName);
+ jsonWriter.writeStringField("azureFileShareType",
+ this.azureFileShareType == null ? null : this.azureFileShareType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureFileShareProtectableItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureFileShareProtectableItem if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureFileShareProtectableItem.
+ */
+ public static AzureFileShareProtectableItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureFileShareProtectableItem deserializedAzureFileShareProtectableItem
+ = new AzureFileShareProtectableItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureFileShareProtectableItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureFileShareProtectableItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureFileShareProtectableItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureFileShareProtectableItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureFileShareProtectableItem.protectableItemType = reader.getString();
+ } else if ("parentContainerFabricId".equals(fieldName)) {
+ deserializedAzureFileShareProtectableItem.parentContainerFabricId = reader.getString();
+ } else if ("parentContainerFriendlyName".equals(fieldName)) {
+ deserializedAzureFileShareProtectableItem.parentContainerFriendlyName = reader.getString();
+ } else if ("azureFileShareType".equals(fieldName)) {
+ deserializedAzureFileShareProtectableItem.azureFileShareType
+ = AzureFileShareType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureFileShareProtectableItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java
index 62af4d6cf61c8..55da8cd04cc51 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java
@@ -5,58 +5,46 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
/**
* AzureStorage backup policy.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "backupManagementType",
- defaultImpl = AzureFileShareProtectionPolicy.class,
- visible = true)
-@JsonTypeName("AzureStorage")
@Fluent
public final class AzureFileShareProtectionPolicy extends ProtectionPolicy {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "backupManagementType", required = true)
private String backupManagementType = "AzureStorage";
/*
* Type of workload for the backup management
*/
- @JsonProperty(value = "workLoadType")
private WorkloadType workLoadType;
/*
* Backup schedule specified as part of backup policy.
*/
- @JsonProperty(value = "schedulePolicy")
private SchedulePolicy schedulePolicy;
/*
* Retention policy with the details on backup copy retention ranges.
*/
- @JsonProperty(value = "retentionPolicy")
private RetentionPolicy retentionPolicy;
/*
* Retention policy with the details on hardened backup copy retention ranges.
*/
- @JsonProperty(value = "vaultRetentionPolicy")
private VaultRetentionPolicy vaultRetentionPolicy;
/*
* TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
*/
- @JsonProperty(value = "timeZone")
private String timeZone;
/**
@@ -204,7 +192,6 @@ public AzureFileShareProtectionPolicy withProtectedItemsCount(Integer protectedI
*/
@Override
public void validate() {
- super.validate();
if (schedulePolicy() != null) {
schedulePolicy().validate();
}
@@ -215,4 +202,68 @@ public void validate() {
vaultRetentionPolicy().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeNumberField("protectedItemsCount", protectedItemsCount());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("backupManagementType", this.backupManagementType);
+ jsonWriter.writeStringField("workLoadType", this.workLoadType == null ? null : this.workLoadType.toString());
+ jsonWriter.writeJsonField("schedulePolicy", this.schedulePolicy);
+ jsonWriter.writeJsonField("retentionPolicy", this.retentionPolicy);
+ jsonWriter.writeJsonField("vaultRetentionPolicy", this.vaultRetentionPolicy);
+ jsonWriter.writeStringField("timeZone", this.timeZone);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureFileShareProtectionPolicy from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureFileShareProtectionPolicy if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureFileShareProtectionPolicy.
+ */
+ public static AzureFileShareProtectionPolicy fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureFileShareProtectionPolicy deserializedAzureFileShareProtectionPolicy
+ = new AzureFileShareProtectionPolicy();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("protectedItemsCount".equals(fieldName)) {
+ deserializedAzureFileShareProtectionPolicy
+ .withProtectedItemsCount(reader.getNullable(JsonReader::getInt));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureFileShareProtectionPolicy
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureFileShareProtectionPolicy.backupManagementType = reader.getString();
+ } else if ("workLoadType".equals(fieldName)) {
+ deserializedAzureFileShareProtectionPolicy.workLoadType
+ = WorkloadType.fromString(reader.getString());
+ } else if ("schedulePolicy".equals(fieldName)) {
+ deserializedAzureFileShareProtectionPolicy.schedulePolicy = SchedulePolicy.fromJson(reader);
+ } else if ("retentionPolicy".equals(fieldName)) {
+ deserializedAzureFileShareProtectionPolicy.retentionPolicy = RetentionPolicy.fromJson(reader);
+ } else if ("vaultRetentionPolicy".equals(fieldName)) {
+ deserializedAzureFileShareProtectionPolicy.vaultRetentionPolicy
+ = VaultRetentionPolicy.fromJson(reader);
+ } else if ("timeZone".equals(fieldName)) {
+ deserializedAzureFileShareProtectionPolicy.timeZone = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureFileShareProtectionPolicy;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProvisionIlrRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProvisionIlrRequest.java
index 3dd5899e7d1fc..f0e12fb44def5 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProvisionIlrRequest.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProvisionIlrRequest.java
@@ -5,39 +5,30 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Update snapshot Uri with the correct friendly Name of the source Azure file share.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "objectType",
- defaultImpl = AzureFileShareProvisionIlrRequest.class,
- visible = true)
-@JsonTypeName("AzureFileShareProvisionILRRequest")
@Fluent
public final class AzureFileShareProvisionIlrRequest extends IlrRequest {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "objectType", required = true)
private String objectType = "AzureFileShareProvisionILRRequest";
/*
* Recovery point ID.
*/
- @JsonProperty(value = "recoveryPointId")
private String recoveryPointId;
/*
* Source Storage account ARM Id
*/
- @JsonProperty(value = "sourceResourceId")
private String sourceResourceId;
/**
@@ -104,6 +95,48 @@ public AzureFileShareProvisionIlrRequest withSourceResourceId(String sourceResou
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeStringField("recoveryPointId", this.recoveryPointId);
+ jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureFileShareProvisionIlrRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureFileShareProvisionIlrRequest if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureFileShareProvisionIlrRequest.
+ */
+ public static AzureFileShareProvisionIlrRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureFileShareProvisionIlrRequest deserializedAzureFileShareProvisionIlrRequest
+ = new AzureFileShareProvisionIlrRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("objectType".equals(fieldName)) {
+ deserializedAzureFileShareProvisionIlrRequest.objectType = reader.getString();
+ } else if ("recoveryPointId".equals(fieldName)) {
+ deserializedAzureFileShareProvisionIlrRequest.recoveryPointId = reader.getString();
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureFileShareProvisionIlrRequest.sourceResourceId = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureFileShareProvisionIlrRequest;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPoint.java
index f04bc4ced19ee..a7ea3039f51d9 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPoint.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPoint.java
@@ -5,58 +5,48 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
/**
* Azure File Share workload specific backup copy.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "objectType",
- defaultImpl = AzureFileShareRecoveryPoint.class,
- visible = true)
-@JsonTypeName("AzureFileShareRecoveryPoint")
@Fluent
public final class AzureFileShareRecoveryPoint extends RecoveryPoint {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "objectType", required = true)
private String objectType = "AzureFileShareRecoveryPoint";
/*
* Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent.
*/
- @JsonProperty(value = "recoveryPointType")
private String recoveryPointType;
/*
* Time at which this backup copy was created.
*/
- @JsonProperty(value = "recoveryPointTime")
private OffsetDateTime recoveryPointTime;
/*
* Contains Url to the snapshot of fileshare, if applicable
*/
- @JsonProperty(value = "fileShareSnapshotUri")
private String fileShareSnapshotUri;
/*
* Contains recovery point size
*/
- @JsonProperty(value = "recoveryPointSizeInGB")
private Integer recoveryPointSizeInGB;
/*
* Properties of Recovery Point
*/
- @JsonProperty(value = "recoveryPointProperties")
private RecoveryPointProperties recoveryPointProperties;
/**
@@ -185,9 +175,65 @@ public AzureFileShareRecoveryPoint withRecoveryPointProperties(RecoveryPointProp
*/
@Override
public void validate() {
- super.validate();
if (recoveryPointProperties() != null) {
recoveryPointProperties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeStringField("recoveryPointType", this.recoveryPointType);
+ jsonWriter.writeStringField("recoveryPointTime",
+ this.recoveryPointTime == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.recoveryPointTime));
+ jsonWriter.writeStringField("fileShareSnapshotUri", this.fileShareSnapshotUri);
+ jsonWriter.writeNumberField("recoveryPointSizeInGB", this.recoveryPointSizeInGB);
+ jsonWriter.writeJsonField("recoveryPointProperties", this.recoveryPointProperties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureFileShareRecoveryPoint from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureFileShareRecoveryPoint if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureFileShareRecoveryPoint.
+ */
+ public static AzureFileShareRecoveryPoint fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureFileShareRecoveryPoint deserializedAzureFileShareRecoveryPoint = new AzureFileShareRecoveryPoint();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("objectType".equals(fieldName)) {
+ deserializedAzureFileShareRecoveryPoint.objectType = reader.getString();
+ } else if ("recoveryPointType".equals(fieldName)) {
+ deserializedAzureFileShareRecoveryPoint.recoveryPointType = reader.getString();
+ } else if ("recoveryPointTime".equals(fieldName)) {
+ deserializedAzureFileShareRecoveryPoint.recoveryPointTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("fileShareSnapshotUri".equals(fieldName)) {
+ deserializedAzureFileShareRecoveryPoint.fileShareSnapshotUri = reader.getString();
+ } else if ("recoveryPointSizeInGB".equals(fieldName)) {
+ deserializedAzureFileShareRecoveryPoint.recoveryPointSizeInGB
+ = reader.getNullable(JsonReader::getInt);
+ } else if ("recoveryPointProperties".equals(fieldName)) {
+ deserializedAzureFileShareRecoveryPoint.recoveryPointProperties
+ = RecoveryPointProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureFileShareRecoveryPoint;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java
index 2939c0cb7cb5e..ddce613894f64 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java
@@ -5,64 +5,51 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
/**
* AzureFileShare Restore Request.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "objectType",
- defaultImpl = AzureFileShareRestoreRequest.class,
- visible = true)
-@JsonTypeName("AzureFileShareRestoreRequest")
@Fluent
public final class AzureFileShareRestoreRequest extends RestoreRequest {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "objectType", required = true)
private String objectType = "AzureFileShareRestoreRequest";
/*
* Type of this recovery.
*/
- @JsonProperty(value = "recoveryType")
private RecoveryType recoveryType;
/*
* Source storage account ARM Id
*/
- @JsonProperty(value = "sourceResourceId")
private String sourceResourceId;
/*
* Options to resolve copy conflicts.
*/
- @JsonProperty(value = "copyOptions")
private CopyOptions copyOptions;
/*
* Restore Type (FullShareRestore or ItemLevelRestore)
*/
- @JsonProperty(value = "restoreRequestType")
private RestoreRequestType restoreRequestType;
/*
* List of Source Files/Folders(which need to recover) and TargetFolderPath details
*/
- @JsonProperty(value = "restoreFileSpecs")
private List restoreFileSpecs;
/*
* Target File Share Details
*/
- @JsonProperty(value = "targetDetails")
private TargetAfsRestoreInfo targetDetails;
/**
@@ -221,7 +208,6 @@ public AzureFileShareRestoreRequest withTargetDetails(TargetAfsRestoreInfo targe
*/
@Override
public void validate() {
- super.validate();
if (restoreFileSpecs() != null) {
restoreFileSpecs().forEach(e -> e.validate());
}
@@ -229,4 +215,69 @@ public void validate() {
targetDetails().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeStringField("recoveryType", this.recoveryType == null ? null : this.recoveryType.toString());
+ jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId);
+ jsonWriter.writeStringField("copyOptions", this.copyOptions == null ? null : this.copyOptions.toString());
+ jsonWriter.writeStringField("restoreRequestType",
+ this.restoreRequestType == null ? null : this.restoreRequestType.toString());
+ jsonWriter.writeArrayField("restoreFileSpecs", this.restoreFileSpecs,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeJsonField("targetDetails", this.targetDetails);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureFileShareRestoreRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureFileShareRestoreRequest if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureFileShareRestoreRequest.
+ */
+ public static AzureFileShareRestoreRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureFileShareRestoreRequest deserializedAzureFileShareRestoreRequest = new AzureFileShareRestoreRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureFileShareRestoreRequest
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureFileShareRestoreRequest.objectType = reader.getString();
+ } else if ("recoveryType".equals(fieldName)) {
+ deserializedAzureFileShareRestoreRequest.recoveryType = RecoveryType.fromString(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureFileShareRestoreRequest.sourceResourceId = reader.getString();
+ } else if ("copyOptions".equals(fieldName)) {
+ deserializedAzureFileShareRestoreRequest.copyOptions = CopyOptions.fromString(reader.getString());
+ } else if ("restoreRequestType".equals(fieldName)) {
+ deserializedAzureFileShareRestoreRequest.restoreRequestType
+ = RestoreRequestType.fromString(reader.getString());
+ } else if ("restoreFileSpecs".equals(fieldName)) {
+ List restoreFileSpecs
+ = reader.readArray(reader1 -> RestoreFileSpecs.fromJson(reader1));
+ deserializedAzureFileShareRestoreRequest.restoreFileSpecs = restoreFileSpecs;
+ } else if ("targetDetails".equals(fieldName)) {
+ deserializedAzureFileShareRestoreRequest.targetDetails = TargetAfsRestoreInfo.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureFileShareRestoreRequest;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareType.java
index 3affa358ba884..86ad2c77b94a5 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareType.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareType.java
@@ -5,7 +5,6 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.util.ExpandableStringEnum;
-import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;
/**
@@ -42,7 +41,6 @@ public AzureFileShareType() {
* @param name a name to look for.
* @return the corresponding AzureFileShareType.
*/
- @JsonCreator
public static AzureFileShareType fromString(String name) {
return fromString(name, AzureFileShareType.class);
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java
index 64d9d382ee74e..aacc79c0dc3f0 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java
@@ -5,76 +5,76 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
/**
* Azure File Share workload-specific backup item.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectedItemType",
- defaultImpl = AzureFileshareProtectedItem.class,
- visible = true)
-@JsonTypeName("AzureFileShareProtectedItem")
@Fluent
public final class AzureFileshareProtectedItem extends ProtectedItem {
/*
* backup item type.
*/
- @JsonTypeId
- @JsonProperty(value = "protectedItemType", required = true)
private String protectedItemType = "AzureFileShareProtectedItem";
/*
* Friendly name of the fileshare represented by this backup item.
*/
- @JsonProperty(value = "friendlyName")
private String friendlyName;
/*
* Backup status of this backup item.
*/
- @JsonProperty(value = "protectionStatus")
private String protectionStatus;
/*
* Backup state of this backup item.
*/
- @JsonProperty(value = "protectionState")
private ProtectionState protectionState;
/*
* Last backup operation status. Possible values: Healthy, Unhealthy.
*/
- @JsonProperty(value = "lastBackupStatus")
private String lastBackupStatus;
/*
* Timestamp of the last backup operation on this backup item.
*/
- @JsonProperty(value = "lastBackupTime")
private OffsetDateTime lastBackupTime;
/*
* Health details of different KPIs
*/
- @JsonProperty(value = "kpisHealths")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map kpisHealths;
/*
* Additional information with this backup item.
*/
- @JsonProperty(value = "extendedInfo")
private AzureFileshareProtectedItemExtendedInfo extendedInfo;
+ /*
+ * ID of the vault which protects this item
+ */
+ private String vaultId;
+
+ /*
+ * Type of workload this item represents.
+ */
+ private DataSourceTypeAutoGenerated3 workloadType;
+
+ /*
+ * Type of backup management for the backed up item.
+ */
+ private BackupManagementType backupManagementType;
+
/**
* Creates an instance of AzureFileshareProtectedItem class.
*/
@@ -231,6 +231,36 @@ public AzureFileshareProtectedItem withExtendedInfo(AzureFileshareProtectedItemE
return this;
}
+ /**
+ * Get the vaultId property: ID of the vault which protects this item.
+ *
+ * @return the vaultId value.
+ */
+ @Override
+ public String vaultId() {
+ return this.vaultId;
+ }
+
+ /**
+ * Get the workloadType property: Type of workload this item represents.
+ *
+ * @return the workloadType value.
+ */
+ @Override
+ public DataSourceTypeAutoGenerated3 workloadType() {
+ return this.workloadType;
+ }
+
+ /**
+ * Get the backupManagementType property: Type of backup management for the backed up item.
+ *
+ * @return the backupManagementType value.
+ */
+ @Override
+ public BackupManagementType backupManagementType() {
+ return this.backupManagementType;
+ }
+
/**
* {@inheritDoc}
*/
@@ -373,7 +403,6 @@ public AzureFileshareProtectedItem withSoftDeleteRetentionPeriod(Integer softDel
*/
@Override
public void validate() {
- super.validate();
if (kpisHealths() != null) {
kpisHealths().values().forEach(e -> {
if (e != null) {
@@ -385,4 +414,134 @@ public void validate() {
extendedInfo().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("containerName", containerName());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("lastRecoveryPoint",
+ lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint()));
+ jsonWriter.writeStringField("backupSetName", backupSetName());
+ jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString());
+ jsonWriter.writeStringField("deferredDeleteTimeInUTC",
+ deferredDeleteTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc()));
+ jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete());
+ jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining());
+ jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming());
+ jsonWriter.writeBooleanField("isRehydrate", isRehydrate());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled());
+ jsonWriter.writeStringField("policyName", policyName());
+ jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriod());
+ jsonWriter.writeStringField("protectedItemType", this.protectedItemType);
+ jsonWriter.writeStringField("friendlyName", this.friendlyName);
+ jsonWriter.writeStringField("protectionStatus", this.protectionStatus);
+ jsonWriter.writeStringField("protectionState",
+ this.protectionState == null ? null : this.protectionState.toString());
+ jsonWriter.writeStringField("lastBackupStatus", this.lastBackupStatus);
+ jsonWriter.writeStringField("lastBackupTime",
+ this.lastBackupTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastBackupTime));
+ jsonWriter.writeMapField("kpisHealths", this.kpisHealths, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeJsonField("extendedInfo", this.extendedInfo);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureFileshareProtectedItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureFileshareProtectedItem if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureFileshareProtectedItem.
+ */
+ public static AzureFileshareProtectedItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureFileshareProtectedItem deserializedAzureFileshareProtectedItem = new AzureFileshareProtectedItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.backupManagementType
+ = BackupManagementType.fromString(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.workloadType
+ = DataSourceTypeAutoGenerated3.fromString(reader.getString());
+ } else if ("containerName".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.withContainerName(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.withSourceResourceId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.withPolicyId(reader.getString());
+ } else if ("lastRecoveryPoint".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.withLastRecoveryPoint(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("backupSetName".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.withBackupSetName(reader.getString());
+ } else if ("createMode".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.withCreateMode(CreateMode.fromString(reader.getString()));
+ } else if ("deferredDeleteTimeInUTC".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.withDeferredDeleteTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("isScheduledForDeferredDelete".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem
+ .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean));
+ } else if ("deferredDeleteTimeRemaining".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.withDeferredDeleteTimeRemaining(reader.getString());
+ } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem
+ .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isRehydrate".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.withIsRehydrate(reader.getNullable(JsonReader::getBoolean));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureFileshareProtectedItem
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("isArchiveEnabled".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem
+ .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean));
+ } else if ("policyName".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.withPolicyName(reader.getString());
+ } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem
+ .withSoftDeleteRetentionPeriod(reader.getNullable(JsonReader::getInt));
+ } else if ("vaultId".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.vaultId = reader.getString();
+ } else if ("protectedItemType".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.protectedItemType = reader.getString();
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.friendlyName = reader.getString();
+ } else if ("protectionStatus".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.protectionStatus = reader.getString();
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.protectionState
+ = ProtectionState.fromString(reader.getString());
+ } else if ("lastBackupStatus".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.lastBackupStatus = reader.getString();
+ } else if ("lastBackupTime".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.lastBackupTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("kpisHealths".equals(fieldName)) {
+ Map kpisHealths
+ = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1));
+ deserializedAzureFileshareProtectedItem.kpisHealths = kpisHealths;
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItem.extendedInfo
+ = AzureFileshareProtectedItemExtendedInfo.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureFileshareProtectedItem;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemExtendedInfo.java
index 302cc87f22c98..f5af485f3ddad 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemExtendedInfo.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemExtendedInfo.java
@@ -5,42 +5,45 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
/**
* Additional information about Azure File Share backup item.
*/
@Fluent
-public final class AzureFileshareProtectedItemExtendedInfo {
+public final class AzureFileshareProtectedItemExtendedInfo
+ implements JsonSerializable {
/*
* The oldest backup copy available for this item in the service.
*/
- @JsonProperty(value = "oldestRecoveryPoint")
private OffsetDateTime oldestRecoveryPoint;
/*
* Number of available backup copies associated with this backup item.
*/
- @JsonProperty(value = "recoveryPointCount")
private Integer recoveryPointCount;
/*
* Indicates consistency of policy object and policy applied to this backup item.
*/
- @JsonProperty(value = "policyState")
private String policyState;
/*
- * Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, Deleted}
+ * Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted,
+ * Deleted}
*/
- @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY)
private String resourceState;
/*
* The resource state sync time for this backup item.
*/
- @JsonProperty(value = "resourceStateSyncTime", access = JsonProperty.Access.WRITE_ONLY)
private OffsetDateTime resourceStateSyncTime;
/**
@@ -135,4 +138,57 @@ public OffsetDateTime resourceStateSyncTime() {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("oldestRecoveryPoint",
+ this.oldestRecoveryPoint == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPoint));
+ jsonWriter.writeNumberField("recoveryPointCount", this.recoveryPointCount);
+ jsonWriter.writeStringField("policyState", this.policyState);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureFileshareProtectedItemExtendedInfo from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureFileshareProtectedItemExtendedInfo if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureFileshareProtectedItemExtendedInfo.
+ */
+ public static AzureFileshareProtectedItemExtendedInfo fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureFileshareProtectedItemExtendedInfo deserializedAzureFileshareProtectedItemExtendedInfo
+ = new AzureFileshareProtectedItemExtendedInfo();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("oldestRecoveryPoint".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItemExtendedInfo.oldestRecoveryPoint = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("recoveryPointCount".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItemExtendedInfo.recoveryPointCount
+ = reader.getNullable(JsonReader::getInt);
+ } else if ("policyState".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItemExtendedInfo.policyState = reader.getString();
+ } else if ("resourceState".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItemExtendedInfo.resourceState = reader.getString();
+ } else if ("resourceStateSyncTime".equals(fieldName)) {
+ deserializedAzureFileshareProtectedItemExtendedInfo.resourceStateSyncTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureFileshareProtectedItemExtendedInfo;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java
index fe6f1056d95c5..cdcfff9d13658 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java
@@ -5,30 +5,23 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* IaaS VM workload-specific backup item representing a classic virtual machine.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "containerType",
- defaultImpl = AzureIaaSClassicComputeVMContainer.class,
- visible = true)
-@JsonTypeName("Microsoft.ClassicCompute/virtualMachines")
@Fluent
public final class AzureIaaSClassicComputeVMContainer extends IaaSvmContainer {
/*
- * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2.
+ * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines
+ * 2.
* Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is
* Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload
* Backup is VMAppContainer
*/
- @JsonTypeId
- @JsonProperty(value = "containerType", required = true)
private ProtectableContainerType containerType
= ProtectableContainerType.MICROSOFT_CLASSIC_COMPUTE_VIRTUAL_MACHINES;
@@ -131,6 +124,69 @@ public AzureIaaSClassicComputeVMContainer withProtectableObjectType(String prote
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("registrationStatus", registrationStatus());
+ jsonWriter.writeStringField("healthStatus", healthStatus());
+ jsonWriter.writeStringField("protectableObjectType", protectableObjectType());
+ jsonWriter.writeStringField("virtualMachineId", virtualMachineId());
+ jsonWriter.writeStringField("virtualMachineVersion", virtualMachineVersion());
+ jsonWriter.writeStringField("resourceGroup", resourceGroup());
+ jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSClassicComputeVMContainer from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSClassicComputeVMContainer if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSClassicComputeVMContainer.
+ */
+ public static AzureIaaSClassicComputeVMContainer fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSClassicComputeVMContainer deserializedAzureIaaSClassicComputeVMContainer
+ = new AzureIaaSClassicComputeVMContainer();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("friendlyName".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMContainer.withFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMContainer
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("registrationStatus".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMContainer.withRegistrationStatus(reader.getString());
+ } else if ("healthStatus".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMContainer.withHealthStatus(reader.getString());
+ } else if ("protectableObjectType".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMContainer.withProtectableObjectType(reader.getString());
+ } else if ("virtualMachineId".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMContainer.withVirtualMachineId(reader.getString());
+ } else if ("virtualMachineVersion".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMContainer.withVirtualMachineVersion(reader.getString());
+ } else if ("resourceGroup".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMContainer.withResourceGroup(reader.getString());
+ } else if ("containerType".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMContainer.containerType
+ = ProtectableContainerType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSClassicComputeVMContainer;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java
index 0ac9865dcda6c..761ff962e775f 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* IaaS VM workload-specific backup item representing the Classic Compute VM.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectableItemType",
- defaultImpl = AzureIaaSClassicComputeVMProtectableItem.class,
- visible = true)
-@JsonTypeName("Microsoft.ClassicCompute/virtualMachines")
@Fluent
public final class AzureIaaSClassicComputeVMProtectableItem extends IaaSvmProtectableItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "protectableItemType", required = true)
private String protectableItemType = "Microsoft.ClassicCompute/virtualMachines";
/**
@@ -114,6 +106,64 @@ public AzureIaaSClassicComputeVMProtectableItem withProtectionState(ProtectionSt
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("virtualMachineId", virtualMachineId());
+ jsonWriter.writeStringField("virtualMachineVersion", virtualMachineVersion());
+ jsonWriter.writeStringField("resourceGroup", resourceGroup());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSClassicComputeVMProtectableItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSClassicComputeVMProtectableItem if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSClassicComputeVMProtectableItem.
+ */
+ public static AzureIaaSClassicComputeVMProtectableItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSClassicComputeVMProtectableItem deserializedAzureIaaSClassicComputeVMProtectableItem
+ = new AzureIaaSClassicComputeVMProtectableItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectableItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectableItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectableItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectableItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("virtualMachineId".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectableItem.withVirtualMachineId(reader.getString());
+ } else if ("virtualMachineVersion".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectableItem.withVirtualMachineVersion(reader.getString());
+ } else if ("resourceGroup".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectableItem.withResourceGroup(reader.getString());
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectableItem.protectableItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSClassicComputeVMProtectableItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.java
index c6505e5657222..56ebe907da91a 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.java
@@ -5,32 +5,66 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
/**
* IaaS VM workload-specific backup item representing the Classic Compute VM.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectedItemType",
- defaultImpl = AzureIaaSClassicComputeVMProtectedItem.class,
- visible = true)
-@JsonTypeName("Microsoft.ClassicCompute/virtualMachines")
@Fluent
public final class AzureIaaSClassicComputeVMProtectedItem extends AzureIaaSvmProtectedItem {
/*
* backup item type.
*/
- @JsonTypeId
- @JsonProperty(value = "protectedItemType", required = true)
private String protectedItemType = "Microsoft.ClassicCompute/virtualMachines";
+ /*
+ * Data ID of the protected item.
+ */
+ private String protectedItemDataId;
+
+ /*
+ * Timestamp of the last backup operation on this backup item.
+ */
+ private OffsetDateTime lastBackupTime;
+
+ /*
+ * Health status of protected item.
+ */
+ private HealthStatus healthStatus;
+
+ /*
+ * Fully qualified ARM ID of the virtual machine represented by this item.
+ */
+ private String virtualMachineId;
+
+ /*
+ * Friendly name of the VM represented by this backup item.
+ */
+ private String friendlyName;
+
+ /*
+ * ID of the vault which protects this item
+ */
+ private String vaultId;
+
+ /*
+ * Type of workload this item represents.
+ */
+ private DataSourceTypeAutoGenerated3 workloadType;
+
+ /*
+ * Type of backup management for the backed up item.
+ */
+ private BackupManagementType backupManagementType;
+
/**
* Creates an instance of AzureIaaSClassicComputeVMProtectedItem class.
*/
@@ -47,6 +81,86 @@ public String protectedItemType() {
return this.protectedItemType;
}
+ /**
+ * Get the protectedItemDataId property: Data ID of the protected item.
+ *
+ * @return the protectedItemDataId value.
+ */
+ @Override
+ public String protectedItemDataId() {
+ return this.protectedItemDataId;
+ }
+
+ /**
+ * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item.
+ *
+ * @return the lastBackupTime value.
+ */
+ @Override
+ public OffsetDateTime lastBackupTime() {
+ return this.lastBackupTime;
+ }
+
+ /**
+ * Get the healthStatus property: Health status of protected item.
+ *
+ * @return the healthStatus value.
+ */
+ @Override
+ public HealthStatus healthStatus() {
+ return this.healthStatus;
+ }
+
+ /**
+ * Get the virtualMachineId property: Fully qualified ARM ID of the virtual machine represented by this item.
+ *
+ * @return the virtualMachineId value.
+ */
+ @Override
+ public String virtualMachineId() {
+ return this.virtualMachineId;
+ }
+
+ /**
+ * Get the friendlyName property: Friendly name of the VM represented by this backup item.
+ *
+ * @return the friendlyName value.
+ */
+ @Override
+ public String friendlyName() {
+ return this.friendlyName;
+ }
+
+ /**
+ * Get the vaultId property: ID of the vault which protects this item.
+ *
+ * @return the vaultId value.
+ */
+ @Override
+ public String vaultId() {
+ return this.vaultId;
+ }
+
+ /**
+ * Get the workloadType property: Type of workload this item represents.
+ *
+ * @return the workloadType value.
+ */
+ @Override
+ public DataSourceTypeAutoGenerated3 workloadType() {
+ return this.workloadType;
+ }
+
+ /**
+ * Get the backupManagementType property: Type of backup management for the backed up item.
+ *
+ * @return the backupManagementType value.
+ */
+ @Override
+ public BackupManagementType backupManagementType() {
+ return this.backupManagementType;
+ }
+
/**
* {@inheritDoc}
*/
@@ -255,6 +369,167 @@ public AzureIaaSClassicComputeVMProtectedItem withSoftDeleteRetentionPeriod(Inte
*/
@Override
public void validate() {
- super.validate();
+ if (healthDetails() != null) {
+ healthDetails().forEach(e -> e.validate());
+ }
+ if (kpisHealths() != null) {
+ kpisHealths().values().forEach(e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ if (extendedInfo() != null) {
+ extendedInfo().validate();
+ }
+ if (extendedProperties() != null) {
+ extendedProperties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("containerName", containerName());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("lastRecoveryPoint",
+ lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint()));
+ jsonWriter.writeStringField("backupSetName", backupSetName());
+ jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString());
+ jsonWriter.writeStringField("deferredDeleteTimeInUTC",
+ deferredDeleteTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc()));
+ jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete());
+ jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining());
+ jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming());
+ jsonWriter.writeBooleanField("isRehydrate", isRehydrate());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled());
+ jsonWriter.writeStringField("policyName", policyName());
+ jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriod());
+ jsonWriter.writeStringField("protectionStatus", protectionStatus());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeArrayField("healthDetails", healthDetails(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("lastBackupStatus", lastBackupStatus());
+ jsonWriter.writeJsonField("extendedInfo", extendedInfo());
+ jsonWriter.writeJsonField("extendedProperties", extendedProperties());
+ jsonWriter.writeStringField("protectedItemType", this.protectedItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSClassicComputeVMProtectedItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSClassicComputeVMProtectedItem if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSClassicComputeVMProtectedItem.
+ */
+ public static AzureIaaSClassicComputeVMProtectedItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSClassicComputeVMProtectedItem deserializedAzureIaaSClassicComputeVMProtectedItem
+ = new AzureIaaSClassicComputeVMProtectedItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.backupManagementType
+ = BackupManagementType.fromString(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.workloadType
+ = DataSourceTypeAutoGenerated3.fromString(reader.getString());
+ } else if ("containerName".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.withContainerName(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.withSourceResourceId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.withPolicyId(reader.getString());
+ } else if ("lastRecoveryPoint".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.withLastRecoveryPoint(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("backupSetName".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.withBackupSetName(reader.getString());
+ } else if ("createMode".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem
+ .withCreateMode(CreateMode.fromString(reader.getString()));
+ } else if ("deferredDeleteTimeInUTC".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.withDeferredDeleteTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("isScheduledForDeferredDelete".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem
+ .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean));
+ } else if ("deferredDeleteTimeRemaining".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem
+ .withDeferredDeleteTimeRemaining(reader.getString());
+ } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem
+ .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isRehydrate".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem
+ .withIsRehydrate(reader.getNullable(JsonReader::getBoolean));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureIaaSClassicComputeVMProtectedItem
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("isArchiveEnabled".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem
+ .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean));
+ } else if ("policyName".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.withPolicyName(reader.getString());
+ } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem
+ .withSoftDeleteRetentionPeriod(reader.getNullable(JsonReader::getInt));
+ } else if ("vaultId".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.vaultId = reader.getString();
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.friendlyName = reader.getString();
+ } else if ("virtualMachineId".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.virtualMachineId = reader.getString();
+ } else if ("protectionStatus".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.withProtectionStatus(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem
+ .withProtectionState(ProtectionState.fromString(reader.getString()));
+ } else if ("healthStatus".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.healthStatus
+ = HealthStatus.fromString(reader.getString());
+ } else if ("healthDetails".equals(fieldName)) {
+ List healthDetails
+ = reader.readArray(reader1 -> AzureIaaSvmHealthDetails.fromJson(reader1));
+ deserializedAzureIaaSClassicComputeVMProtectedItem.withHealthDetails(healthDetails);
+ } else if ("kpisHealths".equals(fieldName)) {
+ Map kpisHealths
+ = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1));
+ deserializedAzureIaaSClassicComputeVMProtectedItem.withKpisHealths(kpisHealths);
+ } else if ("lastBackupStatus".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.withLastBackupStatus(reader.getString());
+ } else if ("lastBackupTime".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.lastBackupTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("protectedItemDataId".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.protectedItemDataId = reader.getString();
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem
+ .withExtendedInfo(AzureIaaSvmProtectedItemExtendedInfo.fromJson(reader));
+ } else if ("extendedProperties".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem
+ .withExtendedProperties(ExtendedProperties.fromJson(reader));
+ } else if ("protectedItemType".equals(fieldName)) {
+ deserializedAzureIaaSClassicComputeVMProtectedItem.protectedItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSClassicComputeVMProtectedItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java
index 01482cc1314d8..e02a05eb69325 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java
@@ -5,30 +5,23 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* IaaS VM workload-specific backup item representing an Azure Resource Manager virtual machine.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "containerType",
- defaultImpl = AzureIaaSComputeVMContainer.class,
- visible = true)
-@JsonTypeName("Microsoft.Compute/virtualMachines")
@Fluent
public final class AzureIaaSComputeVMContainer extends IaaSvmContainer {
/*
- * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2.
+ * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines
+ * 2.
* Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is
* Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload
* Backup is VMAppContainer
*/
- @JsonTypeId
- @JsonProperty(value = "containerType", required = true)
private ProtectableContainerType containerType = ProtectableContainerType.MICROSOFT_COMPUTE_VIRTUAL_MACHINES;
/**
@@ -130,6 +123,68 @@ public AzureIaaSComputeVMContainer withProtectableObjectType(String protectableO
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("registrationStatus", registrationStatus());
+ jsonWriter.writeStringField("healthStatus", healthStatus());
+ jsonWriter.writeStringField("protectableObjectType", protectableObjectType());
+ jsonWriter.writeStringField("virtualMachineId", virtualMachineId());
+ jsonWriter.writeStringField("virtualMachineVersion", virtualMachineVersion());
+ jsonWriter.writeStringField("resourceGroup", resourceGroup());
+ jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSComputeVMContainer from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSComputeVMContainer if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSComputeVMContainer.
+ */
+ public static AzureIaaSComputeVMContainer fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSComputeVMContainer deserializedAzureIaaSComputeVMContainer = new AzureIaaSComputeVMContainer();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("friendlyName".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMContainer.withFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMContainer
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("registrationStatus".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMContainer.withRegistrationStatus(reader.getString());
+ } else if ("healthStatus".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMContainer.withHealthStatus(reader.getString());
+ } else if ("protectableObjectType".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMContainer.withProtectableObjectType(reader.getString());
+ } else if ("virtualMachineId".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMContainer.withVirtualMachineId(reader.getString());
+ } else if ("virtualMachineVersion".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMContainer.withVirtualMachineVersion(reader.getString());
+ } else if ("resourceGroup".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMContainer.withResourceGroup(reader.getString());
+ } else if ("containerType".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMContainer.containerType
+ = ProtectableContainerType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSComputeVMContainer;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java
index 63a6e167a2eec..02b61f823bc0d 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* IaaS VM workload-specific backup item representing the Azure Resource Manager VM.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectableItemType",
- defaultImpl = AzureIaaSComputeVMProtectableItem.class,
- visible = true)
-@JsonTypeName("Microsoft.Compute/virtualMachines")
@Fluent
public final class AzureIaaSComputeVMProtectableItem extends IaaSvmProtectableItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "protectableItemType", required = true)
private String protectableItemType = "Microsoft.Compute/virtualMachines";
/**
@@ -114,6 +106,64 @@ public AzureIaaSComputeVMProtectableItem withProtectionState(ProtectionStatus pr
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("virtualMachineId", virtualMachineId());
+ jsonWriter.writeStringField("virtualMachineVersion", virtualMachineVersion());
+ jsonWriter.writeStringField("resourceGroup", resourceGroup());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSComputeVMProtectableItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSComputeVMProtectableItem if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSComputeVMProtectableItem.
+ */
+ public static AzureIaaSComputeVMProtectableItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSComputeVMProtectableItem deserializedAzureIaaSComputeVMProtectableItem
+ = new AzureIaaSComputeVMProtectableItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectableItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectableItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectableItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectableItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("virtualMachineId".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectableItem.withVirtualMachineId(reader.getString());
+ } else if ("virtualMachineVersion".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectableItem.withVirtualMachineVersion(reader.getString());
+ } else if ("resourceGroup".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectableItem.withResourceGroup(reader.getString());
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectableItem.protectableItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSComputeVMProtectableItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java
index 81e6dce20cdbb..eaa513e44f6ab 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java
@@ -5,32 +5,66 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
/**
* IaaS VM workload-specific backup item representing the Azure Resource Manager VM.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectedItemType",
- defaultImpl = AzureIaaSComputeVMProtectedItem.class,
- visible = true)
-@JsonTypeName("Microsoft.Compute/virtualMachines")
@Fluent
public final class AzureIaaSComputeVMProtectedItem extends AzureIaaSvmProtectedItem {
/*
* backup item type.
*/
- @JsonTypeId
- @JsonProperty(value = "protectedItemType", required = true)
private String protectedItemType = "Microsoft.Compute/virtualMachines";
+ /*
+ * Data ID of the protected item.
+ */
+ private String protectedItemDataId;
+
+ /*
+ * Timestamp of the last backup operation on this backup item.
+ */
+ private OffsetDateTime lastBackupTime;
+
+ /*
+ * Health status of protected item.
+ */
+ private HealthStatus healthStatus;
+
+ /*
+ * Fully qualified ARM ID of the virtual machine represented by this item.
+ */
+ private String virtualMachineId;
+
+ /*
+ * Friendly name of the VM represented by this backup item.
+ */
+ private String friendlyName;
+
+ /*
+ * ID of the vault which protects this item
+ */
+ private String vaultId;
+
+ /*
+ * Type of workload this item represents.
+ */
+ private DataSourceTypeAutoGenerated3 workloadType;
+
+ /*
+ * Type of backup management for the backed up item.
+ */
+ private BackupManagementType backupManagementType;
+
/**
* Creates an instance of AzureIaaSComputeVMProtectedItem class.
*/
@@ -47,6 +81,86 @@ public String protectedItemType() {
return this.protectedItemType;
}
+ /**
+ * Get the protectedItemDataId property: Data ID of the protected item.
+ *
+ * @return the protectedItemDataId value.
+ */
+ @Override
+ public String protectedItemDataId() {
+ return this.protectedItemDataId;
+ }
+
+ /**
+ * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item.
+ *
+ * @return the lastBackupTime value.
+ */
+ @Override
+ public OffsetDateTime lastBackupTime() {
+ return this.lastBackupTime;
+ }
+
+ /**
+ * Get the healthStatus property: Health status of protected item.
+ *
+ * @return the healthStatus value.
+ */
+ @Override
+ public HealthStatus healthStatus() {
+ return this.healthStatus;
+ }
+
+ /**
+ * Get the virtualMachineId property: Fully qualified ARM ID of the virtual machine represented by this item.
+ *
+ * @return the virtualMachineId value.
+ */
+ @Override
+ public String virtualMachineId() {
+ return this.virtualMachineId;
+ }
+
+ /**
+ * Get the friendlyName property: Friendly name of the VM represented by this backup item.
+ *
+ * @return the friendlyName value.
+ */
+ @Override
+ public String friendlyName() {
+ return this.friendlyName;
+ }
+
+ /**
+ * Get the vaultId property: ID of the vault which protects this item.
+ *
+ * @return the vaultId value.
+ */
+ @Override
+ public String vaultId() {
+ return this.vaultId;
+ }
+
+ /**
+ * Get the workloadType property: Type of workload this item represents.
+ *
+ * @return the workloadType value.
+ */
+ @Override
+ public DataSourceTypeAutoGenerated3 workloadType() {
+ return this.workloadType;
+ }
+
+ /**
+ * Get the backupManagementType property: Type of backup management for the backed up item.
+ *
+ * @return the backupManagementType value.
+ */
+ @Override
+ public BackupManagementType backupManagementType() {
+ return this.backupManagementType;
+ }
+
/**
* {@inheritDoc}
*/
@@ -254,6 +368,166 @@ public AzureIaaSComputeVMProtectedItem withSoftDeleteRetentionPeriod(Integer sof
*/
@Override
public void validate() {
- super.validate();
+ if (healthDetails() != null) {
+ healthDetails().forEach(e -> e.validate());
+ }
+ if (kpisHealths() != null) {
+ kpisHealths().values().forEach(e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ if (extendedInfo() != null) {
+ extendedInfo().validate();
+ }
+ if (extendedProperties() != null) {
+ extendedProperties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("containerName", containerName());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("lastRecoveryPoint",
+ lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint()));
+ jsonWriter.writeStringField("backupSetName", backupSetName());
+ jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString());
+ jsonWriter.writeStringField("deferredDeleteTimeInUTC",
+ deferredDeleteTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc()));
+ jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete());
+ jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining());
+ jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming());
+ jsonWriter.writeBooleanField("isRehydrate", isRehydrate());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled());
+ jsonWriter.writeStringField("policyName", policyName());
+ jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriod());
+ jsonWriter.writeStringField("protectionStatus", protectionStatus());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeArrayField("healthDetails", healthDetails(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("lastBackupStatus", lastBackupStatus());
+ jsonWriter.writeJsonField("extendedInfo", extendedInfo());
+ jsonWriter.writeJsonField("extendedProperties", extendedProperties());
+ jsonWriter.writeStringField("protectedItemType", this.protectedItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSComputeVMProtectedItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSComputeVMProtectedItem if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSComputeVMProtectedItem.
+ */
+ public static AzureIaaSComputeVMProtectedItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSComputeVMProtectedItem deserializedAzureIaaSComputeVMProtectedItem
+ = new AzureIaaSComputeVMProtectedItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.backupManagementType
+ = BackupManagementType.fromString(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.workloadType
+ = DataSourceTypeAutoGenerated3.fromString(reader.getString());
+ } else if ("containerName".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.withContainerName(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.withSourceResourceId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.withPolicyId(reader.getString());
+ } else if ("lastRecoveryPoint".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.withLastRecoveryPoint(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("backupSetName".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.withBackupSetName(reader.getString());
+ } else if ("createMode".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem
+ .withCreateMode(CreateMode.fromString(reader.getString()));
+ } else if ("deferredDeleteTimeInUTC".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.withDeferredDeleteTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("isScheduledForDeferredDelete".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem
+ .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean));
+ } else if ("deferredDeleteTimeRemaining".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.withDeferredDeleteTimeRemaining(reader.getString());
+ } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem
+ .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isRehydrate".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem
+ .withIsRehydrate(reader.getNullable(JsonReader::getBoolean));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureIaaSComputeVMProtectedItem
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("isArchiveEnabled".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem
+ .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean));
+ } else if ("policyName".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.withPolicyName(reader.getString());
+ } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem
+ .withSoftDeleteRetentionPeriod(reader.getNullable(JsonReader::getInt));
+ } else if ("vaultId".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.vaultId = reader.getString();
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.friendlyName = reader.getString();
+ } else if ("virtualMachineId".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.virtualMachineId = reader.getString();
+ } else if ("protectionStatus".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.withProtectionStatus(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem
+ .withProtectionState(ProtectionState.fromString(reader.getString()));
+ } else if ("healthStatus".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.healthStatus
+ = HealthStatus.fromString(reader.getString());
+ } else if ("healthDetails".equals(fieldName)) {
+ List healthDetails
+ = reader.readArray(reader1 -> AzureIaaSvmHealthDetails.fromJson(reader1));
+ deserializedAzureIaaSComputeVMProtectedItem.withHealthDetails(healthDetails);
+ } else if ("kpisHealths".equals(fieldName)) {
+ Map kpisHealths
+ = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1));
+ deserializedAzureIaaSComputeVMProtectedItem.withKpisHealths(kpisHealths);
+ } else if ("lastBackupStatus".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.withLastBackupStatus(reader.getString());
+ } else if ("lastBackupTime".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.lastBackupTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("protectedItemDataId".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.protectedItemDataId = reader.getString();
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem
+ .withExtendedInfo(AzureIaaSvmProtectedItemExtendedInfo.fromJson(reader));
+ } else if ("extendedProperties".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem
+ .withExtendedProperties(ExtendedProperties.fromJson(reader));
+ } else if ("protectedItemType".equals(fieldName)) {
+ deserializedAzureIaaSComputeVMProtectedItem.protectedItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSComputeVMProtectedItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmErrorInfo.java
index 42473a57874c6..d368627376b96 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmErrorInfo.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmErrorInfo.java
@@ -5,36 +5,36 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Immutable;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
/**
* Azure IaaS VM workload-specific error information.
*/
@Immutable
-public final class AzureIaaSvmErrorInfo {
+public final class AzureIaaSvmErrorInfo implements JsonSerializable {
/*
* Error code.
*/
- @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY)
private Integer errorCode;
/*
* Title: Typically, the entity that the error pertains to.
*/
- @JsonProperty(value = "errorTitle", access = JsonProperty.Access.WRITE_ONLY)
private String errorTitle;
/*
* Localized error string.
*/
- @JsonProperty(value = "errorString", access = JsonProperty.Access.WRITE_ONLY)
private String errorString;
/*
* List of localized recommendations for above error code.
*/
- @JsonProperty(value = "recommendations", access = JsonProperty.Access.WRITE_ONLY)
private List recommendations;
/**
@@ -86,4 +86,46 @@ public List recommendations() {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSvmErrorInfo from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSvmErrorInfo if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSvmErrorInfo.
+ */
+ public static AzureIaaSvmErrorInfo fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSvmErrorInfo deserializedAzureIaaSvmErrorInfo = new AzureIaaSvmErrorInfo();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("errorCode".equals(fieldName)) {
+ deserializedAzureIaaSvmErrorInfo.errorCode = reader.getNullable(JsonReader::getInt);
+ } else if ("errorTitle".equals(fieldName)) {
+ deserializedAzureIaaSvmErrorInfo.errorTitle = reader.getString();
+ } else if ("errorString".equals(fieldName)) {
+ deserializedAzureIaaSvmErrorInfo.errorString = reader.getString();
+ } else if ("recommendations".equals(fieldName)) {
+ List recommendations = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureIaaSvmErrorInfo.recommendations = recommendations;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSvmErrorInfo;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmHealthDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmHealthDetails.java
index cdbe1c9e502b9..fa8099579a4bf 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmHealthDetails.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmHealthDetails.java
@@ -5,18 +5,83 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
/**
* Azure IaaS VM workload-specific Health Details.
*/
@Immutable
public final class AzureIaaSvmHealthDetails extends ResourceHealthDetails {
+ /*
+ * Health Recommended Actions
+ */
+ private List recommendations;
+
+ /*
+ * Health Message
+ */
+ private String message;
+
+ /*
+ * Health Title
+ */
+ private String title;
+
+ /*
+ * Health Code
+ */
+ private Integer code;
+
/**
* Creates an instance of AzureIaaSvmHealthDetails class.
*/
public AzureIaaSvmHealthDetails() {
}
+ /**
+ * Get the recommendations property: Health Recommended Actions.
+ *
+ * @return the recommendations value.
+ */
+ @Override
+ public List recommendations() {
+ return this.recommendations;
+ }
+
+ /**
+ * Get the message property: Health Message.
+ *
+ * @return the message value.
+ */
+ @Override
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Get the title property: Health Title.
+ *
+ * @return the title value.
+ */
+ @Override
+ public String title() {
+ return this.title;
+ }
+
+ /**
+ * Get the code property: Health Code.
+ *
+ * @return the code value.
+ */
+ @Override
+ public Integer code() {
+ return this.code;
+ }
+
/**
* Validates the instance.
*
@@ -24,6 +89,47 @@ public AzureIaaSvmHealthDetails() {
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSvmHealthDetails from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSvmHealthDetails if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSvmHealthDetails.
+ */
+ public static AzureIaaSvmHealthDetails fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSvmHealthDetails deserializedAzureIaaSvmHealthDetails = new AzureIaaSvmHealthDetails();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("code".equals(fieldName)) {
+ deserializedAzureIaaSvmHealthDetails.code = reader.getNullable(JsonReader::getInt);
+ } else if ("title".equals(fieldName)) {
+ deserializedAzureIaaSvmHealthDetails.title = reader.getString();
+ } else if ("message".equals(fieldName)) {
+ deserializedAzureIaaSvmHealthDetails.message = reader.getString();
+ } else if ("recommendations".equals(fieldName)) {
+ List recommendations = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureIaaSvmHealthDetails.recommendations = recommendations;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSvmHealthDetails;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJob.java
index 974e36fa0d336..c5c394d36abb6 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJob.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJob.java
@@ -5,68 +5,60 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.Duration;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
/**
* Azure IaaS VM workload-specific job object.
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "jobType", defaultImpl = AzureIaaSvmJob.class, visible = true)
-@JsonTypeName("AzureIaaSVMJob")
@Fluent
public final class AzureIaaSvmJob extends Job {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "jobType", required = true)
private String jobType = "AzureIaaSVMJob";
/*
* Time elapsed during the execution of this job.
*/
- @JsonProperty(value = "duration")
private Duration duration;
/*
* Gets or sets the state/actions applicable on this job like cancel/retry.
*/
- @JsonProperty(value = "actionsInfo")
private List actionsInfo;
/*
* Error details on execution of this job.
*/
- @JsonProperty(value = "errorDetails")
private List errorDetails;
/*
* Specifies whether the backup item is a Classic or an Azure Resource Manager VM.
*/
- @JsonProperty(value = "virtualMachineVersion")
private String virtualMachineVersion;
/*
* Additional information for this job.
*/
- @JsonProperty(value = "extendedInfo")
private AzureIaaSvmJobExtendedInfo extendedInfo;
/*
* Container name of the entity on which the current job is executing.
*/
- @JsonProperty(value = "containerName")
private String containerName;
/*
* Indicated that whether the job is adhoc(true) or scheduled(false)
*/
- @JsonProperty(value = "isUserTriggered")
private Boolean isUserTriggered;
/**
@@ -298,7 +290,6 @@ public AzureIaaSvmJob withActivityId(String activityId) {
*/
@Override
public void validate() {
- super.validate();
if (errorDetails() != null) {
errorDetails().forEach(e -> e.validate());
}
@@ -306,4 +297,94 @@ public void validate() {
extendedInfo().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("entityFriendlyName", entityFriendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("operation", operation());
+ jsonWriter.writeStringField("status", status());
+ jsonWriter.writeStringField("startTime",
+ startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime()));
+ jsonWriter.writeStringField("endTime",
+ endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime()));
+ jsonWriter.writeStringField("activityId", activityId());
+ jsonWriter.writeStringField("jobType", this.jobType);
+ jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration));
+ jsonWriter.writeArrayField("actionsInfo", this.actionsInfo,
+ (writer, element) -> writer.writeString(element == null ? null : element.toString()));
+ jsonWriter.writeArrayField("errorDetails", this.errorDetails, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("virtualMachineVersion", this.virtualMachineVersion);
+ jsonWriter.writeJsonField("extendedInfo", this.extendedInfo);
+ jsonWriter.writeStringField("containerName", this.containerName);
+ jsonWriter.writeBooleanField("isUserTriggered", this.isUserTriggered);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSvmJob from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSvmJob if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSvmJob.
+ */
+ public static AzureIaaSvmJob fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSvmJob deserializedAzureIaaSvmJob = new AzureIaaSvmJob();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("entityFriendlyName".equals(fieldName)) {
+ deserializedAzureIaaSvmJob.withEntityFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureIaaSvmJob
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("operation".equals(fieldName)) {
+ deserializedAzureIaaSvmJob.withOperation(reader.getString());
+ } else if ("status".equals(fieldName)) {
+ deserializedAzureIaaSvmJob.withStatus(reader.getString());
+ } else if ("startTime".equals(fieldName)) {
+ deserializedAzureIaaSvmJob.withStartTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("endTime".equals(fieldName)) {
+ deserializedAzureIaaSvmJob.withEndTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("activityId".equals(fieldName)) {
+ deserializedAzureIaaSvmJob.withActivityId(reader.getString());
+ } else if ("jobType".equals(fieldName)) {
+ deserializedAzureIaaSvmJob.jobType = reader.getString();
+ } else if ("duration".equals(fieldName)) {
+ deserializedAzureIaaSvmJob.duration
+ = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()));
+ } else if ("actionsInfo".equals(fieldName)) {
+ List actionsInfo
+ = reader.readArray(reader1 -> JobSupportedAction.fromString(reader1.getString()));
+ deserializedAzureIaaSvmJob.actionsInfo = actionsInfo;
+ } else if ("errorDetails".equals(fieldName)) {
+ List errorDetails
+ = reader.readArray(reader1 -> AzureIaaSvmErrorInfo.fromJson(reader1));
+ deserializedAzureIaaSvmJob.errorDetails = errorDetails;
+ } else if ("virtualMachineVersion".equals(fieldName)) {
+ deserializedAzureIaaSvmJob.virtualMachineVersion = reader.getString();
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureIaaSvmJob.extendedInfo = AzureIaaSvmJobExtendedInfo.fromJson(reader);
+ } else if ("containerName".equals(fieldName)) {
+ deserializedAzureIaaSvmJob.containerName = reader.getString();
+ } else if ("isUserTriggered".equals(fieldName)) {
+ deserializedAzureIaaSvmJob.isUserTriggered = reader.getNullable(JsonReader::getBoolean);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSvmJob;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java
index f5c39ad39a57f..7b0301369003a 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java
@@ -5,8 +5,11 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -14,43 +17,35 @@
* Azure IaaS VM workload-specific additional information for job.
*/
@Fluent
-public final class AzureIaaSvmJobExtendedInfo {
+public final class AzureIaaSvmJobExtendedInfo implements JsonSerializable {
/*
* List of tasks associated with this job.
*/
- @JsonProperty(value = "tasksList")
private List tasksList;
/*
* Job properties.
*/
- @JsonProperty(value = "propertyBag")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map propertyBag;
/*
* Job internal properties.
*/
- @JsonProperty(value = "internalPropertyBag")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map internalPropertyBag;
/*
* Indicates progress of the job. Null if it has not started or completed.
*/
- @JsonProperty(value = "progressPercentage")
private Double progressPercentage;
/*
* Time remaining for execution of this job.
*/
- @JsonProperty(value = "estimatedRemainingDuration")
private String estimatedRemainingDuration;
/*
* Non localized error message on job execution.
*/
- @JsonProperty(value = "dynamicErrorMessage")
private String dynamicErrorMessage;
/**
@@ -189,4 +184,61 @@ public void validate() {
tasksList().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("tasksList", this.tasksList, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeMapField("propertyBag", this.propertyBag, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeMapField("internalPropertyBag", this.internalPropertyBag,
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeNumberField("progressPercentage", this.progressPercentage);
+ jsonWriter.writeStringField("estimatedRemainingDuration", this.estimatedRemainingDuration);
+ jsonWriter.writeStringField("dynamicErrorMessage", this.dynamicErrorMessage);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSvmJobExtendedInfo from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSvmJobExtendedInfo if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSvmJobExtendedInfo.
+ */
+ public static AzureIaaSvmJobExtendedInfo fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSvmJobExtendedInfo deserializedAzureIaaSvmJobExtendedInfo = new AzureIaaSvmJobExtendedInfo();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("tasksList".equals(fieldName)) {
+ List tasksList
+ = reader.readArray(reader1 -> AzureIaaSvmJobTaskDetails.fromJson(reader1));
+ deserializedAzureIaaSvmJobExtendedInfo.tasksList = tasksList;
+ } else if ("propertyBag".equals(fieldName)) {
+ Map propertyBag = reader.readMap(reader1 -> reader1.getString());
+ deserializedAzureIaaSvmJobExtendedInfo.propertyBag = propertyBag;
+ } else if ("internalPropertyBag".equals(fieldName)) {
+ Map internalPropertyBag = reader.readMap(reader1 -> reader1.getString());
+ deserializedAzureIaaSvmJobExtendedInfo.internalPropertyBag = internalPropertyBag;
+ } else if ("progressPercentage".equals(fieldName)) {
+ deserializedAzureIaaSvmJobExtendedInfo.progressPercentage
+ = reader.getNullable(JsonReader::getDouble);
+ } else if ("estimatedRemainingDuration".equals(fieldName)) {
+ deserializedAzureIaaSvmJobExtendedInfo.estimatedRemainingDuration = reader.getString();
+ } else if ("dynamicErrorMessage".equals(fieldName)) {
+ deserializedAzureIaaSvmJobExtendedInfo.dynamicErrorMessage = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSvmJobExtendedInfo;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobTaskDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobTaskDetails.java
index a325499d0ed9f..80c5baccd64d3 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobTaskDetails.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobTaskDetails.java
@@ -5,62 +5,60 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.Duration;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
/**
* Azure IaaS VM workload-specific job task details.
*/
@Fluent
-public final class AzureIaaSvmJobTaskDetails {
+public final class AzureIaaSvmJobTaskDetails implements JsonSerializable {
/*
* The task display name.
*/
- @JsonProperty(value = "taskId")
private String taskId;
/*
* The start time.
*/
- @JsonProperty(value = "startTime")
private OffsetDateTime startTime;
/*
* The end time.
*/
- @JsonProperty(value = "endTime")
private OffsetDateTime endTime;
/*
* The instanceId.
*/
- @JsonProperty(value = "instanceId")
private String instanceId;
/*
* Time elapsed for task.
*/
- @JsonProperty(value = "duration")
private Duration duration;
/*
* The status.
*/
- @JsonProperty(value = "status")
private String status;
/*
* Progress of the task.
*/
- @JsonProperty(value = "progressPercentage")
private Double progressPercentage;
/*
* Details about execution of the task.
* eg: number of bytes transferred etc
*/
- @JsonProperty(value = "taskExecutionDetails")
private String taskExecutionDetails;
/**
@@ -238,4 +236,67 @@ public AzureIaaSvmJobTaskDetails withTaskExecutionDetails(String taskExecutionDe
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("taskId", this.taskId);
+ jsonWriter.writeStringField("startTime",
+ this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime));
+ jsonWriter.writeStringField("endTime",
+ this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime));
+ jsonWriter.writeStringField("instanceId", this.instanceId);
+ jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration));
+ jsonWriter.writeStringField("status", this.status);
+ jsonWriter.writeNumberField("progressPercentage", this.progressPercentage);
+ jsonWriter.writeStringField("taskExecutionDetails", this.taskExecutionDetails);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSvmJobTaskDetails from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSvmJobTaskDetails if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSvmJobTaskDetails.
+ */
+ public static AzureIaaSvmJobTaskDetails fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSvmJobTaskDetails deserializedAzureIaaSvmJobTaskDetails = new AzureIaaSvmJobTaskDetails();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("taskId".equals(fieldName)) {
+ deserializedAzureIaaSvmJobTaskDetails.taskId = reader.getString();
+ } else if ("startTime".equals(fieldName)) {
+ deserializedAzureIaaSvmJobTaskDetails.startTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("endTime".equals(fieldName)) {
+ deserializedAzureIaaSvmJobTaskDetails.endTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("instanceId".equals(fieldName)) {
+ deserializedAzureIaaSvmJobTaskDetails.instanceId = reader.getString();
+ } else if ("duration".equals(fieldName)) {
+ deserializedAzureIaaSvmJobTaskDetails.duration
+ = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()));
+ } else if ("status".equals(fieldName)) {
+ deserializedAzureIaaSvmJobTaskDetails.status = reader.getString();
+ } else if ("progressPercentage".equals(fieldName)) {
+ deserializedAzureIaaSvmJobTaskDetails.progressPercentage
+ = reader.getNullable(JsonReader::getDouble);
+ } else if ("taskExecutionDetails".equals(fieldName)) {
+ deserializedAzureIaaSvmJobTaskDetails.taskExecutionDetails = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSvmJobTaskDetails;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobV2.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobV2.java
index d7dd9a73a52a0..a659d61a8844c 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobV2.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobV2.java
@@ -5,62 +5,55 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.Duration;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
/**
* Azure IaaS VM workload-specific job object.
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "jobType", defaultImpl = AzureIaaSvmJobV2.class, visible = true)
-@JsonTypeName("AzureIaaSVMJobV2")
@Fluent
public final class AzureIaaSvmJobV2 extends Job {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "jobType", required = true)
private String jobType = "AzureIaaSVMJobV2";
/*
* Gets or sets the state/actions applicable on this job like cancel/retry.
*/
- @JsonProperty(value = "actionsInfo")
private List actionsInfo;
/*
* Container name of the entity on which the current job is executing.
*/
- @JsonProperty(value = "containerName")
private String containerName;
/*
* Time elapsed during the execution of this job.
*/
- @JsonProperty(value = "duration")
private Duration duration;
/*
* Error details on execution of this job.
*/
- @JsonProperty(value = "errorDetails")
private List errorDetails;
/*
* Specifies whether the backup item is a Classic or an Azure Resource Manager VM.
*/
- @JsonProperty(value = "virtualMachineVersion")
private String virtualMachineVersion;
/*
* Additional information for this job.
*/
- @JsonProperty(value = "extendedInfo")
private AzureIaaSvmJobExtendedInfo extendedInfo;
/**
@@ -272,7 +265,6 @@ public AzureIaaSvmJobV2 withActivityId(String activityId) {
*/
@Override
public void validate() {
- super.validate();
if (errorDetails() != null) {
errorDetails().forEach(e -> e.validate());
}
@@ -280,4 +272,91 @@ public void validate() {
extendedInfo().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("entityFriendlyName", entityFriendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("operation", operation());
+ jsonWriter.writeStringField("status", status());
+ jsonWriter.writeStringField("startTime",
+ startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime()));
+ jsonWriter.writeStringField("endTime",
+ endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime()));
+ jsonWriter.writeStringField("activityId", activityId());
+ jsonWriter.writeStringField("jobType", this.jobType);
+ jsonWriter.writeArrayField("actionsInfo", this.actionsInfo,
+ (writer, element) -> writer.writeString(element == null ? null : element.toString()));
+ jsonWriter.writeStringField("containerName", this.containerName);
+ jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration));
+ jsonWriter.writeArrayField("errorDetails", this.errorDetails, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("virtualMachineVersion", this.virtualMachineVersion);
+ jsonWriter.writeJsonField("extendedInfo", this.extendedInfo);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSvmJobV2 from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSvmJobV2 if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSvmJobV2.
+ */
+ public static AzureIaaSvmJobV2 fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSvmJobV2 deserializedAzureIaaSvmJobV2 = new AzureIaaSvmJobV2();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("entityFriendlyName".equals(fieldName)) {
+ deserializedAzureIaaSvmJobV2.withEntityFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureIaaSvmJobV2
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("operation".equals(fieldName)) {
+ deserializedAzureIaaSvmJobV2.withOperation(reader.getString());
+ } else if ("status".equals(fieldName)) {
+ deserializedAzureIaaSvmJobV2.withStatus(reader.getString());
+ } else if ("startTime".equals(fieldName)) {
+ deserializedAzureIaaSvmJobV2.withStartTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("endTime".equals(fieldName)) {
+ deserializedAzureIaaSvmJobV2.withEndTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("activityId".equals(fieldName)) {
+ deserializedAzureIaaSvmJobV2.withActivityId(reader.getString());
+ } else if ("jobType".equals(fieldName)) {
+ deserializedAzureIaaSvmJobV2.jobType = reader.getString();
+ } else if ("actionsInfo".equals(fieldName)) {
+ List actionsInfo
+ = reader.readArray(reader1 -> JobSupportedAction.fromString(reader1.getString()));
+ deserializedAzureIaaSvmJobV2.actionsInfo = actionsInfo;
+ } else if ("containerName".equals(fieldName)) {
+ deserializedAzureIaaSvmJobV2.containerName = reader.getString();
+ } else if ("duration".equals(fieldName)) {
+ deserializedAzureIaaSvmJobV2.duration
+ = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()));
+ } else if ("errorDetails".equals(fieldName)) {
+ List errorDetails
+ = reader.readArray(reader1 -> AzureIaaSvmErrorInfo.fromJson(reader1));
+ deserializedAzureIaaSvmJobV2.errorDetails = errorDetails;
+ } else if ("virtualMachineVersion".equals(fieldName)) {
+ deserializedAzureIaaSvmJobV2.virtualMachineVersion = reader.getString();
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureIaaSvmJobV2.extendedInfo = AzureIaaSvmJobExtendedInfo.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSvmJobV2;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.java
index cec2cb414f76c..9456cb39fe06e 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.java
@@ -5,112 +5,101 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
/**
* IaaS VM workload-specific backup item.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectedItemType",
- defaultImpl = AzureIaaSvmProtectedItem.class,
- visible = true)
-@JsonTypeName("AzureIaaSVMProtectedItem")
-@JsonSubTypes({
- @JsonSubTypes.Type(
- name = "Microsoft.ClassicCompute/virtualMachines",
- value = AzureIaaSClassicComputeVMProtectedItem.class),
- @JsonSubTypes.Type(name = "Microsoft.Compute/virtualMachines", value = AzureIaaSComputeVMProtectedItem.class) })
@Fluent
public class AzureIaaSvmProtectedItem extends ProtectedItem {
/*
* backup item type.
*/
- @JsonTypeId
- @JsonProperty(value = "protectedItemType", required = true)
private String protectedItemType = "AzureIaaSVMProtectedItem";
/*
* Friendly name of the VM represented by this backup item.
*/
- @JsonProperty(value = "friendlyName", access = JsonProperty.Access.WRITE_ONLY)
private String friendlyName;
/*
* Fully qualified ARM ID of the virtual machine represented by this item.
*/
- @JsonProperty(value = "virtualMachineId", access = JsonProperty.Access.WRITE_ONLY)
private String virtualMachineId;
/*
* Backup status of this backup item.
*/
- @JsonProperty(value = "protectionStatus")
private String protectionStatus;
/*
* Backup state of this backup item.
*/
- @JsonProperty(value = "protectionState")
private ProtectionState protectionState;
/*
* Health status of protected item.
*/
- @JsonProperty(value = "healthStatus", access = JsonProperty.Access.WRITE_ONLY)
private HealthStatus healthStatus;
/*
* Health details on this backup item.
*/
- @JsonProperty(value = "healthDetails")
private List healthDetails;
/*
* Health details of different KPIs
*/
- @JsonProperty(value = "kpisHealths")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map kpisHealths;
/*
* Last backup operation status.
*/
- @JsonProperty(value = "lastBackupStatus")
private String lastBackupStatus;
/*
* Timestamp of the last backup operation on this backup item.
*/
- @JsonProperty(value = "lastBackupTime", access = JsonProperty.Access.WRITE_ONLY)
private OffsetDateTime lastBackupTime;
/*
* Data ID of the protected item.
*/
- @JsonProperty(value = "protectedItemDataId", access = JsonProperty.Access.WRITE_ONLY)
private String protectedItemDataId;
/*
* Additional information for this backup item.
*/
- @JsonProperty(value = "extendedInfo")
private AzureIaaSvmProtectedItemExtendedInfo extendedInfo;
/*
* Extended Properties for Azure IaasVM Backup.
*/
- @JsonProperty(value = "extendedProperties")
private ExtendedProperties extendedProperties;
+ /*
+ * ID of the vault which protects this item
+ */
+ private String vaultId;
+
+ /*
+ * Type of workload this item represents.
+ */
+ private DataSourceTypeAutoGenerated3 workloadType;
+
+ /*
+ * Type of backup management for the backed up item.
+ */
+ private BackupManagementType backupManagementType;
+
/**
* Creates an instance of AzureIaaSvmProtectedItem class.
*/
@@ -136,6 +125,17 @@ public String friendlyName() {
return this.friendlyName;
}
+ /**
+ * Set the friendlyName property: Friendly name of the VM represented by this backup item.
+ *
+ * @param friendlyName the friendlyName value to set.
+ * @return the AzureIaaSvmProtectedItem object itself.
+ */
+ AzureIaaSvmProtectedItem withFriendlyName(String friendlyName) {
+ this.friendlyName = friendlyName;
+ return this;
+ }
+
/**
* Get the virtualMachineId property: Fully qualified ARM ID of the virtual machine represented by this item.
*
@@ -145,6 +145,17 @@ public String virtualMachineId() {
return this.virtualMachineId;
}
+ /**
+ * Set the virtualMachineId property: Fully qualified ARM ID of the virtual machine represented by this item.
+ *
+ * @param virtualMachineId the virtualMachineId value to set.
+ * @return the AzureIaaSvmProtectedItem object itself.
+ */
+ AzureIaaSvmProtectedItem withVirtualMachineId(String virtualMachineId) {
+ this.virtualMachineId = virtualMachineId;
+ return this;
+ }
+
/**
* Get the protectionStatus property: Backup status of this backup item.
*
@@ -194,6 +205,17 @@ public HealthStatus healthStatus() {
return this.healthStatus;
}
+ /**
+ * Set the healthStatus property: Health status of protected item.
+ *
+ * @param healthStatus the healthStatus value to set.
+ * @return the AzureIaaSvmProtectedItem object itself.
+ */
+ AzureIaaSvmProtectedItem withHealthStatus(HealthStatus healthStatus) {
+ this.healthStatus = healthStatus;
+ return this;
+ }
+
/**
* Get the healthDetails property: Health details on this backup item.
*
@@ -263,6 +285,17 @@ public OffsetDateTime lastBackupTime() {
return this.lastBackupTime;
}
+ /**
+ * Set the lastBackupTime property: Timestamp of the last backup operation on this backup item.
+ *
+ * @param lastBackupTime the lastBackupTime value to set.
+ * @return the AzureIaaSvmProtectedItem object itself.
+ */
+ AzureIaaSvmProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) {
+ this.lastBackupTime = lastBackupTime;
+ return this;
+ }
+
/**
* Get the protectedItemDataId property: Data ID of the protected item.
*
@@ -272,6 +305,17 @@ public String protectedItemDataId() {
return this.protectedItemDataId;
}
+ /**
+ * Set the protectedItemDataId property: Data ID of the protected item.
+ *
+ * @param protectedItemDataId the protectedItemDataId value to set.
+ * @return the AzureIaaSvmProtectedItem object itself.
+ */
+ AzureIaaSvmProtectedItem withProtectedItemDataId(String protectedItemDataId) {
+ this.protectedItemDataId = protectedItemDataId;
+ return this;
+ }
+
/**
* Get the extendedInfo property: Additional information for this backup item.
*
@@ -312,6 +356,36 @@ public AzureIaaSvmProtectedItem withExtendedProperties(ExtendedProperties extend
return this;
}
+ /**
+ * Get the vaultId property: ID of the vault which protects this item.
+ *
+ * @return the vaultId value.
+ */
+ @Override
+ public String vaultId() {
+ return this.vaultId;
+ }
+
+ /**
+ * Get the workloadType property: Type of workload this item represents.
+ *
+ * @return the workloadType value.
+ */
+ @Override
+ public DataSourceTypeAutoGenerated3 workloadType() {
+ return this.workloadType;
+ }
+
+ /**
+ * Get the backupManagementType property: Type of backup management for the backed up item.
+ *
+ * @return the backupManagementType value.
+ */
+ @Override
+ public BackupManagementType backupManagementType() {
+ return this.backupManagementType;
+ }
+
/**
* {@inheritDoc}
*/
@@ -454,7 +528,6 @@ public AzureIaaSvmProtectedItem withSoftDeleteRetentionPeriod(Integer softDelete
*/
@Override
public void validate() {
- super.validate();
if (healthDetails() != null) {
healthDetails().forEach(e -> e.validate());
}
@@ -472,4 +545,172 @@ public void validate() {
extendedProperties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("containerName", containerName());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("lastRecoveryPoint",
+ lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint()));
+ jsonWriter.writeStringField("backupSetName", backupSetName());
+ jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString());
+ jsonWriter.writeStringField("deferredDeleteTimeInUTC",
+ deferredDeleteTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc()));
+ jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete());
+ jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining());
+ jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming());
+ jsonWriter.writeBooleanField("isRehydrate", isRehydrate());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled());
+ jsonWriter.writeStringField("policyName", policyName());
+ jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriod());
+ jsonWriter.writeStringField("protectedItemType", this.protectedItemType);
+ jsonWriter.writeStringField("protectionStatus", this.protectionStatus);
+ jsonWriter.writeStringField("protectionState",
+ this.protectionState == null ? null : this.protectionState.toString());
+ jsonWriter.writeArrayField("healthDetails", this.healthDetails, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeMapField("kpisHealths", this.kpisHealths, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("lastBackupStatus", this.lastBackupStatus);
+ jsonWriter.writeJsonField("extendedInfo", this.extendedInfo);
+ jsonWriter.writeJsonField("extendedProperties", this.extendedProperties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSvmProtectedItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSvmProtectedItem if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSvmProtectedItem.
+ */
+ public static AzureIaaSvmProtectedItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("protectedItemType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("Microsoft.ClassicCompute/virtualMachines".equals(discriminatorValue)) {
+ return AzureIaaSClassicComputeVMProtectedItem.fromJson(readerToUse.reset());
+ } else if ("Microsoft.Compute/virtualMachines".equals(discriminatorValue)) {
+ return AzureIaaSComputeVMProtectedItem.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static AzureIaaSvmProtectedItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSvmProtectedItem deserializedAzureIaaSvmProtectedItem = new AzureIaaSvmProtectedItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.backupManagementType
+ = BackupManagementType.fromString(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.workloadType
+ = DataSourceTypeAutoGenerated3.fromString(reader.getString());
+ } else if ("containerName".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.withContainerName(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.withSourceResourceId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.withPolicyId(reader.getString());
+ } else if ("lastRecoveryPoint".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.withLastRecoveryPoint(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("backupSetName".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.withBackupSetName(reader.getString());
+ } else if ("createMode".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.withCreateMode(CreateMode.fromString(reader.getString()));
+ } else if ("deferredDeleteTimeInUTC".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.withDeferredDeleteTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("isScheduledForDeferredDelete".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem
+ .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean));
+ } else if ("deferredDeleteTimeRemaining".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.withDeferredDeleteTimeRemaining(reader.getString());
+ } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem
+ .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isRehydrate".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.withIsRehydrate(reader.getNullable(JsonReader::getBoolean));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureIaaSvmProtectedItem
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("isArchiveEnabled".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem
+ .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean));
+ } else if ("policyName".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.withPolicyName(reader.getString());
+ } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem
+ .withSoftDeleteRetentionPeriod(reader.getNullable(JsonReader::getInt));
+ } else if ("vaultId".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.vaultId = reader.getString();
+ } else if ("protectedItemType".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.protectedItemType = reader.getString();
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.friendlyName = reader.getString();
+ } else if ("virtualMachineId".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.virtualMachineId = reader.getString();
+ } else if ("protectionStatus".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.protectionStatus = reader.getString();
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.protectionState
+ = ProtectionState.fromString(reader.getString());
+ } else if ("healthStatus".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.healthStatus = HealthStatus.fromString(reader.getString());
+ } else if ("healthDetails".equals(fieldName)) {
+ List healthDetails
+ = reader.readArray(reader1 -> AzureIaaSvmHealthDetails.fromJson(reader1));
+ deserializedAzureIaaSvmProtectedItem.healthDetails = healthDetails;
+ } else if ("kpisHealths".equals(fieldName)) {
+ Map kpisHealths
+ = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1));
+ deserializedAzureIaaSvmProtectedItem.kpisHealths = kpisHealths;
+ } else if ("lastBackupStatus".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.lastBackupStatus = reader.getString();
+ } else if ("lastBackupTime".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.lastBackupTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("protectedItemDataId".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.protectedItemDataId = reader.getString();
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.extendedInfo
+ = AzureIaaSvmProtectedItemExtendedInfo.fromJson(reader);
+ } else if ("extendedProperties".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItem.extendedProperties = ExtendedProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSvmProtectedItem;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItemExtendedInfo.java
index 0ae31dee8c2fa..712a7985af73f 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItemExtendedInfo.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItemExtendedInfo.java
@@ -5,48 +5,49 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
/**
* Additional information on Azure IaaS VM specific backup item.
*/
@Fluent
-public final class AzureIaaSvmProtectedItemExtendedInfo {
+public final class AzureIaaSvmProtectedItemExtendedInfo
+ implements JsonSerializable {
/*
* The oldest backup copy available for this backup item across all tiers.
*/
- @JsonProperty(value = "oldestRecoveryPoint")
private OffsetDateTime oldestRecoveryPoint;
/*
* The oldest backup copy available for this backup item in vault tier
*/
- @JsonProperty(value = "oldestRecoveryPointInVault")
private OffsetDateTime oldestRecoveryPointInVault;
/*
* The oldest backup copy available for this backup item in archive tier
*/
- @JsonProperty(value = "oldestRecoveryPointInArchive")
private OffsetDateTime oldestRecoveryPointInArchive;
/*
* The latest backup copy available for this backup item in archive tier
*/
- @JsonProperty(value = "newestRecoveryPointInArchive")
private OffsetDateTime newestRecoveryPointInArchive;
/*
* Number of backup copies available for this backup item.
*/
- @JsonProperty(value = "recoveryPointCount")
private Integer recoveryPointCount;
/*
* Specifies if backup policy associated with the backup item is inconsistent.
*/
- @JsonProperty(value = "policyInconsistent")
private Boolean policyInconsistent;
/**
@@ -189,4 +190,74 @@ public AzureIaaSvmProtectedItemExtendedInfo withPolicyInconsistent(Boolean polic
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("oldestRecoveryPoint",
+ this.oldestRecoveryPoint == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPoint));
+ jsonWriter.writeStringField("oldestRecoveryPointInVault",
+ this.oldestRecoveryPointInVault == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPointInVault));
+ jsonWriter.writeStringField("oldestRecoveryPointInArchive",
+ this.oldestRecoveryPointInArchive == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPointInArchive));
+ jsonWriter.writeStringField("newestRecoveryPointInArchive",
+ this.newestRecoveryPointInArchive == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.newestRecoveryPointInArchive));
+ jsonWriter.writeNumberField("recoveryPointCount", this.recoveryPointCount);
+ jsonWriter.writeBooleanField("policyInconsistent", this.policyInconsistent);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSvmProtectedItemExtendedInfo from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSvmProtectedItemExtendedInfo if the JsonReader was pointing to an instance of it,
+ * or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSvmProtectedItemExtendedInfo.
+ */
+ public static AzureIaaSvmProtectedItemExtendedInfo fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSvmProtectedItemExtendedInfo deserializedAzureIaaSvmProtectedItemExtendedInfo
+ = new AzureIaaSvmProtectedItemExtendedInfo();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("oldestRecoveryPoint".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItemExtendedInfo.oldestRecoveryPoint = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("oldestRecoveryPointInVault".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItemExtendedInfo.oldestRecoveryPointInVault = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("oldestRecoveryPointInArchive".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItemExtendedInfo.oldestRecoveryPointInArchive = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("newestRecoveryPointInArchive".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItemExtendedInfo.newestRecoveryPointInArchive = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("recoveryPointCount".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItemExtendedInfo.recoveryPointCount
+ = reader.getNullable(JsonReader::getInt);
+ } else if ("policyInconsistent".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectedItemExtendedInfo.policyInconsistent
+ = reader.getNullable(JsonReader::getBoolean);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSvmProtectedItemExtendedInfo;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java
index 76b062227d6d0..50cd11dcebf14 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java
@@ -5,48 +5,37 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* IaaS VM workload-specific backup policy.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "backupManagementType",
- defaultImpl = AzureIaaSvmProtectionPolicy.class,
- visible = true)
-@JsonTypeName("AzureIaasVM")
@Fluent
public final class AzureIaaSvmProtectionPolicy extends ProtectionPolicy {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "backupManagementType", required = true)
private String backupManagementType = "AzureIaasVM";
/*
* The instantRPDetails property.
*/
- @JsonProperty(value = "instantRPDetails")
private InstantRPAdditionalDetails instantRPDetails;
/*
* Backup schedule specified as part of backup policy.
*/
- @JsonProperty(value = "schedulePolicy")
private SchedulePolicy schedulePolicy;
/*
* Retention policy with the details on backup copy retention ranges.
*/
- @JsonProperty(value = "retentionPolicy")
private RetentionPolicy retentionPolicy;
/*
@@ -54,32 +43,26 @@ public final class AzureIaaSvmProtectionPolicy extends ProtectionPolicy {
* Key is Target Tier, defined in RecoveryPointTierType enum.
* Tiering policy specifies the criteria to move RP to the target tier.
*/
- @JsonProperty(value = "tieringPolicy")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map tieringPolicy;
/*
* Instant RP retention policy range in days
*/
- @JsonProperty(value = "instantRpRetentionRangeInDays")
private Integer instantRpRetentionRangeInDays;
/*
* TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
*/
- @JsonProperty(value = "timeZone")
private String timeZone;
/*
* The policyType property.
*/
- @JsonProperty(value = "policyType")
private IaasvmPolicyType policyType;
/*
* The snapshotConsistencyType property.
*/
- @JsonProperty(value = "snapshotConsistencyType")
private IaasVMSnapshotConsistencyType snapshotConsistencyType;
/**
@@ -289,7 +272,6 @@ public AzureIaaSvmProtectionPolicy withResourceGuardOperationRequests(List writer.writeString(element));
+ jsonWriter.writeStringField("backupManagementType", this.backupManagementType);
+ jsonWriter.writeJsonField("instantRPDetails", this.instantRPDetails);
+ jsonWriter.writeJsonField("schedulePolicy", this.schedulePolicy);
+ jsonWriter.writeJsonField("retentionPolicy", this.retentionPolicy);
+ jsonWriter.writeMapField("tieringPolicy", this.tieringPolicy, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeNumberField("instantRpRetentionRangeInDays", this.instantRpRetentionRangeInDays);
+ jsonWriter.writeStringField("timeZone", this.timeZone);
+ jsonWriter.writeStringField("policyType", this.policyType == null ? null : this.policyType.toString());
+ jsonWriter.writeStringField("snapshotConsistencyType",
+ this.snapshotConsistencyType == null ? null : this.snapshotConsistencyType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureIaaSvmProtectionPolicy from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureIaaSvmProtectionPolicy if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureIaaSvmProtectionPolicy.
+ */
+ public static AzureIaaSvmProtectionPolicy fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureIaaSvmProtectionPolicy deserializedAzureIaaSvmProtectionPolicy = new AzureIaaSvmProtectionPolicy();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("protectedItemsCount".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectionPolicy
+ .withProtectedItemsCount(reader.getNullable(JsonReader::getInt));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureIaaSvmProtectionPolicy
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectionPolicy.backupManagementType = reader.getString();
+ } else if ("instantRPDetails".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectionPolicy.instantRPDetails
+ = InstantRPAdditionalDetails.fromJson(reader);
+ } else if ("schedulePolicy".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectionPolicy.schedulePolicy = SchedulePolicy.fromJson(reader);
+ } else if ("retentionPolicy".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectionPolicy.retentionPolicy = RetentionPolicy.fromJson(reader);
+ } else if ("tieringPolicy".equals(fieldName)) {
+ Map tieringPolicy
+ = reader.readMap(reader1 -> TieringPolicy.fromJson(reader1));
+ deserializedAzureIaaSvmProtectionPolicy.tieringPolicy = tieringPolicy;
+ } else if ("instantRpRetentionRangeInDays".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectionPolicy.instantRpRetentionRangeInDays
+ = reader.getNullable(JsonReader::getInt);
+ } else if ("timeZone".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectionPolicy.timeZone = reader.getString();
+ } else if ("policyType".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectionPolicy.policyType
+ = IaasvmPolicyType.fromString(reader.getString());
+ } else if ("snapshotConsistencyType".equals(fieldName)) {
+ deserializedAzureIaaSvmProtectionPolicy.snapshotConsistencyType
+ = IaasVMSnapshotConsistencyType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureIaaSvmProtectionPolicy;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java
index 64a7882254aa1..c81f15c90c5f0 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java
@@ -5,30 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure Recovery Services Vault specific protection intent item.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectionIntentItemType",
- defaultImpl = AzureRecoveryServiceVaultProtectionIntent.class,
- visible = true)
-@JsonTypeName("RecoveryServiceVaultItem")
-@JsonSubTypes({
- @JsonSubTypes.Type(name = "AzureWorkloadAutoProtectionIntent", value = AzureWorkloadAutoProtectionIntent.class) })
@Fluent
public class AzureRecoveryServiceVaultProtectionIntent extends ProtectionIntent {
/*
* backup protectionIntent type.
*/
- @JsonTypeId
- @JsonProperty(value = "protectionIntentItemType", required = true)
private ProtectionIntentItemType protectionIntentItemType = ProtectionIntentItemType.RECOVERY_SERVICE_VAULT_ITEM;
/**
@@ -100,6 +89,90 @@ public AzureRecoveryServiceVaultProtectionIntent withProtectionState(ProtectionS
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("itemId", itemId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("protectionIntentItemType",
+ this.protectionIntentItemType == null ? null : this.protectionIntentItemType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureRecoveryServiceVaultProtectionIntent from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureRecoveryServiceVaultProtectionIntent if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureRecoveryServiceVaultProtectionIntent.
+ */
+ public static AzureRecoveryServiceVaultProtectionIntent fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("protectionIntentItemType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("AzureWorkloadAutoProtectionIntent".equals(discriminatorValue)) {
+ return AzureWorkloadAutoProtectionIntent.fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadSQLAutoProtectionIntent".equals(discriminatorValue)) {
+ return AzureWorkloadSqlAutoProtectionIntent.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static AzureRecoveryServiceVaultProtectionIntent fromJsonKnownDiscriminator(JsonReader jsonReader)
+ throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureRecoveryServiceVaultProtectionIntent deserializedAzureRecoveryServiceVaultProtectionIntent
+ = new AzureRecoveryServiceVaultProtectionIntent();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureRecoveryServiceVaultProtectionIntent
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureRecoveryServiceVaultProtectionIntent.withSourceResourceId(reader.getString());
+ } else if ("itemId".equals(fieldName)) {
+ deserializedAzureRecoveryServiceVaultProtectionIntent.withItemId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureRecoveryServiceVaultProtectionIntent.withPolicyId(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureRecoveryServiceVaultProtectionIntent
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("protectionIntentItemType".equals(fieldName)) {
+ deserializedAzureRecoveryServiceVaultProtectionIntent.protectionIntentItemType
+ = ProtectionIntentItemType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureRecoveryServiceVaultProtectionIntent;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureResourceProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureResourceProtectionIntent.java
index af56f10d8efe5..1a3edffbcb13c 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureResourceProtectionIntent.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureResourceProtectionIntent.java
@@ -5,33 +5,24 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* IaaS VM specific backup protection intent item.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectionIntentItemType",
- defaultImpl = AzureResourceProtectionIntent.class,
- visible = true)
-@JsonTypeName("AzureResourceItem")
@Fluent
public final class AzureResourceProtectionIntent extends ProtectionIntent {
/*
* backup protectionIntent type.
*/
- @JsonTypeId
- @JsonProperty(value = "protectionIntentItemType", required = true)
private ProtectionIntentItemType protectionIntentItemType = ProtectionIntentItemType.AZURE_RESOURCE_ITEM;
/*
* Friendly name of the VM represented by this backup item.
*/
- @JsonProperty(value = "friendlyName")
private String friendlyName;
/**
@@ -122,6 +113,65 @@ public AzureResourceProtectionIntent withProtectionState(ProtectionStatus protec
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("itemId", itemId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("protectionIntentItemType",
+ this.protectionIntentItemType == null ? null : this.protectionIntentItemType.toString());
+ jsonWriter.writeStringField("friendlyName", this.friendlyName);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureResourceProtectionIntent from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureResourceProtectionIntent if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureResourceProtectionIntent.
+ */
+ public static AzureResourceProtectionIntent fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureResourceProtectionIntent deserializedAzureResourceProtectionIntent
+ = new AzureResourceProtectionIntent();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureResourceProtectionIntent
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureResourceProtectionIntent.withSourceResourceId(reader.getString());
+ } else if ("itemId".equals(fieldName)) {
+ deserializedAzureResourceProtectionIntent.withItemId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureResourceProtectionIntent.withPolicyId(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureResourceProtectionIntent
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("protectionIntentItemType".equals(fieldName)) {
+ deserializedAzureResourceProtectionIntent.protectionIntentItemType
+ = ProtectionIntentItemType.fromString(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureResourceProtectionIntent.friendlyName = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureResourceProtectionIntent;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.java
index 372031b6c981e..3543457f5d265 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.java
@@ -5,30 +5,23 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure Sql workload-specific container.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "containerType",
- defaultImpl = AzureSqlContainer.class,
- visible = true)
-@JsonTypeName("AzureSqlContainer")
@Fluent
public final class AzureSqlContainer extends ProtectionContainer {
/*
- * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2.
+ * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines
+ * 2.
* Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is
* Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload
* Backup is VMAppContainer
*/
- @JsonTypeId
- @JsonProperty(value = "containerType", required = true)
private ProtectableContainerType containerType = ProtectableContainerType.AZURE_SQL_CONTAINER;
/**
@@ -103,6 +96,59 @@ public AzureSqlContainer withProtectableObjectType(String protectableObjectType)
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("registrationStatus", registrationStatus());
+ jsonWriter.writeStringField("healthStatus", healthStatus());
+ jsonWriter.writeStringField("protectableObjectType", protectableObjectType());
+ jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureSqlContainer from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureSqlContainer if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureSqlContainer.
+ */
+ public static AzureSqlContainer fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureSqlContainer deserializedAzureSqlContainer = new AzureSqlContainer();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("friendlyName".equals(fieldName)) {
+ deserializedAzureSqlContainer.withFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureSqlContainer
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("registrationStatus".equals(fieldName)) {
+ deserializedAzureSqlContainer.withRegistrationStatus(reader.getString());
+ } else if ("healthStatus".equals(fieldName)) {
+ deserializedAzureSqlContainer.withHealthStatus(reader.getString());
+ } else if ("protectableObjectType".equals(fieldName)) {
+ deserializedAzureSqlContainer.withProtectableObjectType(reader.getString());
+ } else if ("containerType".equals(fieldName)) {
+ deserializedAzureSqlContainer.containerType
+ = ProtectableContainerType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureSqlContainer;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java
index babb0a4048f53..9b527ad45ed5f 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java
@@ -5,49 +5,55 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
/**
* Azure SQL workload-specific backup item.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectedItemType",
- defaultImpl = AzureSqlProtectedItem.class,
- visible = true)
-@JsonTypeName("Microsoft.Sql/servers/databases")
@Fluent
public final class AzureSqlProtectedItem extends ProtectedItem {
/*
* backup item type.
*/
- @JsonTypeId
- @JsonProperty(value = "protectedItemType", required = true)
private String protectedItemType = "Microsoft.Sql/servers/databases";
/*
* Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services.
*/
- @JsonProperty(value = "protectedItemDataId")
private String protectedItemDataId;
/*
* Backup state of the backed up item.
*/
- @JsonProperty(value = "protectionState")
private ProtectedItemState protectionState;
/*
* Additional information for this backup item.
*/
- @JsonProperty(value = "extendedInfo")
private AzureSqlProtectedItemExtendedInfo extendedInfo;
+ /*
+ * ID of the vault which protects this item
+ */
+ private String vaultId;
+
+ /*
+ * Type of workload this item represents.
+ */
+ private DataSourceTypeAutoGenerated3 workloadType;
+
+ /*
+ * Type of backup management for the backed up item.
+ */
+ private BackupManagementType backupManagementType;
+
/**
* Creates an instance of AzureSqlProtectedItem class.
*/
@@ -126,6 +132,36 @@ public AzureSqlProtectedItem withExtendedInfo(AzureSqlProtectedItemExtendedInfo
return this;
}
+ /**
+ * Get the vaultId property: ID of the vault which protects this item.
+ *
+ * @return the vaultId value.
+ */
+ @Override
+ public String vaultId() {
+ return this.vaultId;
+ }
+
+ /**
+ * Get the workloadType property: Type of workload this item represents.
+ *
+ * @return the workloadType value.
+ */
+ @Override
+ public DataSourceTypeAutoGenerated3 workloadType() {
+ return this.workloadType;
+ }
+
+ /**
+ * Get the backupManagementType property: Type of backup management for the backed up item.
+ *
+ * @return the backupManagementType value.
+ */
+ @Override
+ public BackupManagementType backupManagementType() {
+ return this.backupManagementType;
+ }
+
/**
* {@inheritDoc}
*/
@@ -268,9 +304,120 @@ public AzureSqlProtectedItem withSoftDeleteRetentionPeriod(Integer softDeleteRet
*/
@Override
public void validate() {
- super.validate();
if (extendedInfo() != null) {
extendedInfo().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("containerName", containerName());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("lastRecoveryPoint",
+ lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint()));
+ jsonWriter.writeStringField("backupSetName", backupSetName());
+ jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString());
+ jsonWriter.writeStringField("deferredDeleteTimeInUTC",
+ deferredDeleteTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc()));
+ jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete());
+ jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining());
+ jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming());
+ jsonWriter.writeBooleanField("isRehydrate", isRehydrate());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled());
+ jsonWriter.writeStringField("policyName", policyName());
+ jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriod());
+ jsonWriter.writeStringField("protectedItemType", this.protectedItemType);
+ jsonWriter.writeStringField("protectedItemDataId", this.protectedItemDataId);
+ jsonWriter.writeStringField("protectionState",
+ this.protectionState == null ? null : this.protectionState.toString());
+ jsonWriter.writeJsonField("extendedInfo", this.extendedInfo);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureSqlProtectedItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureSqlProtectedItem if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureSqlProtectedItem.
+ */
+ public static AzureSqlProtectedItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureSqlProtectedItem deserializedAzureSqlProtectedItem = new AzureSqlProtectedItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.backupManagementType
+ = BackupManagementType.fromString(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.workloadType
+ = DataSourceTypeAutoGenerated3.fromString(reader.getString());
+ } else if ("containerName".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.withContainerName(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.withSourceResourceId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.withPolicyId(reader.getString());
+ } else if ("lastRecoveryPoint".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.withLastRecoveryPoint(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("backupSetName".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.withBackupSetName(reader.getString());
+ } else if ("createMode".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.withCreateMode(CreateMode.fromString(reader.getString()));
+ } else if ("deferredDeleteTimeInUTC".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.withDeferredDeleteTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("isScheduledForDeferredDelete".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem
+ .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean));
+ } else if ("deferredDeleteTimeRemaining".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.withDeferredDeleteTimeRemaining(reader.getString());
+ } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem
+ .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isRehydrate".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.withIsRehydrate(reader.getNullable(JsonReader::getBoolean));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureSqlProtectedItem
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("isArchiveEnabled".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean));
+ } else if ("policyName".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.withPolicyName(reader.getString());
+ } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem
+ .withSoftDeleteRetentionPeriod(reader.getNullable(JsonReader::getInt));
+ } else if ("vaultId".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.vaultId = reader.getString();
+ } else if ("protectedItemType".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.protectedItemType = reader.getString();
+ } else if ("protectedItemDataId".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.protectedItemDataId = reader.getString();
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.protectionState
+ = ProtectedItemState.fromString(reader.getString());
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureSqlProtectedItem.extendedInfo = AzureSqlProtectedItemExtendedInfo.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureSqlProtectedItem;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItemExtendedInfo.java
index 66aaf3b59bc55..3d33d5eac5754 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItemExtendedInfo.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItemExtendedInfo.java
@@ -5,30 +5,33 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
/**
* Additional information on Azure Sql specific protected item.
*/
@Fluent
-public final class AzureSqlProtectedItemExtendedInfo {
+public final class AzureSqlProtectedItemExtendedInfo implements JsonSerializable {
/*
* The oldest backup copy available for this item in the service.
*/
- @JsonProperty(value = "oldestRecoveryPoint")
private OffsetDateTime oldestRecoveryPoint;
/*
* Number of available backup copies associated with this backup item.
*/
- @JsonProperty(value = "recoveryPointCount")
private Integer recoveryPointCount;
/*
* State of the backup policy associated with this backup item.
*/
- @JsonProperty(value = "policyState")
private String policyState;
/**
@@ -104,4 +107,52 @@ public AzureSqlProtectedItemExtendedInfo withPolicyState(String policyState) {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("oldestRecoveryPoint",
+ this.oldestRecoveryPoint == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPoint));
+ jsonWriter.writeNumberField("recoveryPointCount", this.recoveryPointCount);
+ jsonWriter.writeStringField("policyState", this.policyState);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureSqlProtectedItemExtendedInfo from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureSqlProtectedItemExtendedInfo if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureSqlProtectedItemExtendedInfo.
+ */
+ public static AzureSqlProtectedItemExtendedInfo fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureSqlProtectedItemExtendedInfo deserializedAzureSqlProtectedItemExtendedInfo
+ = new AzureSqlProtectedItemExtendedInfo();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("oldestRecoveryPoint".equals(fieldName)) {
+ deserializedAzureSqlProtectedItemExtendedInfo.oldestRecoveryPoint = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("recoveryPointCount".equals(fieldName)) {
+ deserializedAzureSqlProtectedItemExtendedInfo.recoveryPointCount
+ = reader.getNullable(JsonReader::getInt);
+ } else if ("policyState".equals(fieldName)) {
+ deserializedAzureSqlProtectedItemExtendedInfo.policyState = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureSqlProtectedItemExtendedInfo;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java
index b6e1142611896..387c16c77a65f 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java
@@ -5,34 +5,26 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
/**
* Azure SQL workload-specific backup policy.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "backupManagementType",
- defaultImpl = AzureSqlProtectionPolicy.class,
- visible = true)
-@JsonTypeName("AzureSql")
@Fluent
public final class AzureSqlProtectionPolicy extends ProtectionPolicy {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "backupManagementType", required = true)
private String backupManagementType = "AzureSql";
/*
* Retention policy details.
*/
- @JsonProperty(value = "retentionPolicy")
private RetentionPolicy retentionPolicy;
/**
@@ -97,9 +89,57 @@ public AzureSqlProtectionPolicy withResourceGuardOperationRequests(List
*/
@Override
public void validate() {
- super.validate();
if (retentionPolicy() != null) {
retentionPolicy().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeNumberField("protectedItemsCount", protectedItemsCount());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("backupManagementType", this.backupManagementType);
+ jsonWriter.writeJsonField("retentionPolicy", this.retentionPolicy);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureSqlProtectionPolicy from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureSqlProtectionPolicy if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureSqlProtectionPolicy.
+ */
+ public static AzureSqlProtectionPolicy fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureSqlProtectionPolicy deserializedAzureSqlProtectionPolicy = new AzureSqlProtectionPolicy();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("protectedItemsCount".equals(fieldName)) {
+ deserializedAzureSqlProtectionPolicy
+ .withProtectedItemsCount(reader.getNullable(JsonReader::getInt));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureSqlProtectionPolicy
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureSqlProtectionPolicy.backupManagementType = reader.getString();
+ } else if ("retentionPolicy".equals(fieldName)) {
+ deserializedAzureSqlProtectionPolicy.retentionPolicy = RetentionPolicy.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureSqlProtectionPolicy;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java
index f1d1521f1d5f0..00f3db3e5311f 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java
@@ -5,31 +5,26 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
/**
* Container for SQL workloads under SQL Availability Group.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "containerType",
- defaultImpl = AzureSqlagWorkloadContainerProtectionContainer.class,
- visible = true)
-@JsonTypeName("SQLAGWorkLoadContainer")
@Fluent
public final class AzureSqlagWorkloadContainerProtectionContainer extends AzureWorkloadContainer {
/*
- * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2.
+ * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines
+ * 2.
* Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is
* Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload
* Backup is VMAppContainer
*/
- @JsonTypeId
- @JsonProperty(value = "containerType", required = true)
private ProtectableContainerType containerType = ProtectableContainerType.SQLAGWORK_LOAD_CONTAINER;
/**
@@ -151,6 +146,85 @@ public AzureSqlagWorkloadContainerProtectionContainer withProtectableObjectType(
*/
@Override
public void validate() {
- super.validate();
+ if (extendedInfo() != null) {
+ extendedInfo().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("registrationStatus", registrationStatus());
+ jsonWriter.writeStringField("healthStatus", healthStatus());
+ jsonWriter.writeStringField("protectableObjectType", protectableObjectType());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("lastUpdatedTime",
+ lastUpdatedTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastUpdatedTime()));
+ jsonWriter.writeJsonField("extendedInfo", extendedInfo());
+ jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString());
+ jsonWriter.writeStringField("operationType", operationType() == null ? null : operationType().toString());
+ jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureSqlagWorkloadContainerProtectionContainer from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureSqlagWorkloadContainerProtectionContainer if the JsonReader was pointing to an
+ * instance of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureSqlagWorkloadContainerProtectionContainer.
+ */
+ public static AzureSqlagWorkloadContainerProtectionContainer fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureSqlagWorkloadContainerProtectionContainer deserializedAzureSqlagWorkloadContainerProtectionContainer
+ = new AzureSqlagWorkloadContainerProtectionContainer();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("friendlyName".equals(fieldName)) {
+ deserializedAzureSqlagWorkloadContainerProtectionContainer.withFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureSqlagWorkloadContainerProtectionContainer
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("registrationStatus".equals(fieldName)) {
+ deserializedAzureSqlagWorkloadContainerProtectionContainer
+ .withRegistrationStatus(reader.getString());
+ } else if ("healthStatus".equals(fieldName)) {
+ deserializedAzureSqlagWorkloadContainerProtectionContainer.withHealthStatus(reader.getString());
+ } else if ("protectableObjectType".equals(fieldName)) {
+ deserializedAzureSqlagWorkloadContainerProtectionContainer
+ .withProtectableObjectType(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureSqlagWorkloadContainerProtectionContainer.withSourceResourceId(reader.getString());
+ } else if ("lastUpdatedTime".equals(fieldName)) {
+ deserializedAzureSqlagWorkloadContainerProtectionContainer.withLastUpdatedTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureSqlagWorkloadContainerProtectionContainer
+ .withExtendedInfo(AzureWorkloadContainerExtendedInfo.fromJson(reader));
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureSqlagWorkloadContainerProtectionContainer
+ .withWorkloadType(WorkloadType.fromString(reader.getString()));
+ } else if ("operationType".equals(fieldName)) {
+ deserializedAzureSqlagWorkloadContainerProtectionContainer
+ .withOperationType(OperationType.fromString(reader.getString()));
+ } else if ("containerType".equals(fieldName)) {
+ deserializedAzureSqlagWorkloadContainerProtectionContainer.containerType
+ = ProtectableContainerType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureSqlagWorkloadContainerProtectionContainer;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.java
index 0254f85bbff01..8b62564c70bc4 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.java
@@ -5,60 +5,48 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure Storage Account workload-specific container.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "containerType",
- defaultImpl = AzureStorageContainer.class,
- visible = true)
-@JsonTypeName("StorageContainer")
@Fluent
public final class AzureStorageContainer extends ProtectionContainer {
/*
- * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2.
+ * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines
+ * 2.
* Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is
* Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload
* Backup is VMAppContainer
*/
- @JsonTypeId
- @JsonProperty(value = "containerType", required = true)
private ProtectableContainerType containerType = ProtectableContainerType.STORAGE_CONTAINER;
/*
* Fully qualified ARM url.
*/
- @JsonProperty(value = "sourceResourceId")
private String sourceResourceId;
/*
* Storage account version.
*/
- @JsonProperty(value = "storageAccountVersion")
private String storageAccountVersion;
/*
* Resource group name of Recovery Services Vault.
*/
- @JsonProperty(value = "resourceGroup")
private String resourceGroup;
/*
* Number of items backed up in this container.
*/
- @JsonProperty(value = "protectedItemCount")
private Long protectedItemCount;
/*
* Whether storage account lock is to be acquired for this container or not.
*/
- @JsonProperty(value = "acquireStorageAccountLock")
private AcquireStorageAccountLock acquireStorageAccountLock;
/**
@@ -235,6 +223,76 @@ public AzureStorageContainer withProtectableObjectType(String protectableObjectT
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("registrationStatus", registrationStatus());
+ jsonWriter.writeStringField("healthStatus", healthStatus());
+ jsonWriter.writeStringField("protectableObjectType", protectableObjectType());
+ jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString());
+ jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId);
+ jsonWriter.writeStringField("storageAccountVersion", this.storageAccountVersion);
+ jsonWriter.writeStringField("resourceGroup", this.resourceGroup);
+ jsonWriter.writeNumberField("protectedItemCount", this.protectedItemCount);
+ jsonWriter.writeStringField("acquireStorageAccountLock",
+ this.acquireStorageAccountLock == null ? null : this.acquireStorageAccountLock.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureStorageContainer from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureStorageContainer if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureStorageContainer.
+ */
+ public static AzureStorageContainer fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureStorageContainer deserializedAzureStorageContainer = new AzureStorageContainer();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("friendlyName".equals(fieldName)) {
+ deserializedAzureStorageContainer.withFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureStorageContainer
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("registrationStatus".equals(fieldName)) {
+ deserializedAzureStorageContainer.withRegistrationStatus(reader.getString());
+ } else if ("healthStatus".equals(fieldName)) {
+ deserializedAzureStorageContainer.withHealthStatus(reader.getString());
+ } else if ("protectableObjectType".equals(fieldName)) {
+ deserializedAzureStorageContainer.withProtectableObjectType(reader.getString());
+ } else if ("containerType".equals(fieldName)) {
+ deserializedAzureStorageContainer.containerType
+ = ProtectableContainerType.fromString(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureStorageContainer.sourceResourceId = reader.getString();
+ } else if ("storageAccountVersion".equals(fieldName)) {
+ deserializedAzureStorageContainer.storageAccountVersion = reader.getString();
+ } else if ("resourceGroup".equals(fieldName)) {
+ deserializedAzureStorageContainer.resourceGroup = reader.getString();
+ } else if ("protectedItemCount".equals(fieldName)) {
+ deserializedAzureStorageContainer.protectedItemCount = reader.getNullable(JsonReader::getLong);
+ } else if ("acquireStorageAccountLock".equals(fieldName)) {
+ deserializedAzureStorageContainer.acquireStorageAccountLock
+ = AcquireStorageAccountLock.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureStorageContainer;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageErrorInfo.java
index 7787fffcf0d4a..bbd3746eef0d5 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageErrorInfo.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageErrorInfo.java
@@ -5,30 +5,31 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
/**
* Azure storage specific error information.
*/
@Fluent
-public final class AzureStorageErrorInfo {
+public final class AzureStorageErrorInfo implements JsonSerializable {
/*
* Error code.
*/
- @JsonProperty(value = "errorCode")
private Integer errorCode;
/*
* Localized error string.
*/
- @JsonProperty(value = "errorString")
private String errorString;
/*
* List of localized recommendations for above error code.
*/
- @JsonProperty(value = "recommendations")
private List recommendations;
/**
@@ -104,4 +105,48 @@ public AzureStorageErrorInfo withRecommendations(List recommendations) {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeNumberField("errorCode", this.errorCode);
+ jsonWriter.writeStringField("errorString", this.errorString);
+ jsonWriter.writeArrayField("recommendations", this.recommendations,
+ (writer, element) -> writer.writeString(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureStorageErrorInfo from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureStorageErrorInfo if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureStorageErrorInfo.
+ */
+ public static AzureStorageErrorInfo fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureStorageErrorInfo deserializedAzureStorageErrorInfo = new AzureStorageErrorInfo();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("errorCode".equals(fieldName)) {
+ deserializedAzureStorageErrorInfo.errorCode = reader.getNullable(JsonReader::getInt);
+ } else if ("errorString".equals(fieldName)) {
+ deserializedAzureStorageErrorInfo.errorString = reader.getString();
+ } else if ("recommendations".equals(fieldName)) {
+ List recommendations = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureStorageErrorInfo.recommendations = recommendations;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureStorageErrorInfo;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJob.java
index 2b74b697ede58..40b4cc632e0e2 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJob.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJob.java
@@ -5,68 +5,60 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.Duration;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
/**
* Azure storage specific job.
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "jobType", defaultImpl = AzureStorageJob.class, visible = true)
-@JsonTypeName("AzureStorageJob")
@Fluent
public final class AzureStorageJob extends Job {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "jobType", required = true)
private String jobType = "AzureStorageJob";
/*
* Time elapsed during the execution of this job.
*/
- @JsonProperty(value = "duration")
private Duration duration;
/*
* Gets or sets the state/actions applicable on this job like cancel/retry.
*/
- @JsonProperty(value = "actionsInfo")
private List actionsInfo;
/*
* Error details on execution of this job.
*/
- @JsonProperty(value = "errorDetails")
private List errorDetails;
/*
* Specifies friendly name of the storage account.
*/
- @JsonProperty(value = "storageAccountName")
private String storageAccountName;
/*
* Specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account.
*/
- @JsonProperty(value = "storageAccountVersion")
private String storageAccountVersion;
/*
* Additional information about the job.
*/
- @JsonProperty(value = "extendedInfo")
private AzureStorageJobExtendedInfo extendedInfo;
/*
* Indicated that whether the job is adhoc(true) or scheduled(false)
*/
- @JsonProperty(value = "isUserTriggered")
private Boolean isUserTriggered;
/**
@@ -298,7 +290,6 @@ public AzureStorageJob withActivityId(String activityId) {
*/
@Override
public void validate() {
- super.validate();
if (errorDetails() != null) {
errorDetails().forEach(e -> e.validate());
}
@@ -306,4 +297,94 @@ public void validate() {
extendedInfo().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("entityFriendlyName", entityFriendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("operation", operation());
+ jsonWriter.writeStringField("status", status());
+ jsonWriter.writeStringField("startTime",
+ startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime()));
+ jsonWriter.writeStringField("endTime",
+ endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime()));
+ jsonWriter.writeStringField("activityId", activityId());
+ jsonWriter.writeStringField("jobType", this.jobType);
+ jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration));
+ jsonWriter.writeArrayField("actionsInfo", this.actionsInfo,
+ (writer, element) -> writer.writeString(element == null ? null : element.toString()));
+ jsonWriter.writeArrayField("errorDetails", this.errorDetails, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("storageAccountName", this.storageAccountName);
+ jsonWriter.writeStringField("storageAccountVersion", this.storageAccountVersion);
+ jsonWriter.writeJsonField("extendedInfo", this.extendedInfo);
+ jsonWriter.writeBooleanField("isUserTriggered", this.isUserTriggered);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureStorageJob from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureStorageJob if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureStorageJob.
+ */
+ public static AzureStorageJob fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureStorageJob deserializedAzureStorageJob = new AzureStorageJob();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("entityFriendlyName".equals(fieldName)) {
+ deserializedAzureStorageJob.withEntityFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureStorageJob
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("operation".equals(fieldName)) {
+ deserializedAzureStorageJob.withOperation(reader.getString());
+ } else if ("status".equals(fieldName)) {
+ deserializedAzureStorageJob.withStatus(reader.getString());
+ } else if ("startTime".equals(fieldName)) {
+ deserializedAzureStorageJob.withStartTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("endTime".equals(fieldName)) {
+ deserializedAzureStorageJob.withEndTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("activityId".equals(fieldName)) {
+ deserializedAzureStorageJob.withActivityId(reader.getString());
+ } else if ("jobType".equals(fieldName)) {
+ deserializedAzureStorageJob.jobType = reader.getString();
+ } else if ("duration".equals(fieldName)) {
+ deserializedAzureStorageJob.duration
+ = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()));
+ } else if ("actionsInfo".equals(fieldName)) {
+ List actionsInfo
+ = reader.readArray(reader1 -> JobSupportedAction.fromString(reader1.getString()));
+ deserializedAzureStorageJob.actionsInfo = actionsInfo;
+ } else if ("errorDetails".equals(fieldName)) {
+ List errorDetails
+ = reader.readArray(reader1 -> AzureStorageErrorInfo.fromJson(reader1));
+ deserializedAzureStorageJob.errorDetails = errorDetails;
+ } else if ("storageAccountName".equals(fieldName)) {
+ deserializedAzureStorageJob.storageAccountName = reader.getString();
+ } else if ("storageAccountVersion".equals(fieldName)) {
+ deserializedAzureStorageJob.storageAccountVersion = reader.getString();
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureStorageJob.extendedInfo = AzureStorageJobExtendedInfo.fromJson(reader);
+ } else if ("isUserTriggered".equals(fieldName)) {
+ deserializedAzureStorageJob.isUserTriggered = reader.getNullable(JsonReader::getBoolean);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureStorageJob;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.java
index 5a681a5f85ed1..0b2224c3495fa 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.java
@@ -5,8 +5,11 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -14,24 +17,20 @@
* Azure Storage workload-specific additional information for job.
*/
@Fluent
-public final class AzureStorageJobExtendedInfo {
+public final class AzureStorageJobExtendedInfo implements JsonSerializable {
/*
* List of tasks for this job
*/
- @JsonProperty(value = "tasksList")
private List tasksList;
/*
* Job properties.
*/
- @JsonProperty(value = "propertyBag")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map propertyBag;
/*
* Non localized error message on job execution.
*/
- @JsonProperty(value = "dynamicErrorMessage")
private String dynamicErrorMessage;
/**
@@ -110,4 +109,49 @@ public void validate() {
tasksList().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("tasksList", this.tasksList, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeMapField("propertyBag", this.propertyBag, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("dynamicErrorMessage", this.dynamicErrorMessage);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureStorageJobExtendedInfo from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureStorageJobExtendedInfo if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureStorageJobExtendedInfo.
+ */
+ public static AzureStorageJobExtendedInfo fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureStorageJobExtendedInfo deserializedAzureStorageJobExtendedInfo = new AzureStorageJobExtendedInfo();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("tasksList".equals(fieldName)) {
+ List tasksList
+ = reader.readArray(reader1 -> AzureStorageJobTaskDetails.fromJson(reader1));
+ deserializedAzureStorageJobExtendedInfo.tasksList = tasksList;
+ } else if ("propertyBag".equals(fieldName)) {
+ Map propertyBag = reader.readMap(reader1 -> reader1.getString());
+ deserializedAzureStorageJobExtendedInfo.propertyBag = propertyBag;
+ } else if ("dynamicErrorMessage".equals(fieldName)) {
+ deserializedAzureStorageJobExtendedInfo.dynamicErrorMessage = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureStorageJobExtendedInfo;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobTaskDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobTaskDetails.java
index 69846285b8662..9681a95a2740e 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobTaskDetails.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobTaskDetails.java
@@ -5,23 +5,25 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure storage workload specific job task details.
*/
@Fluent
-public final class AzureStorageJobTaskDetails {
+public final class AzureStorageJobTaskDetails implements JsonSerializable {
/*
* The task display name.
*/
- @JsonProperty(value = "taskId")
private String taskId;
/*
* The status.
*/
- @JsonProperty(value = "status")
private String status;
/**
@@ -77,4 +79,43 @@ public AzureStorageJobTaskDetails withStatus(String status) {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("taskId", this.taskId);
+ jsonWriter.writeStringField("status", this.status);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureStorageJobTaskDetails from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureStorageJobTaskDetails if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureStorageJobTaskDetails.
+ */
+ public static AzureStorageJobTaskDetails fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureStorageJobTaskDetails deserializedAzureStorageJobTaskDetails = new AzureStorageJobTaskDetails();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("taskId".equals(fieldName)) {
+ deserializedAzureStorageJobTaskDetails.taskId = reader.getString();
+ } else if ("status".equals(fieldName)) {
+ deserializedAzureStorageJobTaskDetails.status = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureStorageJobTaskDetails;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.java
index beeca2f37bba2..6c1b093899a07 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.java
@@ -5,20 +5,14 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure Storage-specific protectable containers.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectableContainerType",
- defaultImpl = AzureStorageProtectableContainer.class,
- visible = true)
-@JsonTypeName("StorageContainer")
@Fluent
public final class AzureStorageProtectableContainer extends ProtectableContainer {
/*
@@ -26,8 +20,6 @@ public final class AzureStorageProtectableContainer extends ProtectableContainer
* 1. Compute Azure VM is Microsoft.Compute/virtualMachines
* 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines
*/
- @JsonTypeId
- @JsonProperty(value = "protectableContainerType", required = true)
private ProtectableContainerType protectableContainerType = ProtectableContainerType.STORAGE_CONTAINER;
/**
@@ -91,6 +83,58 @@ public AzureStorageProtectableContainer withContainerId(String containerId) {
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("healthStatus", healthStatus());
+ jsonWriter.writeStringField("containerId", containerId());
+ jsonWriter.writeStringField("protectableContainerType",
+ this.protectableContainerType == null ? null : this.protectableContainerType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureStorageProtectableContainer from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureStorageProtectableContainer if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureStorageProtectableContainer.
+ */
+ public static AzureStorageProtectableContainer fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureStorageProtectableContainer deserializedAzureStorageProtectableContainer
+ = new AzureStorageProtectableContainer();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("friendlyName".equals(fieldName)) {
+ deserializedAzureStorageProtectableContainer.withFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureStorageProtectableContainer
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("healthStatus".equals(fieldName)) {
+ deserializedAzureStorageProtectableContainer.withHealthStatus(reader.getString());
+ } else if ("containerId".equals(fieldName)) {
+ deserializedAzureStorageProtectableContainer.withContainerId(reader.getString());
+ } else if ("protectableContainerType".equals(fieldName)) {
+ deserializedAzureStorageProtectableContainer.protectableContainerType
+ = ProtectableContainerType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureStorageProtectableContainer;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.java
index 586fd38f4e2f3..df70d3ae816a1 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.java
@@ -5,20 +5,14 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure workload-specific container.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectableContainerType",
- defaultImpl = AzureVMAppContainerProtectableContainer.class,
- visible = true)
-@JsonTypeName("VMAppContainer")
@Fluent
public final class AzureVMAppContainerProtectableContainer extends ProtectableContainer {
/*
@@ -26,8 +20,6 @@ public final class AzureVMAppContainerProtectableContainer extends ProtectableCo
* 1. Compute Azure VM is Microsoft.Compute/virtualMachines
* 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines
*/
- @JsonTypeId
- @JsonProperty(value = "protectableContainerType", required = true)
private ProtectableContainerType protectableContainerType = ProtectableContainerType.VMAPP_CONTAINER;
/**
@@ -91,6 +83,58 @@ public AzureVMAppContainerProtectableContainer withContainerId(String containerI
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("healthStatus", healthStatus());
+ jsonWriter.writeStringField("containerId", containerId());
+ jsonWriter.writeStringField("protectableContainerType",
+ this.protectableContainerType == null ? null : this.protectableContainerType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVMAppContainerProtectableContainer from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVMAppContainerProtectableContainer if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVMAppContainerProtectableContainer.
+ */
+ public static AzureVMAppContainerProtectableContainer fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVMAppContainerProtectableContainer deserializedAzureVMAppContainerProtectableContainer
+ = new AzureVMAppContainerProtectableContainer();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectableContainer.withFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectableContainer
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("healthStatus".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectableContainer.withHealthStatus(reader.getString());
+ } else if ("containerId".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectableContainer.withContainerId(reader.getString());
+ } else if ("protectableContainerType".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectableContainer.protectableContainerType
+ = ProtectableContainerType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVMAppContainerProtectableContainer;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.java
index 52d554126fde9..34c942e51a192 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.java
@@ -5,31 +5,26 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
/**
* Container for SQL workloads under Azure Virtual Machines.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "containerType",
- defaultImpl = AzureVMAppContainerProtectionContainer.class,
- visible = true)
-@JsonTypeName("VMAppContainer")
@Fluent
public final class AzureVMAppContainerProtectionContainer extends AzureWorkloadContainer {
/*
- * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2.
+ * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines
+ * 2.
* Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is
* Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload
* Backup is VMAppContainer
*/
- @JsonTypeId
- @JsonProperty(value = "containerType", required = true)
private ProtectableContainerType containerType = ProtectableContainerType.VMAPP_CONTAINER;
/**
@@ -149,6 +144,83 @@ public AzureVMAppContainerProtectionContainer withProtectableObjectType(String p
*/
@Override
public void validate() {
- super.validate();
+ if (extendedInfo() != null) {
+ extendedInfo().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("registrationStatus", registrationStatus());
+ jsonWriter.writeStringField("healthStatus", healthStatus());
+ jsonWriter.writeStringField("protectableObjectType", protectableObjectType());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("lastUpdatedTime",
+ lastUpdatedTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastUpdatedTime()));
+ jsonWriter.writeJsonField("extendedInfo", extendedInfo());
+ jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString());
+ jsonWriter.writeStringField("operationType", operationType() == null ? null : operationType().toString());
+ jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVMAppContainerProtectionContainer from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVMAppContainerProtectionContainer if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVMAppContainerProtectionContainer.
+ */
+ public static AzureVMAppContainerProtectionContainer fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVMAppContainerProtectionContainer deserializedAzureVMAppContainerProtectionContainer
+ = new AzureVMAppContainerProtectionContainer();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectionContainer.withFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectionContainer
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("registrationStatus".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectionContainer.withRegistrationStatus(reader.getString());
+ } else if ("healthStatus".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectionContainer.withHealthStatus(reader.getString());
+ } else if ("protectableObjectType".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectionContainer.withProtectableObjectType(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectionContainer.withSourceResourceId(reader.getString());
+ } else if ("lastUpdatedTime".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectionContainer.withLastUpdatedTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectionContainer
+ .withExtendedInfo(AzureWorkloadContainerExtendedInfo.fromJson(reader));
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectionContainer
+ .withWorkloadType(WorkloadType.fromString(reader.getString()));
+ } else if ("operationType".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectionContainer
+ .withOperationType(OperationType.fromString(reader.getString()));
+ } else if ("containerType".equals(fieldName)) {
+ deserializedAzureVMAppContainerProtectionContainer.containerType
+ = ProtectableContainerType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVMAppContainerProtectionContainer;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportRequest.java
index c4da77609b366..4cdca2443989a 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportRequest.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportRequest.java
@@ -5,39 +5,29 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* AzureResource(IaaS VM) Specific feature support request.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "featureType",
- defaultImpl = AzureVMResourceFeatureSupportRequest.class,
- visible = true)
-@JsonTypeName("AzureVMResourceBackup")
@Fluent
public final class AzureVMResourceFeatureSupportRequest extends FeatureSupportRequest {
/*
* backup support feature type.
*/
- @JsonTypeId
- @JsonProperty(value = "featureType", required = true)
private String featureType = "AzureVMResourceBackup";
/*
* Size of the resource: VM size(A/D series etc) in case of IaasVM
*/
- @JsonProperty(value = "vmSize")
private String vmSize;
/*
* SKUs (Premium/Managed etc) in case of IaasVM
*/
- @JsonProperty(value = "vmSku")
private String vmSku;
/**
@@ -103,6 +93,48 @@ public AzureVMResourceFeatureSupportRequest withVmSku(String vmSku) {
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("featureType", this.featureType);
+ jsonWriter.writeStringField("vmSize", this.vmSize);
+ jsonWriter.writeStringField("vmSku", this.vmSku);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVMResourceFeatureSupportRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVMResourceFeatureSupportRequest if the JsonReader was pointing to an instance of it,
+ * or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVMResourceFeatureSupportRequest.
+ */
+ public static AzureVMResourceFeatureSupportRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVMResourceFeatureSupportRequest deserializedAzureVMResourceFeatureSupportRequest
+ = new AzureVMResourceFeatureSupportRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("featureType".equals(fieldName)) {
+ deserializedAzureVMResourceFeatureSupportRequest.featureType = reader.getString();
+ } else if ("vmSize".equals(fieldName)) {
+ deserializedAzureVMResourceFeatureSupportRequest.vmSize = reader.getString();
+ } else if ("vmSku".equals(fieldName)) {
+ deserializedAzureVMResourceFeatureSupportRequest.vmSku = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVMResourceFeatureSupportRequest;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadAnyDatabaseProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadAnyDatabaseProtectableItem.java
new file mode 100644
index 0000000000000..7ecf8dd2a5c7d
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadAnyDatabaseProtectableItem.java
@@ -0,0 +1,250 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Azure VM workload-specific protectable item representing AnyDatabase DB.
+ */
+@Fluent
+public final class AzureVmWorkloadAnyDatabaseProtectableItem extends AzureVmWorkloadProtectableItem {
+ /*
+ * Type of the backup item.
+ */
+ private String protectableItemType = "AnyDatabase";
+
+ /**
+ * Creates an instance of AzureVmWorkloadAnyDatabaseProtectableItem class.
+ */
+ public AzureVmWorkloadAnyDatabaseProtectableItem() {
+ }
+
+ /**
+ * Get the protectableItemType property: Type of the backup item.
+ *
+ * @return the protectableItemType value.
+ */
+ @Override
+ public String protectableItemType() {
+ return this.protectableItemType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectableItem withParentName(String parentName) {
+ super.withParentName(parentName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectableItem withParentUniqueName(String parentUniqueName) {
+ super.withParentUniqueName(parentUniqueName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectableItem withServerName(String serverName) {
+ super.withServerName(serverName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectableItem withIsAutoProtectable(Boolean isAutoProtectable) {
+ super.withIsAutoProtectable(isAutoProtectable);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectableItem withIsAutoProtected(Boolean isAutoProtected) {
+ super.withIsAutoProtected(isAutoProtected);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectableItem withSubinquireditemcount(Integer subinquireditemcount) {
+ super.withSubinquireditemcount(subinquireditemcount);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectableItem withSubprotectableitemcount(Integer subprotectableitemcount) {
+ super.withSubprotectableitemcount(subprotectableitemcount);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectableItem withPrebackupvalidation(PreBackupValidation prebackupvalidation) {
+ super.withPrebackupvalidation(prebackupvalidation);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectableItem withIsProtectable(Boolean isProtectable) {
+ super.withIsProtectable(isProtectable);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectableItem withBackupManagementType(String backupManagementType) {
+ super.withBackupManagementType(backupManagementType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectableItem withWorkloadType(String workloadType) {
+ super.withWorkloadType(workloadType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectableItem withFriendlyName(String friendlyName) {
+ super.withFriendlyName(friendlyName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectableItem withProtectionState(ProtectionStatus protectionState) {
+ super.withProtectionState(protectionState);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (prebackupvalidation() != null) {
+ prebackupvalidation().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentUniqueName", parentUniqueName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount());
+ jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation());
+ jsonWriter.writeBooleanField("isProtectable", isProtectable());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadAnyDatabaseProtectableItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadAnyDatabaseProtectableItem if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadAnyDatabaseProtectableItem.
+ */
+ public static AzureVmWorkloadAnyDatabaseProtectableItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadAnyDatabaseProtectableItem deserializedAzureVmWorkloadAnyDatabaseProtectableItem
+ = new AzureVmWorkloadAnyDatabaseProtectableItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectableItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectableItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectableItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectableItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectableItem.withParentName(reader.getString());
+ } else if ("parentUniqueName".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectableItem.withParentUniqueName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectableItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectableItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isAutoProtected".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectableItem
+ .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectableItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subprotectableitemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectableItem
+ .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("prebackupvalidation".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectableItem
+ .withPrebackupvalidation(PreBackupValidation.fromJson(reader));
+ } else if ("isProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectableItem
+ .withIsProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectableItem.protectableItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadAnyDatabaseProtectableItem;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadAnyDatabaseProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadAnyDatabaseProtectedItem.java
new file mode 100644
index 0000000000000..d3f26712f4dd3
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadAnyDatabaseProtectedItem.java
@@ -0,0 +1,551 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Azure VM workload-specific protected item representing Any Database.
+ */
+@Fluent
+public final class AzureVmWorkloadAnyDatabaseProtectedItem extends AzureVmWorkloadProtectedItem {
+ /*
+ * backup item type.
+ */
+ private String protectedItemType = "AzureVmWorkloadAnyDatabase";
+
+ /*
+ * Backup status of this backup item.
+ */
+ private String protectionStatus;
+
+ /*
+ * Friendly name of the DB represented by this backup item.
+ */
+ private String friendlyName;
+
+ /*
+ * ID of the vault which protects this item
+ */
+ private String vaultId;
+
+ /*
+ * Type of workload this item represents.
+ */
+ private DataSourceTypeAutoGenerated3 workloadType;
+
+ /*
+ * Type of backup management for the backed up item.
+ */
+ private BackupManagementType backupManagementType;
+
+ /**
+ * Creates an instance of AzureVmWorkloadAnyDatabaseProtectedItem class.
+ */
+ public AzureVmWorkloadAnyDatabaseProtectedItem() {
+ }
+
+ /**
+ * Get the protectedItemType property: backup item type.
+ *
+ * @return the protectedItemType value.
+ */
+ @Override
+ public String protectedItemType() {
+ return this.protectedItemType;
+ }
+
+ /**
+ * Get the protectionStatus property: Backup status of this backup item.
+ *
+ * @return the protectionStatus value.
+ */
+ @Override
+ public String protectionStatus() {
+ return this.protectionStatus;
+ }
+
+ /**
+ * Get the friendlyName property: Friendly name of the DB represented by this backup item.
+ *
+ * @return the friendlyName value.
+ */
+ @Override
+ public String friendlyName() {
+ return this.friendlyName;
+ }
+
+ /**
+ * Get the vaultId property: ID of the vault which protects this item.
+ *
+ * @return the vaultId value.
+ */
+ @Override
+ public String vaultId() {
+ return this.vaultId;
+ }
+
+ /**
+ * Get the workloadType property: Type of workload this item represents.
+ *
+ * @return the workloadType value.
+ */
+ @Override
+ public DataSourceTypeAutoGenerated3 workloadType() {
+ return this.workloadType;
+ }
+
+ /**
+ * Get the backupManagementType property: Type of backup management for the backed up item.
+ *
+ * @return the backupManagementType value.
+ */
+ @Override
+ public BackupManagementType backupManagementType() {
+ return this.backupManagementType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withServerName(String serverName) {
+ super.withServerName(serverName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withParentName(String parentName) {
+ super.withParentName(parentName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withParentType(String parentType) {
+ super.withParentType(parentType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withProtectionState(ProtectionState protectionState) {
+ super.withProtectionState(protectionState);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withLastBackupStatus(LastBackupStatus lastBackupStatus) {
+ super.withLastBackupStatus(lastBackupStatus);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) {
+ super.withLastBackupTime(lastBackupTime);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withLastBackupErrorDetail(ErrorDetail lastBackupErrorDetail) {
+ super.withLastBackupErrorDetail(lastBackupErrorDetail);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withProtectedItemDataSourceId(String protectedItemDataSourceId) {
+ super.withProtectedItemDataSourceId(protectedItemDataSourceId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem
+ withProtectedItemHealthStatus(ProtectedItemHealthStatus protectedItemHealthStatus) {
+ super.withProtectedItemHealthStatus(protectedItemHealthStatus);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem
+ withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo extendedInfo) {
+ super.withExtendedInfo(extendedInfo);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withKpisHealths(Map kpisHealths) {
+ super.withKpisHealths(kpisHealths);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withNodesList(List nodesList) {
+ super.withNodesList(nodesList);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withContainerName(String containerName) {
+ super.withContainerName(containerName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withSourceResourceId(String sourceResourceId) {
+ super.withSourceResourceId(sourceResourceId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withPolicyId(String policyId) {
+ super.withPolicyId(policyId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) {
+ super.withLastRecoveryPoint(lastRecoveryPoint);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withBackupSetName(String backupSetName) {
+ super.withBackupSetName(backupSetName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withCreateMode(CreateMode createMode) {
+ super.withCreateMode(createMode);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) {
+ super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem
+ withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) {
+ super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) {
+ super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem
+ withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) {
+ super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withIsRehydrate(Boolean isRehydrate) {
+ super.withIsRehydrate(isRehydrate);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem
+ withResourceGuardOperationRequests(List resourceGuardOperationRequests) {
+ super.withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) {
+ super.withIsArchiveEnabled(isArchiveEnabled);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withPolicyName(String policyName) {
+ super.withPolicyName(policyName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseProtectedItem withSoftDeleteRetentionPeriod(Integer softDeleteRetentionPeriod) {
+ super.withSoftDeleteRetentionPeriod(softDeleteRetentionPeriod);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (lastBackupErrorDetail() != null) {
+ lastBackupErrorDetail().validate();
+ }
+ if (extendedInfo() != null) {
+ extendedInfo().validate();
+ }
+ if (kpisHealths() != null) {
+ kpisHealths().values().forEach(e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ if (nodesList() != null) {
+ nodesList().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("containerName", containerName());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("lastRecoveryPoint",
+ lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint()));
+ jsonWriter.writeStringField("backupSetName", backupSetName());
+ jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString());
+ jsonWriter.writeStringField("deferredDeleteTimeInUTC",
+ deferredDeleteTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc()));
+ jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete());
+ jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining());
+ jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming());
+ jsonWriter.writeBooleanField("isRehydrate", isRehydrate());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled());
+ jsonWriter.writeStringField("policyName", policyName());
+ jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriod());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentType", parentType());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("lastBackupStatus",
+ lastBackupStatus() == null ? null : lastBackupStatus().toString());
+ jsonWriter.writeStringField("lastBackupTime",
+ lastBackupTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastBackupTime()));
+ jsonWriter.writeJsonField("lastBackupErrorDetail", lastBackupErrorDetail());
+ jsonWriter.writeStringField("protectedItemDataSourceId", protectedItemDataSourceId());
+ jsonWriter.writeStringField("protectedItemHealthStatus",
+ protectedItemHealthStatus() == null ? null : protectedItemHealthStatus().toString());
+ jsonWriter.writeJsonField("extendedInfo", extendedInfo());
+ jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("nodesList", nodesList(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("protectedItemType", this.protectedItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadAnyDatabaseProtectedItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadAnyDatabaseProtectedItem if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadAnyDatabaseProtectedItem.
+ */
+ public static AzureVmWorkloadAnyDatabaseProtectedItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadAnyDatabaseProtectedItem deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ = new AzureVmWorkloadAnyDatabaseProtectedItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.backupManagementType
+ = BackupManagementType.fromString(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.workloadType
+ = DataSourceTypeAutoGenerated3.fromString(reader.getString());
+ } else if ("containerName".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.withContainerName(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.withSourceResourceId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.withPolicyId(reader.getString());
+ } else if ("lastRecoveryPoint".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.withLastRecoveryPoint(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("backupSetName".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.withBackupSetName(reader.getString());
+ } else if ("createMode".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ .withCreateMode(CreateMode.fromString(reader.getString()));
+ } else if ("deferredDeleteTimeInUTC".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.withDeferredDeleteTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("isScheduledForDeferredDelete".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean));
+ } else if ("deferredDeleteTimeRemaining".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ .withDeferredDeleteTimeRemaining(reader.getString());
+ } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isRehydrate".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ .withIsRehydrate(reader.getNullable(JsonReader::getBoolean));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("isArchiveEnabled".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean));
+ } else if ("policyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.withPolicyName(reader.getString());
+ } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ .withSoftDeleteRetentionPeriod(reader.getNullable(JsonReader::getInt));
+ } else if ("vaultId".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.vaultId = reader.getString();
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.friendlyName = reader.getString();
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.withServerName(reader.getString());
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.withParentName(reader.getString());
+ } else if ("parentType".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.withParentType(reader.getString());
+ } else if ("protectionStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.protectionStatus = reader.getString();
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ .withProtectionState(ProtectionState.fromString(reader.getString()));
+ } else if ("lastBackupStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ .withLastBackupStatus(LastBackupStatus.fromString(reader.getString()));
+ } else if ("lastBackupTime".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.withLastBackupTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("lastBackupErrorDetail".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ .withLastBackupErrorDetail(ErrorDetail.fromJson(reader));
+ } else if ("protectedItemDataSourceId".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ .withProtectedItemDataSourceId(reader.getString());
+ } else if ("protectedItemHealthStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ .withProtectedItemHealthStatus(ProtectedItemHealthStatus.fromString(reader.getString()));
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem
+ .withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo.fromJson(reader));
+ } else if ("kpisHealths".equals(fieldName)) {
+ Map kpisHealths
+ = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1));
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.withKpisHealths(kpisHealths);
+ } else if ("nodesList".equals(fieldName)) {
+ List nodesList
+ = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1));
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.withNodesList(nodesList);
+ } else if ("protectedItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseProtectedItem.protectedItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadAnyDatabaseProtectedItem;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadAnyDatabaseWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadAnyDatabaseWorkloadItem.java
new file mode 100644
index 0000000000000..ba9c3a4936ada
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadAnyDatabaseWorkloadItem.java
@@ -0,0 +1,196 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Azure VM workload-specific workload item representing Any Database.
+ */
+@Fluent
+public final class AzureVmWorkloadAnyDatabaseWorkloadItem extends AzureVmWorkloadItem {
+ /*
+ * Type of the backup item.
+ */
+ private String workloadItemType = "AnyDataBase";
+
+ /**
+ * Creates an instance of AzureVmWorkloadAnyDatabaseWorkloadItem class.
+ */
+ public AzureVmWorkloadAnyDatabaseWorkloadItem() {
+ }
+
+ /**
+ * Get the workloadItemType property: Type of the backup item.
+ *
+ * @return the workloadItemType value.
+ */
+ @Override
+ public String workloadItemType() {
+ return this.workloadItemType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseWorkloadItem withParentName(String parentName) {
+ super.withParentName(parentName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseWorkloadItem withServerName(String serverName) {
+ super.withServerName(serverName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseWorkloadItem withIsAutoProtectable(Boolean isAutoProtectable) {
+ super.withIsAutoProtectable(isAutoProtectable);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseWorkloadItem withSubinquireditemcount(Integer subinquireditemcount) {
+ super.withSubinquireditemcount(subinquireditemcount);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseWorkloadItem withSubWorkloadItemCount(Integer subWorkloadItemCount) {
+ super.withSubWorkloadItemCount(subWorkloadItemCount);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseWorkloadItem withBackupManagementType(String backupManagementType) {
+ super.withBackupManagementType(backupManagementType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseWorkloadItem withWorkloadType(String workloadType) {
+ super.withWorkloadType(workloadType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseWorkloadItem withFriendlyName(String friendlyName) {
+ super.withFriendlyName(friendlyName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadAnyDatabaseWorkloadItem withProtectionState(ProtectionStatus protectionState) {
+ super.withProtectionState(protectionState);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subWorkloadItemCount", subWorkloadItemCount());
+ jsonWriter.writeStringField("workloadItemType", this.workloadItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadAnyDatabaseWorkloadItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadAnyDatabaseWorkloadItem if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadAnyDatabaseWorkloadItem.
+ */
+ public static AzureVmWorkloadAnyDatabaseWorkloadItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadAnyDatabaseWorkloadItem deserializedAzureVmWorkloadAnyDatabaseWorkloadItem
+ = new AzureVmWorkloadAnyDatabaseWorkloadItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseWorkloadItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseWorkloadItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseWorkloadItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseWorkloadItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseWorkloadItem.withParentName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseWorkloadItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseWorkloadItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseWorkloadItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subWorkloadItemCount".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseWorkloadItem
+ .withSubWorkloadItemCount(reader.getNullable(JsonReader::getInt));
+ } else if ("workloadItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadAnyDatabaseWorkloadItem.workloadItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadAnyDatabaseWorkloadItem;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadItem.java
index 630957362a934..e56c106193c23 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadItem.java
@@ -5,65 +5,44 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload-specific workload item.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "workloadItemType",
- defaultImpl = AzureVmWorkloadItem.class,
- visible = true)
-@JsonTypeName("AzureVmWorkloadItem")
-@JsonSubTypes({
- @JsonSubTypes.Type(name = "SAPAseDatabase", value = AzureVmWorkloadSapAseDatabaseWorkloadItem.class),
- @JsonSubTypes.Type(name = "SAPAseSystem", value = AzureVmWorkloadSapAseSystemWorkloadItem.class),
- @JsonSubTypes.Type(name = "SAPHanaDatabase", value = AzureVmWorkloadSapHanaDatabaseWorkloadItem.class),
- @JsonSubTypes.Type(name = "SAPHanaSystem", value = AzureVmWorkloadSapHanaSystemWorkloadItem.class),
- @JsonSubTypes.Type(name = "SQLDataBase", value = AzureVmWorkloadSqlDatabaseWorkloadItem.class),
- @JsonSubTypes.Type(name = "SQLInstance", value = AzureVmWorkloadSqlInstanceWorkloadItem.class) })
@Fluent
public class AzureVmWorkloadItem extends WorkloadItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "workloadItemType", required = true)
private String workloadItemType = "AzureVmWorkloadItem";
/*
* Name for instance or AG
*/
- @JsonProperty(value = "parentName")
private String parentName;
/*
* Host/Cluster Name for instance or AG
*/
- @JsonProperty(value = "serverName")
private String serverName;
/*
* Indicates if workload item is auto-protectable
*/
- @JsonProperty(value = "isAutoProtectable")
private Boolean isAutoProtectable;
/*
* For instance or AG, indicates number of DB's present
*/
- @JsonProperty(value = "subinquireditemcount")
private Integer subinquireditemcount;
/*
* For instance or AG, indicates number of DB's to be protected
*/
- @JsonProperty(value = "subWorkloadItemCount")
private Integer subWorkloadItemCount;
/**
@@ -225,6 +204,108 @@ public AzureVmWorkloadItem withProtectionState(ProtectionStatus protectionState)
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("workloadItemType", this.workloadItemType);
+ jsonWriter.writeStringField("parentName", this.parentName);
+ jsonWriter.writeStringField("serverName", this.serverName);
+ jsonWriter.writeBooleanField("isAutoProtectable", this.isAutoProtectable);
+ jsonWriter.writeNumberField("subinquireditemcount", this.subinquireditemcount);
+ jsonWriter.writeNumberField("subWorkloadItemCount", this.subWorkloadItemCount);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadItem if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadItem.
+ */
+ public static AzureVmWorkloadItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("workloadItemType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("SAPAseDatabase".equals(discriminatorValue)) {
+ return AzureVmWorkloadSapAseDatabaseWorkloadItem.fromJson(readerToUse.reset());
+ } else if ("SAPAseSystem".equals(discriminatorValue)) {
+ return AzureVmWorkloadSapAseSystemWorkloadItem.fromJson(readerToUse.reset());
+ } else if ("OracleDataBase".equals(discriminatorValue)) {
+ return AzureVmWorkloadOracleDatabaseWorkloadItem.fromJson(readerToUse.reset());
+ } else if ("AnyDataBase".equals(discriminatorValue)) {
+ return AzureVmWorkloadAnyDatabaseWorkloadItem.fromJson(readerToUse.reset());
+ } else if ("SAPHanaDatabase".equals(discriminatorValue)) {
+ return AzureVmWorkloadSapHanaDatabaseWorkloadItem.fromJson(readerToUse.reset());
+ } else if ("SAPHanaSystem".equals(discriminatorValue)) {
+ return AzureVmWorkloadSapHanaSystemWorkloadItem.fromJson(readerToUse.reset());
+ } else if ("SQLDataBase".equals(discriminatorValue)) {
+ return AzureVmWorkloadSqlDatabaseWorkloadItem.fromJson(readerToUse.reset());
+ } else if ("SQLInstance".equals(discriminatorValue)) {
+ return AzureVmWorkloadSqlInstanceWorkloadItem.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static AzureVmWorkloadItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadItem deserializedAzureVmWorkloadItem = new AzureVmWorkloadItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("workloadItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadItem.workloadItemType = reader.getString();
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadItem.parentName = reader.getString();
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadItem.serverName = reader.getString();
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadItem.isAutoProtectable = reader.getNullable(JsonReader::getBoolean);
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadItem.subinquireditemcount = reader.getNullable(JsonReader::getInt);
+ } else if ("subWorkloadItemCount".equals(fieldName)) {
+ deserializedAzureVmWorkloadItem.subWorkloadItemCount = reader.getNullable(JsonReader::getInt);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadOracleDatabaseProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadOracleDatabaseProtectableItem.java
new file mode 100644
index 0000000000000..1082d44eeafaf
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadOracleDatabaseProtectableItem.java
@@ -0,0 +1,252 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Azure VM workload-specific protectable item representing Oracle DB.
+ */
+@Fluent
+public final class AzureVmWorkloadOracleDatabaseProtectableItem extends AzureVmWorkloadProtectableItem {
+ /*
+ * Type of the backup item.
+ */
+ private String protectableItemType = "OracleDatabase";
+
+ /**
+ * Creates an instance of AzureVmWorkloadOracleDatabaseProtectableItem class.
+ */
+ public AzureVmWorkloadOracleDatabaseProtectableItem() {
+ }
+
+ /**
+ * Get the protectableItemType property: Type of the backup item.
+ *
+ * @return the protectableItemType value.
+ */
+ @Override
+ public String protectableItemType() {
+ return this.protectableItemType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectableItem withParentName(String parentName) {
+ super.withParentName(parentName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectableItem withParentUniqueName(String parentUniqueName) {
+ super.withParentUniqueName(parentUniqueName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectableItem withServerName(String serverName) {
+ super.withServerName(serverName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectableItem withIsAutoProtectable(Boolean isAutoProtectable) {
+ super.withIsAutoProtectable(isAutoProtectable);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectableItem withIsAutoProtected(Boolean isAutoProtected) {
+ super.withIsAutoProtected(isAutoProtected);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectableItem withSubinquireditemcount(Integer subinquireditemcount) {
+ super.withSubinquireditemcount(subinquireditemcount);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectableItem withSubprotectableitemcount(Integer subprotectableitemcount) {
+ super.withSubprotectableitemcount(subprotectableitemcount);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectableItem
+ withPrebackupvalidation(PreBackupValidation prebackupvalidation) {
+ super.withPrebackupvalidation(prebackupvalidation);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectableItem withIsProtectable(Boolean isProtectable) {
+ super.withIsProtectable(isProtectable);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectableItem withBackupManagementType(String backupManagementType) {
+ super.withBackupManagementType(backupManagementType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectableItem withWorkloadType(String workloadType) {
+ super.withWorkloadType(workloadType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectableItem withFriendlyName(String friendlyName) {
+ super.withFriendlyName(friendlyName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectableItem withProtectionState(ProtectionStatus protectionState) {
+ super.withProtectionState(protectionState);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (prebackupvalidation() != null) {
+ prebackupvalidation().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentUniqueName", parentUniqueName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount());
+ jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation());
+ jsonWriter.writeBooleanField("isProtectable", isProtectable());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadOracleDatabaseProtectableItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadOracleDatabaseProtectableItem if the JsonReader was pointing to an instance
+ * of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadOracleDatabaseProtectableItem.
+ */
+ public static AzureVmWorkloadOracleDatabaseProtectableItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadOracleDatabaseProtectableItem deserializedAzureVmWorkloadOracleDatabaseProtectableItem
+ = new AzureVmWorkloadOracleDatabaseProtectableItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectableItem
+ .withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectableItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectableItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectableItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectableItem.withParentName(reader.getString());
+ } else if ("parentUniqueName".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectableItem.withParentUniqueName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectableItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectableItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isAutoProtected".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectableItem
+ .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectableItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subprotectableitemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectableItem
+ .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("prebackupvalidation".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectableItem
+ .withPrebackupvalidation(PreBackupValidation.fromJson(reader));
+ } else if ("isProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectableItem
+ .withIsProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectableItem.protectableItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadOracleDatabaseProtectableItem;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadOracleDatabaseProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadOracleDatabaseProtectedItem.java
new file mode 100644
index 0000000000000..32bfdd7bf0c55
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadOracleDatabaseProtectedItem.java
@@ -0,0 +1,554 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Azure VM workload-specific protected item representing Oracle Database.
+ */
+@Fluent
+public final class AzureVmWorkloadOracleDatabaseProtectedItem extends AzureVmWorkloadProtectedItem {
+ /*
+ * backup item type.
+ */
+ private String protectedItemType = "AzureVmWorkloadOracleDatabase";
+
+ /*
+ * Backup status of this backup item.
+ */
+ private String protectionStatus;
+
+ /*
+ * Friendly name of the DB represented by this backup item.
+ */
+ private String friendlyName;
+
+ /*
+ * ID of the vault which protects this item
+ */
+ private String vaultId;
+
+ /*
+ * Type of workload this item represents.
+ */
+ private DataSourceTypeAutoGenerated3 workloadType;
+
+ /*
+ * Type of backup management for the backed up item.
+ */
+ private BackupManagementType backupManagementType;
+
+ /**
+ * Creates an instance of AzureVmWorkloadOracleDatabaseProtectedItem class.
+ */
+ public AzureVmWorkloadOracleDatabaseProtectedItem() {
+ }
+
+ /**
+ * Get the protectedItemType property: backup item type.
+ *
+ * @return the protectedItemType value.
+ */
+ @Override
+ public String protectedItemType() {
+ return this.protectedItemType;
+ }
+
+ /**
+ * Get the protectionStatus property: Backup status of this backup item.
+ *
+ * @return the protectionStatus value.
+ */
+ @Override
+ public String protectionStatus() {
+ return this.protectionStatus;
+ }
+
+ /**
+ * Get the friendlyName property: Friendly name of the DB represented by this backup item.
+ *
+ * @return the friendlyName value.
+ */
+ @Override
+ public String friendlyName() {
+ return this.friendlyName;
+ }
+
+ /**
+ * Get the vaultId property: ID of the vault which protects this item.
+ *
+ * @return the vaultId value.
+ */
+ @Override
+ public String vaultId() {
+ return this.vaultId;
+ }
+
+ /**
+ * Get the workloadType property: Type of workload this item represents.
+ *
+ * @return the workloadType value.
+ */
+ @Override
+ public DataSourceTypeAutoGenerated3 workloadType() {
+ return this.workloadType;
+ }
+
+ /**
+ * Get the backupManagementType property: Type of backup management for the backed up item.
+ *
+ * @return the backupManagementType value.
+ */
+ @Override
+ public BackupManagementType backupManagementType() {
+ return this.backupManagementType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withServerName(String serverName) {
+ super.withServerName(serverName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withParentName(String parentName) {
+ super.withParentName(parentName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withParentType(String parentType) {
+ super.withParentType(parentType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withProtectionState(ProtectionState protectionState) {
+ super.withProtectionState(protectionState);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withLastBackupStatus(LastBackupStatus lastBackupStatus) {
+ super.withLastBackupStatus(lastBackupStatus);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) {
+ super.withLastBackupTime(lastBackupTime);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withLastBackupErrorDetail(ErrorDetail lastBackupErrorDetail) {
+ super.withLastBackupErrorDetail(lastBackupErrorDetail);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withProtectedItemDataSourceId(String protectedItemDataSourceId) {
+ super.withProtectedItemDataSourceId(protectedItemDataSourceId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem
+ withProtectedItemHealthStatus(ProtectedItemHealthStatus protectedItemHealthStatus) {
+ super.withProtectedItemHealthStatus(protectedItemHealthStatus);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem
+ withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo extendedInfo) {
+ super.withExtendedInfo(extendedInfo);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem
+ withKpisHealths(Map kpisHealths) {
+ super.withKpisHealths(kpisHealths);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withNodesList(List nodesList) {
+ super.withNodesList(nodesList);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withContainerName(String containerName) {
+ super.withContainerName(containerName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withSourceResourceId(String sourceResourceId) {
+ super.withSourceResourceId(sourceResourceId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withPolicyId(String policyId) {
+ super.withPolicyId(policyId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) {
+ super.withLastRecoveryPoint(lastRecoveryPoint);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withBackupSetName(String backupSetName) {
+ super.withBackupSetName(backupSetName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withCreateMode(CreateMode createMode) {
+ super.withCreateMode(createMode);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem
+ withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) {
+ super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem
+ withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) {
+ super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem
+ withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) {
+ super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem
+ withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) {
+ super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withIsRehydrate(Boolean isRehydrate) {
+ super.withIsRehydrate(isRehydrate);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem
+ withResourceGuardOperationRequests(List resourceGuardOperationRequests) {
+ super.withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) {
+ super.withIsArchiveEnabled(isArchiveEnabled);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withPolicyName(String policyName) {
+ super.withPolicyName(policyName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseProtectedItem withSoftDeleteRetentionPeriod(Integer softDeleteRetentionPeriod) {
+ super.withSoftDeleteRetentionPeriod(softDeleteRetentionPeriod);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (lastBackupErrorDetail() != null) {
+ lastBackupErrorDetail().validate();
+ }
+ if (extendedInfo() != null) {
+ extendedInfo().validate();
+ }
+ if (kpisHealths() != null) {
+ kpisHealths().values().forEach(e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ if (nodesList() != null) {
+ nodesList().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("containerName", containerName());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("lastRecoveryPoint",
+ lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint()));
+ jsonWriter.writeStringField("backupSetName", backupSetName());
+ jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString());
+ jsonWriter.writeStringField("deferredDeleteTimeInUTC",
+ deferredDeleteTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc()));
+ jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete());
+ jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining());
+ jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming());
+ jsonWriter.writeBooleanField("isRehydrate", isRehydrate());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled());
+ jsonWriter.writeStringField("policyName", policyName());
+ jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriod());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentType", parentType());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("lastBackupStatus",
+ lastBackupStatus() == null ? null : lastBackupStatus().toString());
+ jsonWriter.writeStringField("lastBackupTime",
+ lastBackupTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastBackupTime()));
+ jsonWriter.writeJsonField("lastBackupErrorDetail", lastBackupErrorDetail());
+ jsonWriter.writeStringField("protectedItemDataSourceId", protectedItemDataSourceId());
+ jsonWriter.writeStringField("protectedItemHealthStatus",
+ protectedItemHealthStatus() == null ? null : protectedItemHealthStatus().toString());
+ jsonWriter.writeJsonField("extendedInfo", extendedInfo());
+ jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("nodesList", nodesList(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("protectedItemType", this.protectedItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadOracleDatabaseProtectedItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadOracleDatabaseProtectedItem if the JsonReader was pointing to an instance
+ * of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadOracleDatabaseProtectedItem.
+ */
+ public static AzureVmWorkloadOracleDatabaseProtectedItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadOracleDatabaseProtectedItem deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ = new AzureVmWorkloadOracleDatabaseProtectedItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.backupManagementType
+ = BackupManagementType.fromString(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.workloadType
+ = DataSourceTypeAutoGenerated3.fromString(reader.getString());
+ } else if ("containerName".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.withContainerName(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.withSourceResourceId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.withPolicyId(reader.getString());
+ } else if ("lastRecoveryPoint".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.withLastRecoveryPoint(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("backupSetName".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.withBackupSetName(reader.getString());
+ } else if ("createMode".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ .withCreateMode(CreateMode.fromString(reader.getString()));
+ } else if ("deferredDeleteTimeInUTC".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.withDeferredDeleteTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("isScheduledForDeferredDelete".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean));
+ } else if ("deferredDeleteTimeRemaining".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ .withDeferredDeleteTimeRemaining(reader.getString());
+ } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isRehydrate".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ .withIsRehydrate(reader.getNullable(JsonReader::getBoolean));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("isArchiveEnabled".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean));
+ } else if ("policyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.withPolicyName(reader.getString());
+ } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ .withSoftDeleteRetentionPeriod(reader.getNullable(JsonReader::getInt));
+ } else if ("vaultId".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.vaultId = reader.getString();
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.friendlyName = reader.getString();
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.withServerName(reader.getString());
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.withParentName(reader.getString());
+ } else if ("parentType".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.withParentType(reader.getString());
+ } else if ("protectionStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.protectionStatus = reader.getString();
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ .withProtectionState(ProtectionState.fromString(reader.getString()));
+ } else if ("lastBackupStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ .withLastBackupStatus(LastBackupStatus.fromString(reader.getString()));
+ } else if ("lastBackupTime".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.withLastBackupTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("lastBackupErrorDetail".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ .withLastBackupErrorDetail(ErrorDetail.fromJson(reader));
+ } else if ("protectedItemDataSourceId".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ .withProtectedItemDataSourceId(reader.getString());
+ } else if ("protectedItemHealthStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ .withProtectedItemHealthStatus(ProtectedItemHealthStatus.fromString(reader.getString()));
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem
+ .withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo.fromJson(reader));
+ } else if ("kpisHealths".equals(fieldName)) {
+ Map kpisHealths
+ = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1));
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.withKpisHealths(kpisHealths);
+ } else if ("nodesList".equals(fieldName)) {
+ List nodesList
+ = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1));
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.withNodesList(nodesList);
+ } else if ("protectedItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseProtectedItem.protectedItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadOracleDatabaseProtectedItem;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadOracleDatabaseWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadOracleDatabaseWorkloadItem.java
new file mode 100644
index 0000000000000..7cdd93825476d
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadOracleDatabaseWorkloadItem.java
@@ -0,0 +1,196 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Azure VM workload-specific workload item representing Oracle Database.
+ */
+@Fluent
+public final class AzureVmWorkloadOracleDatabaseWorkloadItem extends AzureVmWorkloadItem {
+ /*
+ * Type of the backup item.
+ */
+ private String workloadItemType = "OracleDataBase";
+
+ /**
+ * Creates an instance of AzureVmWorkloadOracleDatabaseWorkloadItem class.
+ */
+ public AzureVmWorkloadOracleDatabaseWorkloadItem() {
+ }
+
+ /**
+ * Get the workloadItemType property: Type of the backup item.
+ *
+ * @return the workloadItemType value.
+ */
+ @Override
+ public String workloadItemType() {
+ return this.workloadItemType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseWorkloadItem withParentName(String parentName) {
+ super.withParentName(parentName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseWorkloadItem withServerName(String serverName) {
+ super.withServerName(serverName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseWorkloadItem withIsAutoProtectable(Boolean isAutoProtectable) {
+ super.withIsAutoProtectable(isAutoProtectable);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseWorkloadItem withSubinquireditemcount(Integer subinquireditemcount) {
+ super.withSubinquireditemcount(subinquireditemcount);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseWorkloadItem withSubWorkloadItemCount(Integer subWorkloadItemCount) {
+ super.withSubWorkloadItemCount(subWorkloadItemCount);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseWorkloadItem withBackupManagementType(String backupManagementType) {
+ super.withBackupManagementType(backupManagementType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseWorkloadItem withWorkloadType(String workloadType) {
+ super.withWorkloadType(workloadType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseWorkloadItem withFriendlyName(String friendlyName) {
+ super.withFriendlyName(friendlyName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadOracleDatabaseWorkloadItem withProtectionState(ProtectionStatus protectionState) {
+ super.withProtectionState(protectionState);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subWorkloadItemCount", subWorkloadItemCount());
+ jsonWriter.writeStringField("workloadItemType", this.workloadItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadOracleDatabaseWorkloadItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadOracleDatabaseWorkloadItem if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadOracleDatabaseWorkloadItem.
+ */
+ public static AzureVmWorkloadOracleDatabaseWorkloadItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadOracleDatabaseWorkloadItem deserializedAzureVmWorkloadOracleDatabaseWorkloadItem
+ = new AzureVmWorkloadOracleDatabaseWorkloadItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseWorkloadItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseWorkloadItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseWorkloadItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseWorkloadItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseWorkloadItem.withParentName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseWorkloadItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseWorkloadItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseWorkloadItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subWorkloadItemCount".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseWorkloadItem
+ .withSubWorkloadItemCount(reader.getNullable(JsonReader::getInt));
+ } else if ("workloadItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadOracleDatabaseWorkloadItem.workloadItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadOracleDatabaseWorkloadItem;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectableItem.java
index 5a17a578d9735..f7c74bd4e0403 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectableItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectableItem.java
@@ -5,94 +5,65 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload-specific protectable item.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectableItemType",
- defaultImpl = AzureVmWorkloadProtectableItem.class,
- visible = true)
-@JsonTypeName("AzureVmWorkloadProtectableItem")
-@JsonSubTypes({
- @JsonSubTypes.Type(name = "SAPAseSystem", value = AzureVmWorkloadSapAseSystemProtectableItem.class),
- @JsonSubTypes.Type(name = "SAPHanaDatabase", value = AzureVmWorkloadSapHanaDatabaseProtectableItem.class),
- @JsonSubTypes.Type(name = "SAPHanaSystem", value = AzureVmWorkloadSapHanaSystemProtectableItem.class),
- @JsonSubTypes.Type(name = "SAPHanaDBInstance", value = AzureVmWorkloadSapHanaDBInstance.class),
- @JsonSubTypes.Type(name = "HanaHSRContainer", value = AzureVmWorkloadSapHanaHsr.class),
- @JsonSubTypes.Type(
- name = "SQLAvailabilityGroupContainer",
- value = AzureVmWorkloadSqlAvailabilityGroupProtectableItem.class),
- @JsonSubTypes.Type(name = "SQLDataBase", value = AzureVmWorkloadSqlDatabaseProtectableItem.class),
- @JsonSubTypes.Type(name = "SQLInstance", value = AzureVmWorkloadSqlInstanceProtectableItem.class) })
@Fluent
public class AzureVmWorkloadProtectableItem extends WorkloadProtectableItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "protectableItemType", required = true)
private String protectableItemType = "AzureVmWorkloadProtectableItem";
/*
* Name for instance or AG
*/
- @JsonProperty(value = "parentName")
private String parentName;
/*
* Parent Unique Name is added to provide the service formatted URI Name of the Parent
* Only Applicable for data bases where the parent would be either Instance or a SQL AG.
*/
- @JsonProperty(value = "parentUniqueName")
private String parentUniqueName;
/*
* Host/Cluster Name for instance or AG
*/
- @JsonProperty(value = "serverName")
private String serverName;
/*
* Indicates if protectable item is auto-protectable
*/
- @JsonProperty(value = "isAutoProtectable")
private Boolean isAutoProtectable;
/*
* Indicates if protectable item is auto-protected
*/
- @JsonProperty(value = "isAutoProtected")
private Boolean isAutoProtected;
/*
* For instance or AG, indicates number of DB's present
*/
- @JsonProperty(value = "subinquireditemcount")
private Integer subinquireditemcount;
/*
* For instance or AG, indicates number of DB's to be protected
*/
- @JsonProperty(value = "subprotectableitemcount")
private Integer subprotectableitemcount;
/*
* Pre-backup validation for protectable objects
*/
- @JsonProperty(value = "prebackupvalidation")
private PreBackupValidation prebackupvalidation;
/*
* Indicates if item is protectable
*/
- @JsonProperty(value = "isProtectable")
private Boolean isProtectable;
/**
@@ -338,9 +309,136 @@ public AzureVmWorkloadProtectableItem withProtectionState(ProtectionStatus prote
*/
@Override
public void validate() {
- super.validate();
if (prebackupvalidation() != null) {
prebackupvalidation().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ jsonWriter.writeStringField("parentName", this.parentName);
+ jsonWriter.writeStringField("parentUniqueName", this.parentUniqueName);
+ jsonWriter.writeStringField("serverName", this.serverName);
+ jsonWriter.writeBooleanField("isAutoProtectable", this.isAutoProtectable);
+ jsonWriter.writeBooleanField("isAutoProtected", this.isAutoProtected);
+ jsonWriter.writeNumberField("subinquireditemcount", this.subinquireditemcount);
+ jsonWriter.writeNumberField("subprotectableitemcount", this.subprotectableitemcount);
+ jsonWriter.writeJsonField("prebackupvalidation", this.prebackupvalidation);
+ jsonWriter.writeBooleanField("isProtectable", this.isProtectable);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadProtectableItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadProtectableItem if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadProtectableItem.
+ */
+ public static AzureVmWorkloadProtectableItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("protectableItemType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("SAPAseSystem".equals(discriminatorValue)) {
+ return AzureVmWorkloadSapAseSystemProtectableItem.fromJson(readerToUse.reset());
+ } else if ("SAPHanaDatabase".equals(discriminatorValue)) {
+ return AzureVmWorkloadSapHanaDatabaseProtectableItem.fromJson(readerToUse.reset());
+ } else if ("SAPHanaSystem".equals(discriminatorValue)) {
+ return AzureVmWorkloadSapHanaSystemProtectableItem.fromJson(readerToUse.reset());
+ } else if ("SAPHanaDBInstance".equals(discriminatorValue)) {
+ return AzureVmWorkloadSapHanaDBInstance.fromJson(readerToUse.reset());
+ } else if ("HanaHSRContainer".equals(discriminatorValue)) {
+ return AzureVmWorkloadSapHanaHsr.fromJson(readerToUse.reset());
+ } else if ("OracleDatabase".equals(discriminatorValue)) {
+ return AzureVmWorkloadOracleDatabaseProtectableItem.fromJson(readerToUse.reset());
+ } else if ("AnyDatabase".equals(discriminatorValue)) {
+ return AzureVmWorkloadAnyDatabaseProtectableItem.fromJson(readerToUse.reset());
+ } else if ("HanaScaleoutContainer".equals(discriminatorValue)) {
+ return AzureVmWorkloadSapHanaScaleoutProtectableItem.fromJson(readerToUse.reset());
+ } else if ("SQLAvailabilityGroupContainer".equals(discriminatorValue)) {
+ return AzureVmWorkloadSqlAvailabilityGroupProtectableItem.fromJson(readerToUse.reset());
+ } else if ("SQLDataBase".equals(discriminatorValue)) {
+ return AzureVmWorkloadSqlDatabaseProtectableItem.fromJson(readerToUse.reset());
+ } else if ("SQLInstance".equals(discriminatorValue)) {
+ return AzureVmWorkloadSqlInstanceProtectableItem.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static AzureVmWorkloadProtectableItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadProtectableItem deserializedAzureVmWorkloadProtectableItem
+ = new AzureVmWorkloadProtectableItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectableItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectableItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectableItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectableItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectableItem.protectableItemType = reader.getString();
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectableItem.parentName = reader.getString();
+ } else if ("parentUniqueName".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectableItem.parentUniqueName = reader.getString();
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectableItem.serverName = reader.getString();
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectableItem.isAutoProtectable
+ = reader.getNullable(JsonReader::getBoolean);
+ } else if ("isAutoProtected".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectableItem.isAutoProtected
+ = reader.getNullable(JsonReader::getBoolean);
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectableItem.subinquireditemcount
+ = reader.getNullable(JsonReader::getInt);
+ } else if ("subprotectableitemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectableItem.subprotectableitemcount
+ = reader.getNullable(JsonReader::getInt);
+ } else if ("prebackupvalidation".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectableItem.prebackupvalidation
+ = PreBackupValidation.fromJson(reader);
+ } else if ("isProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectableItem.isProtectable
+ = reader.getNullable(JsonReader::getBoolean);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadProtectableItem;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java
index d01c3ead991bc..d8748deb4e2ed 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java
@@ -5,130 +5,111 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
/**
* Azure VM workload-specific protected item.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectedItemType",
- defaultImpl = AzureVmWorkloadProtectedItem.class,
- visible = true)
-@JsonTypeName("AzureVmWorkloadProtectedItem")
-@JsonSubTypes({
- @JsonSubTypes.Type(
- name = "AzureVmWorkloadSAPAseDatabase",
- value = AzureVmWorkloadSapAseDatabaseProtectedItem.class),
- @JsonSubTypes.Type(
- name = "AzureVmWorkloadSAPHanaDatabase",
- value = AzureVmWorkloadSapHanaDatabaseProtectedItem.class),
- @JsonSubTypes.Type(
- name = "AzureVmWorkloadSAPHanaDBInstance",
- value = AzureVmWorkloadSapHanaDBInstanceProtectedItem.class),
- @JsonSubTypes.Type(name = "AzureVmWorkloadSQLDatabase", value = AzureVmWorkloadSqlDatabaseProtectedItem.class) })
@Fluent
public class AzureVmWorkloadProtectedItem extends ProtectedItem {
/*
* backup item type.
*/
- @JsonTypeId
- @JsonProperty(value = "protectedItemType", required = true)
private String protectedItemType = "AzureVmWorkloadProtectedItem";
/*
* Friendly name of the DB represented by this backup item.
*/
- @JsonProperty(value = "friendlyName", access = JsonProperty.Access.WRITE_ONLY)
private String friendlyName;
/*
* Host/Cluster Name for instance or AG
*/
- @JsonProperty(value = "serverName")
private String serverName;
/*
* Parent name of the DB such as Instance or Availability Group.
*/
- @JsonProperty(value = "parentName")
private String parentName;
/*
* Parent type of protected item, example: for a DB, standalone server or distributed
*/
- @JsonProperty(value = "parentType")
private String parentType;
/*
* Backup status of this backup item.
*/
- @JsonProperty(value = "protectionStatus", access = JsonProperty.Access.WRITE_ONLY)
private String protectionStatus;
/*
* Backup state of this backup item.
*/
- @JsonProperty(value = "protectionState")
private ProtectionState protectionState;
/*
* Last backup operation status. Possible values: Healthy, Unhealthy.
*/
- @JsonProperty(value = "lastBackupStatus")
private LastBackupStatus lastBackupStatus;
/*
* Timestamp of the last backup operation on this backup item.
*/
- @JsonProperty(value = "lastBackupTime")
private OffsetDateTime lastBackupTime;
/*
* Error details in last backup
*/
- @JsonProperty(value = "lastBackupErrorDetail")
private ErrorDetail lastBackupErrorDetail;
/*
* Data ID of the protected item.
*/
- @JsonProperty(value = "protectedItemDataSourceId")
private String protectedItemDataSourceId;
/*
* Health status of the backup item, evaluated based on last heartbeat received
*/
- @JsonProperty(value = "protectedItemHealthStatus")
private ProtectedItemHealthStatus protectedItemHealthStatus;
/*
* Additional information for this backup item.
*/
- @JsonProperty(value = "extendedInfo")
private AzureVmWorkloadProtectedItemExtendedInfo extendedInfo;
/*
* Health details of different KPIs
*/
- @JsonProperty(value = "kpisHealths")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map kpisHealths;
/*
* List of the nodes in case of distributed container.
*/
- @JsonProperty(value = "nodesList")
private List nodesList;
+ /*
+ * ID of the vault which protects this item
+ */
+ private String vaultId;
+
+ /*
+ * Type of workload this item represents.
+ */
+ private DataSourceTypeAutoGenerated3 workloadType;
+
+ /*
+ * Type of backup management for the backed up item.
+ */
+ private BackupManagementType backupManagementType;
+
/**
* Creates an instance of AzureVmWorkloadProtectedItem class.
*/
@@ -154,6 +135,17 @@ public String friendlyName() {
return this.friendlyName;
}
+ /**
+ * Set the friendlyName property: Friendly name of the DB represented by this backup item.
+ *
+ * @param friendlyName the friendlyName value to set.
+ * @return the AzureVmWorkloadProtectedItem object itself.
+ */
+ AzureVmWorkloadProtectedItem withFriendlyName(String friendlyName) {
+ this.friendlyName = friendlyName;
+ return this;
+ }
+
/**
* Get the serverName property: Host/Cluster Name for instance or AG.
*
@@ -223,6 +215,17 @@ public String protectionStatus() {
return this.protectionStatus;
}
+ /**
+ * Set the protectionStatus property: Backup status of this backup item.
+ *
+ * @param protectionStatus the protectionStatus value to set.
+ * @return the AzureVmWorkloadProtectedItem object itself.
+ */
+ AzureVmWorkloadProtectedItem withProtectionStatus(String protectionStatus) {
+ this.protectionStatus = protectionStatus;
+ return this;
+ }
+
/**
* Get the protectionState property: Backup state of this backup item.
*
@@ -406,6 +409,36 @@ public AzureVmWorkloadProtectedItem withNodesList(List nod
return this;
}
+ /**
+ * Get the vaultId property: ID of the vault which protects this item.
+ *
+ * @return the vaultId value.
+ */
+ @Override
+ public String vaultId() {
+ return this.vaultId;
+ }
+
+ /**
+ * Get the workloadType property: Type of workload this item represents.
+ *
+ * @return the workloadType value.
+ */
+ @Override
+ public DataSourceTypeAutoGenerated3 workloadType() {
+ return this.workloadType;
+ }
+
+ /**
+ * Get the backupManagementType property: Type of backup management for the backed up item.
+ *
+ * @return the backupManagementType value.
+ */
+ @Override
+ public BackupManagementType backupManagementType() {
+ return this.backupManagementType;
+ }
+
/**
* {@inheritDoc}
*/
@@ -549,7 +582,6 @@ public AzureVmWorkloadProtectedItem withSoftDeleteRetentionPeriod(Integer softDe
*/
@Override
public void validate() {
- super.validate();
if (lastBackupErrorDetail() != null) {
lastBackupErrorDetail().validate();
}
@@ -567,4 +599,195 @@ public void validate() {
nodesList().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("containerName", containerName());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("lastRecoveryPoint",
+ lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint()));
+ jsonWriter.writeStringField("backupSetName", backupSetName());
+ jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString());
+ jsonWriter.writeStringField("deferredDeleteTimeInUTC",
+ deferredDeleteTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc()));
+ jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete());
+ jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining());
+ jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming());
+ jsonWriter.writeBooleanField("isRehydrate", isRehydrate());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled());
+ jsonWriter.writeStringField("policyName", policyName());
+ jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriod());
+ jsonWriter.writeStringField("protectedItemType", this.protectedItemType);
+ jsonWriter.writeStringField("serverName", this.serverName);
+ jsonWriter.writeStringField("parentName", this.parentName);
+ jsonWriter.writeStringField("parentType", this.parentType);
+ jsonWriter.writeStringField("protectionState",
+ this.protectionState == null ? null : this.protectionState.toString());
+ jsonWriter.writeStringField("lastBackupStatus",
+ this.lastBackupStatus == null ? null : this.lastBackupStatus.toString());
+ jsonWriter.writeStringField("lastBackupTime",
+ this.lastBackupTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastBackupTime));
+ jsonWriter.writeJsonField("lastBackupErrorDetail", this.lastBackupErrorDetail);
+ jsonWriter.writeStringField("protectedItemDataSourceId", this.protectedItemDataSourceId);
+ jsonWriter.writeStringField("protectedItemHealthStatus",
+ this.protectedItemHealthStatus == null ? null : this.protectedItemHealthStatus.toString());
+ jsonWriter.writeJsonField("extendedInfo", this.extendedInfo);
+ jsonWriter.writeMapField("kpisHealths", this.kpisHealths, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("nodesList", this.nodesList, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadProtectedItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadProtectedItem if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadProtectedItem.
+ */
+ public static AzureVmWorkloadProtectedItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("protectedItemType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("AzureVmWorkloadSAPAseDatabase".equals(discriminatorValue)) {
+ return AzureVmWorkloadSapAseDatabaseProtectedItem.fromJson(readerToUse.reset());
+ } else if ("AzureVmWorkloadOracleDatabase".equals(discriminatorValue)) {
+ return AzureVmWorkloadOracleDatabaseProtectedItem.fromJson(readerToUse.reset());
+ } else if ("AzureVmWorkloadAnyDatabase".equals(discriminatorValue)) {
+ return AzureVmWorkloadAnyDatabaseProtectedItem.fromJson(readerToUse.reset());
+ } else if ("AzureVmWorkloadSAPHanaDatabase".equals(discriminatorValue)) {
+ return AzureVmWorkloadSapHanaDatabaseProtectedItem.fromJson(readerToUse.reset());
+ } else if ("AzureVmWorkloadSAPHanaDBInstance".equals(discriminatorValue)) {
+ return AzureVmWorkloadSapHanaDBInstanceProtectedItem.fromJson(readerToUse.reset());
+ } else if ("AzureVmWorkloadSQLDatabase".equals(discriminatorValue)) {
+ return AzureVmWorkloadSqlDatabaseProtectedItem.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static AzureVmWorkloadProtectedItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadProtectedItem deserializedAzureVmWorkloadProtectedItem = new AzureVmWorkloadProtectedItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.backupManagementType
+ = BackupManagementType.fromString(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.workloadType
+ = DataSourceTypeAutoGenerated3.fromString(reader.getString());
+ } else if ("containerName".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.withContainerName(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.withSourceResourceId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.withPolicyId(reader.getString());
+ } else if ("lastRecoveryPoint".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.withLastRecoveryPoint(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("backupSetName".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.withBackupSetName(reader.getString());
+ } else if ("createMode".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.withCreateMode(CreateMode.fromString(reader.getString()));
+ } else if ("deferredDeleteTimeInUTC".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.withDeferredDeleteTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("isScheduledForDeferredDelete".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem
+ .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean));
+ } else if ("deferredDeleteTimeRemaining".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.withDeferredDeleteTimeRemaining(reader.getString());
+ } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem
+ .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isRehydrate".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem
+ .withIsRehydrate(reader.getNullable(JsonReader::getBoolean));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureVmWorkloadProtectedItem
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("isArchiveEnabled".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem
+ .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean));
+ } else if ("policyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.withPolicyName(reader.getString());
+ } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem
+ .withSoftDeleteRetentionPeriod(reader.getNullable(JsonReader::getInt));
+ } else if ("vaultId".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.vaultId = reader.getString();
+ } else if ("protectedItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.protectedItemType = reader.getString();
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.friendlyName = reader.getString();
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.serverName = reader.getString();
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.parentName = reader.getString();
+ } else if ("parentType".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.parentType = reader.getString();
+ } else if ("protectionStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.protectionStatus = reader.getString();
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.protectionState
+ = ProtectionState.fromString(reader.getString());
+ } else if ("lastBackupStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.lastBackupStatus
+ = LastBackupStatus.fromString(reader.getString());
+ } else if ("lastBackupTime".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.lastBackupTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("lastBackupErrorDetail".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.lastBackupErrorDetail = ErrorDetail.fromJson(reader);
+ } else if ("protectedItemDataSourceId".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.protectedItemDataSourceId = reader.getString();
+ } else if ("protectedItemHealthStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.protectedItemHealthStatus
+ = ProtectedItemHealthStatus.fromString(reader.getString());
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItem.extendedInfo
+ = AzureVmWorkloadProtectedItemExtendedInfo.fromJson(reader);
+ } else if ("kpisHealths".equals(fieldName)) {
+ Map kpisHealths
+ = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1));
+ deserializedAzureVmWorkloadProtectedItem.kpisHealths = kpisHealths;
+ } else if ("nodesList".equals(fieldName)) {
+ List nodesList
+ = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1));
+ deserializedAzureVmWorkloadProtectedItem.nodesList = nodesList;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadProtectedItem;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItemExtendedInfo.java
index ea8bdb12bf971..7185f0bcbb4c7 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItemExtendedInfo.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItemExtendedInfo.java
@@ -5,54 +5,54 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
/**
* Additional information on Azure Workload for SQL specific backup item.
*/
@Fluent
-public final class AzureVmWorkloadProtectedItemExtendedInfo {
+public final class AzureVmWorkloadProtectedItemExtendedInfo
+ implements JsonSerializable {
/*
* The oldest backup copy available for this backup item across all tiers.
*/
- @JsonProperty(value = "oldestRecoveryPoint")
private OffsetDateTime oldestRecoveryPoint;
/*
* The oldest backup copy available for this backup item in vault tier
*/
- @JsonProperty(value = "oldestRecoveryPointInVault")
private OffsetDateTime oldestRecoveryPointInVault;
/*
* The oldest backup copy available for this backup item in archive tier
*/
- @JsonProperty(value = "oldestRecoveryPointInArchive")
private OffsetDateTime oldestRecoveryPointInArchive;
/*
* The latest backup copy available for this backup item in archive tier
*/
- @JsonProperty(value = "newestRecoveryPointInArchive")
private OffsetDateTime newestRecoveryPointInArchive;
/*
* Number of backup copies available for this backup item.
*/
- @JsonProperty(value = "recoveryPointCount")
private Integer recoveryPointCount;
/*
* Indicates consistency of policy object and policy applied to this backup item.
*/
- @JsonProperty(value = "policyState")
private String policyState;
/*
* Indicates consistency of policy object and policy applied to this backup item.
*/
- @JsonProperty(value = "recoveryModel")
private String recoveryModel;
/**
@@ -215,4 +215,76 @@ public AzureVmWorkloadProtectedItemExtendedInfo withRecoveryModel(String recover
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("oldestRecoveryPoint",
+ this.oldestRecoveryPoint == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPoint));
+ jsonWriter.writeStringField("oldestRecoveryPointInVault",
+ this.oldestRecoveryPointInVault == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPointInVault));
+ jsonWriter.writeStringField("oldestRecoveryPointInArchive",
+ this.oldestRecoveryPointInArchive == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPointInArchive));
+ jsonWriter.writeStringField("newestRecoveryPointInArchive",
+ this.newestRecoveryPointInArchive == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.newestRecoveryPointInArchive));
+ jsonWriter.writeNumberField("recoveryPointCount", this.recoveryPointCount);
+ jsonWriter.writeStringField("policyState", this.policyState);
+ jsonWriter.writeStringField("recoveryModel", this.recoveryModel);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadProtectedItemExtendedInfo from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadProtectedItemExtendedInfo if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadProtectedItemExtendedInfo.
+ */
+ public static AzureVmWorkloadProtectedItemExtendedInfo fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadProtectedItemExtendedInfo deserializedAzureVmWorkloadProtectedItemExtendedInfo
+ = new AzureVmWorkloadProtectedItemExtendedInfo();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("oldestRecoveryPoint".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItemExtendedInfo.oldestRecoveryPoint = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("oldestRecoveryPointInVault".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItemExtendedInfo.oldestRecoveryPointInVault = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("oldestRecoveryPointInArchive".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItemExtendedInfo.oldestRecoveryPointInArchive = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("newestRecoveryPointInArchive".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItemExtendedInfo.newestRecoveryPointInArchive = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("recoveryPointCount".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItemExtendedInfo.recoveryPointCount
+ = reader.getNullable(JsonReader::getInt);
+ } else if ("policyState".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItemExtendedInfo.policyState = reader.getString();
+ } else if ("recoveryModel".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectedItemExtendedInfo.recoveryModel = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadProtectedItemExtendedInfo;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java
index 128bce807f883..f672a484db67e 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java
@@ -5,52 +5,46 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
/**
* Azure VM (Mercury) workload-specific backup policy.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "backupManagementType",
- defaultImpl = AzureVmWorkloadProtectionPolicy.class,
- visible = true)
-@JsonTypeName("AzureWorkload")
@Fluent
public final class AzureVmWorkloadProtectionPolicy extends ProtectionPolicy {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "backupManagementType", required = true)
private String backupManagementType = "AzureWorkload";
/*
* Type of workload for the backup management
*/
- @JsonProperty(value = "workLoadType")
private WorkloadType workLoadType;
+ /*
+ * Type of workload for the backup management
+ */
+ private VMWorkloadPolicyType vmWorkloadPolicyType;
+
/*
* Common settings for the backup management
*/
- @JsonProperty(value = "settings")
private Settings settings;
/*
* List of sub-protection policies which includes schedule and retention
*/
- @JsonProperty(value = "subProtectionPolicy")
private List subProtectionPolicy;
/*
* Fix the policy inconsistency
*/
- @JsonProperty(value = "makePolicyConsistent")
private Boolean makePolicyConsistent;
/**
@@ -90,6 +84,26 @@ public AzureVmWorkloadProtectionPolicy withWorkLoadType(WorkloadType workLoadTyp
return this;
}
+ /**
+ * Get the vmWorkloadPolicyType property: Type of workload for the backup management.
+ *
+ * @return the vmWorkloadPolicyType value.
+ */
+ public VMWorkloadPolicyType vmWorkloadPolicyType() {
+ return this.vmWorkloadPolicyType;
+ }
+
+ /**
+ * Set the vmWorkloadPolicyType property: Type of workload for the backup management.
+ *
+ * @param vmWorkloadPolicyType the vmWorkloadPolicyType value to set.
+ * @return the AzureVmWorkloadProtectionPolicy object itself.
+ */
+ public AzureVmWorkloadProtectionPolicy withVmWorkloadPolicyType(VMWorkloadPolicyType vmWorkloadPolicyType) {
+ this.vmWorkloadPolicyType = vmWorkloadPolicyType;
+ return this;
+ }
+
/**
* Get the settings property: Common settings for the backup management.
*
@@ -176,7 +190,6 @@ public AzureVmWorkloadProtectionPolicy withProtectedItemsCount(Integer protected
*/
@Override
public void validate() {
- super.validate();
if (settings() != null) {
settings().validate();
}
@@ -184,4 +197,73 @@ public void validate() {
subProtectionPolicy().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeNumberField("protectedItemsCount", protectedItemsCount());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("backupManagementType", this.backupManagementType);
+ jsonWriter.writeStringField("workLoadType", this.workLoadType == null ? null : this.workLoadType.toString());
+ jsonWriter.writeStringField("vmWorkloadPolicyType",
+ this.vmWorkloadPolicyType == null ? null : this.vmWorkloadPolicyType.toString());
+ jsonWriter.writeJsonField("settings", this.settings);
+ jsonWriter.writeArrayField("subProtectionPolicy", this.subProtectionPolicy,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeBooleanField("makePolicyConsistent", this.makePolicyConsistent);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadProtectionPolicy from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadProtectionPolicy if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadProtectionPolicy.
+ */
+ public static AzureVmWorkloadProtectionPolicy fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadProtectionPolicy deserializedAzureVmWorkloadProtectionPolicy
+ = new AzureVmWorkloadProtectionPolicy();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("protectedItemsCount".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectionPolicy
+ .withProtectedItemsCount(reader.getNullable(JsonReader::getInt));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureVmWorkloadProtectionPolicy
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectionPolicy.backupManagementType = reader.getString();
+ } else if ("workLoadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectionPolicy.workLoadType
+ = WorkloadType.fromString(reader.getString());
+ } else if ("vmWorkloadPolicyType".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectionPolicy.vmWorkloadPolicyType
+ = VMWorkloadPolicyType.fromString(reader.getString());
+ } else if ("settings".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectionPolicy.settings = Settings.fromJson(reader);
+ } else if ("subProtectionPolicy".equals(fieldName)) {
+ List subProtectionPolicy
+ = reader.readArray(reader1 -> SubProtectionPolicy.fromJson(reader1));
+ deserializedAzureVmWorkloadProtectionPolicy.subProtectionPolicy = subProtectionPolicy;
+ } else if ("makePolicyConsistent".equals(fieldName)) {
+ deserializedAzureVmWorkloadProtectionPolicy.makePolicyConsistent
+ = reader.getNullable(JsonReader::getBoolean);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadProtectionPolicy;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.java
index 0ef13f80bd6fa..bbf4d0aeba24b 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.java
@@ -5,32 +5,51 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
/**
* Azure VM workload-specific protected item representing SAP ASE Database.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectedItemType",
- defaultImpl = AzureVmWorkloadSapAseDatabaseProtectedItem.class,
- visible = true)
-@JsonTypeName("AzureVmWorkloadSAPAseDatabase")
@Fluent
public final class AzureVmWorkloadSapAseDatabaseProtectedItem extends AzureVmWorkloadProtectedItem {
/*
* backup item type.
*/
- @JsonTypeId
- @JsonProperty(value = "protectedItemType", required = true)
private String protectedItemType = "AzureVmWorkloadSAPAseDatabase";
+ /*
+ * Backup status of this backup item.
+ */
+ private String protectionStatus;
+
+ /*
+ * Friendly name of the DB represented by this backup item.
+ */
+ private String friendlyName;
+
+ /*
+ * ID of the vault which protects this item
+ */
+ private String vaultId;
+
+ /*
+ * Type of workload this item represents.
+ */
+ private DataSourceTypeAutoGenerated3 workloadType;
+
+ /*
+ * Type of backup management for the backed up item.
+ */
+ private BackupManagementType backupManagementType;
+
/**
* Creates an instance of AzureVmWorkloadSapAseDatabaseProtectedItem class.
*/
@@ -47,6 +66,56 @@ public String protectedItemType() {
return this.protectedItemType;
}
+ /**
+ * Get the protectionStatus property: Backup status of this backup item.
+ *
+ * @return the protectionStatus value.
+ */
+ @Override
+ public String protectionStatus() {
+ return this.protectionStatus;
+ }
+
+ /**
+ * Get the friendlyName property: Friendly name of the DB represented by this backup item.
+ *
+ * @return the friendlyName value.
+ */
+ @Override
+ public String friendlyName() {
+ return this.friendlyName;
+ }
+
+ /**
+ * Get the vaultId property: ID of the vault which protects this item.
+ *
+ * @return the vaultId value.
+ */
+ @Override
+ public String vaultId() {
+ return this.vaultId;
+ }
+
+ /**
+ * Get the workloadType property: Type of workload this item represents.
+ *
+ * @return the workloadType value.
+ */
+ @Override
+ public DataSourceTypeAutoGenerated3 workloadType() {
+ return this.workloadType;
+ }
+
+ /**
+ * Get the backupManagementType property: Type of backup management for the backed up item.
+ *
+ * @return the backupManagementType value.
+ */
+ @Override
+ public BackupManagementType backupManagementType() {
+ return this.backupManagementType;
+ }
+
/**
* {@inheritDoc}
*/
@@ -305,6 +374,181 @@ public AzureVmWorkloadSapAseDatabaseProtectedItem withSoftDeleteRetentionPeriod(
*/
@Override
public void validate() {
- super.validate();
+ if (lastBackupErrorDetail() != null) {
+ lastBackupErrorDetail().validate();
+ }
+ if (extendedInfo() != null) {
+ extendedInfo().validate();
+ }
+ if (kpisHealths() != null) {
+ kpisHealths().values().forEach(e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ if (nodesList() != null) {
+ nodesList().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("containerName", containerName());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("lastRecoveryPoint",
+ lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint()));
+ jsonWriter.writeStringField("backupSetName", backupSetName());
+ jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString());
+ jsonWriter.writeStringField("deferredDeleteTimeInUTC",
+ deferredDeleteTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc()));
+ jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete());
+ jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining());
+ jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming());
+ jsonWriter.writeBooleanField("isRehydrate", isRehydrate());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled());
+ jsonWriter.writeStringField("policyName", policyName());
+ jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriod());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentType", parentType());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("lastBackupStatus",
+ lastBackupStatus() == null ? null : lastBackupStatus().toString());
+ jsonWriter.writeStringField("lastBackupTime",
+ lastBackupTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastBackupTime()));
+ jsonWriter.writeJsonField("lastBackupErrorDetail", lastBackupErrorDetail());
+ jsonWriter.writeStringField("protectedItemDataSourceId", protectedItemDataSourceId());
+ jsonWriter.writeStringField("protectedItemHealthStatus",
+ protectedItemHealthStatus() == null ? null : protectedItemHealthStatus().toString());
+ jsonWriter.writeJsonField("extendedInfo", extendedInfo());
+ jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("nodesList", nodesList(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("protectedItemType", this.protectedItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSapAseDatabaseProtectedItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSapAseDatabaseProtectedItem if the JsonReader was pointing to an instance
+ * of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSapAseDatabaseProtectedItem.
+ */
+ public static AzureVmWorkloadSapAseDatabaseProtectedItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSapAseDatabaseProtectedItem deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ = new AzureVmWorkloadSapAseDatabaseProtectedItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.backupManagementType
+ = BackupManagementType.fromString(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.workloadType
+ = DataSourceTypeAutoGenerated3.fromString(reader.getString());
+ } else if ("containerName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withContainerName(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withSourceResourceId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withPolicyId(reader.getString());
+ } else if ("lastRecoveryPoint".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withLastRecoveryPoint(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("backupSetName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withBackupSetName(reader.getString());
+ } else if ("createMode".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ .withCreateMode(CreateMode.fromString(reader.getString()));
+ } else if ("deferredDeleteTimeInUTC".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withDeferredDeleteTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("isScheduledForDeferredDelete".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean));
+ } else if ("deferredDeleteTimeRemaining".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ .withDeferredDeleteTimeRemaining(reader.getString());
+ } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isRehydrate".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ .withIsRehydrate(reader.getNullable(JsonReader::getBoolean));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("isArchiveEnabled".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean));
+ } else if ("policyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withPolicyName(reader.getString());
+ } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ .withSoftDeleteRetentionPeriod(reader.getNullable(JsonReader::getInt));
+ } else if ("vaultId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.vaultId = reader.getString();
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.friendlyName = reader.getString();
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withServerName(reader.getString());
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withParentName(reader.getString());
+ } else if ("parentType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withParentType(reader.getString());
+ } else if ("protectionStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.protectionStatus = reader.getString();
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ .withProtectionState(ProtectionState.fromString(reader.getString()));
+ } else if ("lastBackupStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ .withLastBackupStatus(LastBackupStatus.fromString(reader.getString()));
+ } else if ("lastBackupTime".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withLastBackupTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("lastBackupErrorDetail".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ .withLastBackupErrorDetail(ErrorDetail.fromJson(reader));
+ } else if ("protectedItemDataSourceId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ .withProtectedItemDataSourceId(reader.getString());
+ } else if ("protectedItemHealthStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ .withProtectedItemHealthStatus(ProtectedItemHealthStatus.fromString(reader.getString()));
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem
+ .withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo.fromJson(reader));
+ } else if ("kpisHealths".equals(fieldName)) {
+ Map kpisHealths
+ = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1));
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withKpisHealths(kpisHealths);
+ } else if ("nodesList".equals(fieldName)) {
+ List nodesList
+ = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1));
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withNodesList(nodesList);
+ } else if ("protectedItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.protectedItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSapAseDatabaseProtectedItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java
index cc88e9d607585..9a470e56c0b4a 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload-specific workload item representing SAP ASE Database.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "workloadItemType",
- defaultImpl = AzureVmWorkloadSapAseDatabaseWorkloadItem.class,
- visible = true)
-@JsonTypeName("SAPAseDatabase")
@Fluent
public final class AzureVmWorkloadSapAseDatabaseWorkloadItem extends AzureVmWorkloadItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "workloadItemType", required = true)
private String workloadItemType = "SAPAseDatabase";
/**
@@ -132,6 +124,73 @@ public AzureVmWorkloadSapAseDatabaseWorkloadItem withProtectionState(ProtectionS
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subWorkloadItemCount", subWorkloadItemCount());
+ jsonWriter.writeStringField("workloadItemType", this.workloadItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSapAseDatabaseWorkloadItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSapAseDatabaseWorkloadItem if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSapAseDatabaseWorkloadItem.
+ */
+ public static AzureVmWorkloadSapAseDatabaseWorkloadItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSapAseDatabaseWorkloadItem deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem
+ = new AzureVmWorkloadSapAseDatabaseWorkloadItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem.withParentName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subWorkloadItemCount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem
+ .withSubWorkloadItemCount(reader.getNullable(JsonReader::getInt));
+ } else if ("workloadItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem.workloadItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java
index 680d4558499ac..ed583dd40f4a1 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload-specific protectable item representing SAP ASE System.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectableItemType",
- defaultImpl = AzureVmWorkloadSapAseSystemProtectableItem.class,
- visible = true)
-@JsonTypeName("SAPAseSystem")
@Fluent
public final class AzureVmWorkloadSapAseSystemProtectableItem extends AzureVmWorkloadProtectableItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "protectableItemType", required = true)
private String protectableItemType = "SAPAseSystem";
/**
@@ -168,6 +160,91 @@ public AzureVmWorkloadSapAseSystemProtectableItem withProtectionState(Protection
*/
@Override
public void validate() {
- super.validate();
+ if (prebackupvalidation() != null) {
+ prebackupvalidation().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentUniqueName", parentUniqueName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount());
+ jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation());
+ jsonWriter.writeBooleanField("isProtectable", isProtectable());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSapAseSystemProtectableItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSapAseSystemProtectableItem if the JsonReader was pointing to an instance
+ * of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSapAseSystemProtectableItem.
+ */
+ public static AzureVmWorkloadSapAseSystemProtectableItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSapAseSystemProtectableItem deserializedAzureVmWorkloadSapAseSystemProtectableItem
+ = new AzureVmWorkloadSapAseSystemProtectableItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemProtectableItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemProtectableItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemProtectableItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemProtectableItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemProtectableItem.withParentName(reader.getString());
+ } else if ("parentUniqueName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemProtectableItem.withParentUniqueName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemProtectableItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemProtectableItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isAutoProtected".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemProtectableItem
+ .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemProtectableItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subprotectableitemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemProtectableItem
+ .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("prebackupvalidation".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemProtectableItem
+ .withPrebackupvalidation(PreBackupValidation.fromJson(reader));
+ } else if ("isProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemProtectableItem
+ .withIsProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemProtectableItem.protectableItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSapAseSystemProtectableItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java
index 8edd09d13e66d..4d40d011022d4 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload-specific workload item representing SAP ASE System.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "workloadItemType",
- defaultImpl = AzureVmWorkloadSapAseSystemWorkloadItem.class,
- visible = true)
-@JsonTypeName("SAPAseSystem")
@Fluent
public final class AzureVmWorkloadSapAseSystemWorkloadItem extends AzureVmWorkloadItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "workloadItemType", required = true)
private String workloadItemType = "SAPAseSystem";
/**
@@ -132,6 +124,73 @@ public AzureVmWorkloadSapAseSystemWorkloadItem withProtectionState(ProtectionSta
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subWorkloadItemCount", subWorkloadItemCount());
+ jsonWriter.writeStringField("workloadItemType", this.workloadItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSapAseSystemWorkloadItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSapAseSystemWorkloadItem if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSapAseSystemWorkloadItem.
+ */
+ public static AzureVmWorkloadSapAseSystemWorkloadItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSapAseSystemWorkloadItem deserializedAzureVmWorkloadSapAseSystemWorkloadItem
+ = new AzureVmWorkloadSapAseSystemWorkloadItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemWorkloadItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemWorkloadItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemWorkloadItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemWorkloadItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemWorkloadItem.withParentName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemWorkloadItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemWorkloadItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemWorkloadItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subWorkloadItemCount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemWorkloadItem
+ .withSubWorkloadItemCount(reader.getNullable(JsonReader::getInt));
+ } else if ("workloadItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapAseSystemWorkloadItem.workloadItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSapAseSystemWorkloadItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstance.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstance.java
index 31da94aead3a6..08f754d868846 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstance.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstance.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload-specific protectable item representing SAP HANA Dbinstance.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectableItemType",
- defaultImpl = AzureVmWorkloadSapHanaDBInstance.class,
- visible = true)
-@JsonTypeName("SAPHanaDBInstance")
@Fluent
public final class AzureVmWorkloadSapHanaDBInstance extends AzureVmWorkloadProtectableItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "protectableItemType", required = true)
private String protectableItemType = "SAPHanaDBInstance";
/**
@@ -168,6 +160,91 @@ public AzureVmWorkloadSapHanaDBInstance withProtectionState(ProtectionStatus pro
*/
@Override
public void validate() {
- super.validate();
+ if (prebackupvalidation() != null) {
+ prebackupvalidation().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentUniqueName", parentUniqueName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount());
+ jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation());
+ jsonWriter.writeBooleanField("isProtectable", isProtectable());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSapHanaDBInstance from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSapHanaDBInstance if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSapHanaDBInstance.
+ */
+ public static AzureVmWorkloadSapHanaDBInstance fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSapHanaDBInstance deserializedAzureVmWorkloadSapHanaDBInstance
+ = new AzureVmWorkloadSapHanaDBInstance();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstance.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstance.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstance.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstance
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstance.withParentName(reader.getString());
+ } else if ("parentUniqueName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstance.withParentUniqueName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstance.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstance
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isAutoProtected".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstance
+ .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstance
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subprotectableitemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstance
+ .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("prebackupvalidation".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstance
+ .withPrebackupvalidation(PreBackupValidation.fromJson(reader));
+ } else if ("isProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstance
+ .withIsProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstance.protectableItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSapHanaDBInstance;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstanceProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstanceProtectedItem.java
index fda080c1a45c5..3d60b861aa4bb 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstanceProtectedItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstanceProtectedItem.java
@@ -5,32 +5,51 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
/**
* Azure VM workload-specific protected item representing SAP HANA DBInstance.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectedItemType",
- defaultImpl = AzureVmWorkloadSapHanaDBInstanceProtectedItem.class,
- visible = true)
-@JsonTypeName("AzureVmWorkloadSAPHanaDBInstance")
@Fluent
public final class AzureVmWorkloadSapHanaDBInstanceProtectedItem extends AzureVmWorkloadProtectedItem {
/*
* backup item type.
*/
- @JsonTypeId
- @JsonProperty(value = "protectedItemType", required = true)
private String protectedItemType = "AzureVmWorkloadSAPHanaDBInstance";
+ /*
+ * Backup status of this backup item.
+ */
+ private String protectionStatus;
+
+ /*
+ * Friendly name of the DB represented by this backup item.
+ */
+ private String friendlyName;
+
+ /*
+ * ID of the vault which protects this item
+ */
+ private String vaultId;
+
+ /*
+ * Type of workload this item represents.
+ */
+ private DataSourceTypeAutoGenerated3 workloadType;
+
+ /*
+ * Type of backup management for the backed up item.
+ */
+ private BackupManagementType backupManagementType;
+
/**
* Creates an instance of AzureVmWorkloadSapHanaDBInstanceProtectedItem class.
*/
@@ -47,6 +66,56 @@ public String protectedItemType() {
return this.protectedItemType;
}
+ /**
+ * Get the protectionStatus property: Backup status of this backup item.
+ *
+ * @return the protectionStatus value.
+ */
+ @Override
+ public String protectionStatus() {
+ return this.protectionStatus;
+ }
+
+ /**
+ * Get the friendlyName property: Friendly name of the DB represented by this backup item.
+ *
+ * @return the friendlyName value.
+ */
+ @Override
+ public String friendlyName() {
+ return this.friendlyName;
+ }
+
+ /**
+ * Get the vaultId property: ID of the vault which protects this item.
+ *
+ * @return the vaultId value.
+ */
+ @Override
+ public String vaultId() {
+ return this.vaultId;
+ }
+
+ /**
+ * Get the workloadType property: Type of workload this item represents.
+ *
+ * @return the workloadType value.
+ */
+ @Override
+ public DataSourceTypeAutoGenerated3 workloadType() {
+ return this.workloadType;
+ }
+
+ /**
+ * Get the backupManagementType property: Type of backup management for the backed up item.
+ *
+ * @return the backupManagementType value.
+ */
+ @Override
+ public BackupManagementType backupManagementType() {
+ return this.backupManagementType;
+ }
+
/**
* {@inheritDoc}
*/
@@ -307,6 +376,181 @@ public AzureVmWorkloadSapHanaDBInstanceProtectedItem withPolicyName(String polic
*/
@Override
public void validate() {
- super.validate();
+ if (lastBackupErrorDetail() != null) {
+ lastBackupErrorDetail().validate();
+ }
+ if (extendedInfo() != null) {
+ extendedInfo().validate();
+ }
+ if (kpisHealths() != null) {
+ kpisHealths().values().forEach(e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ if (nodesList() != null) {
+ nodesList().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("containerName", containerName());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("lastRecoveryPoint",
+ lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint()));
+ jsonWriter.writeStringField("backupSetName", backupSetName());
+ jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString());
+ jsonWriter.writeStringField("deferredDeleteTimeInUTC",
+ deferredDeleteTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc()));
+ jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete());
+ jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining());
+ jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming());
+ jsonWriter.writeBooleanField("isRehydrate", isRehydrate());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled());
+ jsonWriter.writeStringField("policyName", policyName());
+ jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriod());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentType", parentType());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("lastBackupStatus",
+ lastBackupStatus() == null ? null : lastBackupStatus().toString());
+ jsonWriter.writeStringField("lastBackupTime",
+ lastBackupTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastBackupTime()));
+ jsonWriter.writeJsonField("lastBackupErrorDetail", lastBackupErrorDetail());
+ jsonWriter.writeStringField("protectedItemDataSourceId", protectedItemDataSourceId());
+ jsonWriter.writeStringField("protectedItemHealthStatus",
+ protectedItemHealthStatus() == null ? null : protectedItemHealthStatus().toString());
+ jsonWriter.writeJsonField("extendedInfo", extendedInfo());
+ jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("nodesList", nodesList(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("protectedItemType", this.protectedItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSapHanaDBInstanceProtectedItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSapHanaDBInstanceProtectedItem if the JsonReader was pointing to an
+ * instance of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSapHanaDBInstanceProtectedItem.
+ */
+ public static AzureVmWorkloadSapHanaDBInstanceProtectedItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSapHanaDBInstanceProtectedItem deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ = new AzureVmWorkloadSapHanaDBInstanceProtectedItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.backupManagementType
+ = BackupManagementType.fromString(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.workloadType
+ = DataSourceTypeAutoGenerated3.fromString(reader.getString());
+ } else if ("containerName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withContainerName(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withSourceResourceId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withPolicyId(reader.getString());
+ } else if ("lastRecoveryPoint".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withLastRecoveryPoint(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("backupSetName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withBackupSetName(reader.getString());
+ } else if ("createMode".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ .withCreateMode(CreateMode.fromString(reader.getString()));
+ } else if ("deferredDeleteTimeInUTC".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withDeferredDeleteTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("isScheduledForDeferredDelete".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean));
+ } else if ("deferredDeleteTimeRemaining".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ .withDeferredDeleteTimeRemaining(reader.getString());
+ } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isRehydrate".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ .withIsRehydrate(reader.getNullable(JsonReader::getBoolean));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("isArchiveEnabled".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean));
+ } else if ("policyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withPolicyName(reader.getString());
+ } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ .withSoftDeleteRetentionPeriod(reader.getNullable(JsonReader::getInt));
+ } else if ("vaultId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.vaultId = reader.getString();
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.friendlyName = reader.getString();
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withServerName(reader.getString());
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withParentName(reader.getString());
+ } else if ("parentType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withParentType(reader.getString());
+ } else if ("protectionStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.protectionStatus = reader.getString();
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ .withProtectionState(ProtectionState.fromString(reader.getString()));
+ } else if ("lastBackupStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ .withLastBackupStatus(LastBackupStatus.fromString(reader.getString()));
+ } else if ("lastBackupTime".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withLastBackupTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("lastBackupErrorDetail".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ .withLastBackupErrorDetail(ErrorDetail.fromJson(reader));
+ } else if ("protectedItemDataSourceId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ .withProtectedItemDataSourceId(reader.getString());
+ } else if ("protectedItemHealthStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ .withProtectedItemHealthStatus(ProtectedItemHealthStatus.fromString(reader.getString()));
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem
+ .withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo.fromJson(reader));
+ } else if ("kpisHealths".equals(fieldName)) {
+ Map kpisHealths
+ = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1));
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withKpisHealths(kpisHealths);
+ } else if ("nodesList".equals(fieldName)) {
+ List nodesList
+ = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1));
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withNodesList(nodesList);
+ } else if ("protectedItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.protectedItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.java
index 70fbe6e612fee..5721ed70b9015 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload-specific protectable item representing SAP HANA Database.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectableItemType",
- defaultImpl = AzureVmWorkloadSapHanaDatabaseProtectableItem.class,
- visible = true)
-@JsonTypeName("SAPHanaDatabase")
@Fluent
public final class AzureVmWorkloadSapHanaDatabaseProtectableItem extends AzureVmWorkloadProtectableItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "protectableItemType", required = true)
private String protectableItemType = "SAPHanaDatabase";
/**
@@ -169,6 +161,92 @@ public AzureVmWorkloadSapHanaDatabaseProtectableItem withProtectionState(Protect
*/
@Override
public void validate() {
- super.validate();
+ if (prebackupvalidation() != null) {
+ prebackupvalidation().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentUniqueName", parentUniqueName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount());
+ jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation());
+ jsonWriter.writeBooleanField("isProtectable", isProtectable());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSapHanaDatabaseProtectableItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSapHanaDatabaseProtectableItem if the JsonReader was pointing to an
+ * instance of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSapHanaDatabaseProtectableItem.
+ */
+ public static AzureVmWorkloadSapHanaDatabaseProtectableItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSapHanaDatabaseProtectableItem deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem
+ = new AzureVmWorkloadSapHanaDatabaseProtectableItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem
+ .withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem.withParentName(reader.getString());
+ } else if ("parentUniqueName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem.withParentUniqueName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isAutoProtected".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem
+ .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subprotectableitemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem
+ .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("prebackupvalidation".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem
+ .withPrebackupvalidation(PreBackupValidation.fromJson(reader));
+ } else if ("isProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem
+ .withIsProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem.protectableItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.java
index 8690e4a1ea114..97e6a1ea4f8e0 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.java
@@ -5,32 +5,51 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
/**
* Azure VM workload-specific protected item representing SAP HANA Database.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectedItemType",
- defaultImpl = AzureVmWorkloadSapHanaDatabaseProtectedItem.class,
- visible = true)
-@JsonTypeName("AzureVmWorkloadSAPHanaDatabase")
@Fluent
public final class AzureVmWorkloadSapHanaDatabaseProtectedItem extends AzureVmWorkloadProtectedItem {
/*
* backup item type.
*/
- @JsonTypeId
- @JsonProperty(value = "protectedItemType", required = true)
private String protectedItemType = "AzureVmWorkloadSAPHanaDatabase";
+ /*
+ * Backup status of this backup item.
+ */
+ private String protectionStatus;
+
+ /*
+ * Friendly name of the DB represented by this backup item.
+ */
+ private String friendlyName;
+
+ /*
+ * ID of the vault which protects this item
+ */
+ private String vaultId;
+
+ /*
+ * Type of workload this item represents.
+ */
+ private DataSourceTypeAutoGenerated3 workloadType;
+
+ /*
+ * Type of backup management for the backed up item.
+ */
+ private BackupManagementType backupManagementType;
+
/**
* Creates an instance of AzureVmWorkloadSapHanaDatabaseProtectedItem class.
*/
@@ -47,6 +66,56 @@ public String protectedItemType() {
return this.protectedItemType;
}
+ /**
+ * Get the protectionStatus property: Backup status of this backup item.
+ *
+ * @return the protectionStatus value.
+ */
+ @Override
+ public String protectionStatus() {
+ return this.protectionStatus;
+ }
+
+ /**
+ * Get the friendlyName property: Friendly name of the DB represented by this backup item.
+ *
+ * @return the friendlyName value.
+ */
+ @Override
+ public String friendlyName() {
+ return this.friendlyName;
+ }
+
+ /**
+ * Get the vaultId property: ID of the vault which protects this item.
+ *
+ * @return the vaultId value.
+ */
+ @Override
+ public String vaultId() {
+ return this.vaultId;
+ }
+
+ /**
+ * Get the workloadType property: Type of workload this item represents.
+ *
+ * @return the workloadType value.
+ */
+ @Override
+ public DataSourceTypeAutoGenerated3 workloadType() {
+ return this.workloadType;
+ }
+
+ /**
+ * Get the backupManagementType property: Type of backup management for the backed up item.
+ *
+ * @return the backupManagementType value.
+ */
+ @Override
+ public BackupManagementType backupManagementType() {
+ return this.backupManagementType;
+ }
+
/**
* {@inheritDoc}
*/
@@ -306,6 +375,181 @@ public AzureVmWorkloadSapHanaDatabaseProtectedItem withPolicyName(String policyN
*/
@Override
public void validate() {
- super.validate();
+ if (lastBackupErrorDetail() != null) {
+ lastBackupErrorDetail().validate();
+ }
+ if (extendedInfo() != null) {
+ extendedInfo().validate();
+ }
+ if (kpisHealths() != null) {
+ kpisHealths().values().forEach(e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ if (nodesList() != null) {
+ nodesList().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("containerName", containerName());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("lastRecoveryPoint",
+ lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint()));
+ jsonWriter.writeStringField("backupSetName", backupSetName());
+ jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString());
+ jsonWriter.writeStringField("deferredDeleteTimeInUTC",
+ deferredDeleteTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc()));
+ jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete());
+ jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining());
+ jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming());
+ jsonWriter.writeBooleanField("isRehydrate", isRehydrate());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled());
+ jsonWriter.writeStringField("policyName", policyName());
+ jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriod());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentType", parentType());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("lastBackupStatus",
+ lastBackupStatus() == null ? null : lastBackupStatus().toString());
+ jsonWriter.writeStringField("lastBackupTime",
+ lastBackupTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastBackupTime()));
+ jsonWriter.writeJsonField("lastBackupErrorDetail", lastBackupErrorDetail());
+ jsonWriter.writeStringField("protectedItemDataSourceId", protectedItemDataSourceId());
+ jsonWriter.writeStringField("protectedItemHealthStatus",
+ protectedItemHealthStatus() == null ? null : protectedItemHealthStatus().toString());
+ jsonWriter.writeJsonField("extendedInfo", extendedInfo());
+ jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("nodesList", nodesList(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("protectedItemType", this.protectedItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSapHanaDatabaseProtectedItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSapHanaDatabaseProtectedItem if the JsonReader was pointing to an instance
+ * of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSapHanaDatabaseProtectedItem.
+ */
+ public static AzureVmWorkloadSapHanaDatabaseProtectedItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSapHanaDatabaseProtectedItem deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ = new AzureVmWorkloadSapHanaDatabaseProtectedItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.backupManagementType
+ = BackupManagementType.fromString(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.workloadType
+ = DataSourceTypeAutoGenerated3.fromString(reader.getString());
+ } else if ("containerName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withContainerName(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withSourceResourceId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withPolicyId(reader.getString());
+ } else if ("lastRecoveryPoint".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withLastRecoveryPoint(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("backupSetName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withBackupSetName(reader.getString());
+ } else if ("createMode".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ .withCreateMode(CreateMode.fromString(reader.getString()));
+ } else if ("deferredDeleteTimeInUTC".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withDeferredDeleteTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("isScheduledForDeferredDelete".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean));
+ } else if ("deferredDeleteTimeRemaining".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ .withDeferredDeleteTimeRemaining(reader.getString());
+ } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isRehydrate".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ .withIsRehydrate(reader.getNullable(JsonReader::getBoolean));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("isArchiveEnabled".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean));
+ } else if ("policyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withPolicyName(reader.getString());
+ } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ .withSoftDeleteRetentionPeriod(reader.getNullable(JsonReader::getInt));
+ } else if ("vaultId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.vaultId = reader.getString();
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.friendlyName = reader.getString();
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withServerName(reader.getString());
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withParentName(reader.getString());
+ } else if ("parentType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withParentType(reader.getString());
+ } else if ("protectionStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.protectionStatus = reader.getString();
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ .withProtectionState(ProtectionState.fromString(reader.getString()));
+ } else if ("lastBackupStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ .withLastBackupStatus(LastBackupStatus.fromString(reader.getString()));
+ } else if ("lastBackupTime".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withLastBackupTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("lastBackupErrorDetail".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ .withLastBackupErrorDetail(ErrorDetail.fromJson(reader));
+ } else if ("protectedItemDataSourceId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ .withProtectedItemDataSourceId(reader.getString());
+ } else if ("protectedItemHealthStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ .withProtectedItemHealthStatus(ProtectedItemHealthStatus.fromString(reader.getString()));
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem
+ .withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo.fromJson(reader));
+ } else if ("kpisHealths".equals(fieldName)) {
+ Map kpisHealths
+ = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1));
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withKpisHealths(kpisHealths);
+ } else if ("nodesList".equals(fieldName)) {
+ List nodesList
+ = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1));
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withNodesList(nodesList);
+ } else if ("protectedItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.protectedItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java
index 81c9a8116889b..f100eab1ce0ce 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload-specific workload item representing SAP HANA Database.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "workloadItemType",
- defaultImpl = AzureVmWorkloadSapHanaDatabaseWorkloadItem.class,
- visible = true)
-@JsonTypeName("SAPHanaDatabase")
@Fluent
public final class AzureVmWorkloadSapHanaDatabaseWorkloadItem extends AzureVmWorkloadItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "workloadItemType", required = true)
private String workloadItemType = "SAPHanaDatabase";
/**
@@ -132,6 +124,73 @@ public AzureVmWorkloadSapHanaDatabaseWorkloadItem withProtectionState(Protection
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subWorkloadItemCount", subWorkloadItemCount());
+ jsonWriter.writeStringField("workloadItemType", this.workloadItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSapHanaDatabaseWorkloadItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSapHanaDatabaseWorkloadItem if the JsonReader was pointing to an instance
+ * of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSapHanaDatabaseWorkloadItem.
+ */
+ public static AzureVmWorkloadSapHanaDatabaseWorkloadItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSapHanaDatabaseWorkloadItem deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem
+ = new AzureVmWorkloadSapHanaDatabaseWorkloadItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem.withParentName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subWorkloadItemCount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem
+ .withSubWorkloadItemCount(reader.getNullable(JsonReader::getInt));
+ } else if ("workloadItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem.workloadItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaHsr.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaHsr.java
index 29e1e13ac6d1f..a0f3b27654fd0 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaHsr.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaHsr.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload-specific protectable item representing HANA HSR.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectableItemType",
- defaultImpl = AzureVmWorkloadSapHanaHsr.class,
- visible = true)
-@JsonTypeName("HanaHSRContainer")
@Fluent
public final class AzureVmWorkloadSapHanaHsr extends AzureVmWorkloadProtectableItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "protectableItemType", required = true)
private String protectableItemType = "HanaHSRContainer";
/**
@@ -168,6 +160,88 @@ public AzureVmWorkloadSapHanaHsr withProtectionState(ProtectionStatus protection
*/
@Override
public void validate() {
- super.validate();
+ if (prebackupvalidation() != null) {
+ prebackupvalidation().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentUniqueName", parentUniqueName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount());
+ jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation());
+ jsonWriter.writeBooleanField("isProtectable", isProtectable());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSapHanaHsr from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSapHanaHsr if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSapHanaHsr.
+ */
+ public static AzureVmWorkloadSapHanaHsr fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSapHanaHsr deserializedAzureVmWorkloadSapHanaHsr = new AzureVmWorkloadSapHanaHsr();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaHsr.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaHsr.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaHsr.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaHsr
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaHsr.withParentName(reader.getString());
+ } else if ("parentUniqueName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaHsr.withParentUniqueName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaHsr.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaHsr
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isAutoProtected".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaHsr
+ .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaHsr
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subprotectableitemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaHsr
+ .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("prebackupvalidation".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaHsr.withPrebackupvalidation(PreBackupValidation.fromJson(reader));
+ } else if ("isProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaHsr.withIsProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaHsr.protectableItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSapHanaHsr;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaScaleoutProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaScaleoutProtectableItem.java
new file mode 100644
index 0000000000000..fec67a8f19a21
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaScaleoutProtectableItem.java
@@ -0,0 +1,252 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Azure VM workload-specific protectable item representing HANA scale out.
+ */
+@Fluent
+public final class AzureVmWorkloadSapHanaScaleoutProtectableItem extends AzureVmWorkloadProtectableItem {
+ /*
+ * Type of the backup item.
+ */
+ private String protectableItemType = "HanaScaleoutContainer";
+
+ /**
+ * Creates an instance of AzureVmWorkloadSapHanaScaleoutProtectableItem class.
+ */
+ public AzureVmWorkloadSapHanaScaleoutProtectableItem() {
+ }
+
+ /**
+ * Get the protectableItemType property: Type of the backup item.
+ *
+ * @return the protectableItemType value.
+ */
+ @Override
+ public String protectableItemType() {
+ return this.protectableItemType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadSapHanaScaleoutProtectableItem withParentName(String parentName) {
+ super.withParentName(parentName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadSapHanaScaleoutProtectableItem withParentUniqueName(String parentUniqueName) {
+ super.withParentUniqueName(parentUniqueName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadSapHanaScaleoutProtectableItem withServerName(String serverName) {
+ super.withServerName(serverName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadSapHanaScaleoutProtectableItem withIsAutoProtectable(Boolean isAutoProtectable) {
+ super.withIsAutoProtectable(isAutoProtectable);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadSapHanaScaleoutProtectableItem withIsAutoProtected(Boolean isAutoProtected) {
+ super.withIsAutoProtected(isAutoProtected);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadSapHanaScaleoutProtectableItem withSubinquireditemcount(Integer subinquireditemcount) {
+ super.withSubinquireditemcount(subinquireditemcount);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadSapHanaScaleoutProtectableItem withSubprotectableitemcount(Integer subprotectableitemcount) {
+ super.withSubprotectableitemcount(subprotectableitemcount);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadSapHanaScaleoutProtectableItem
+ withPrebackupvalidation(PreBackupValidation prebackupvalidation) {
+ super.withPrebackupvalidation(prebackupvalidation);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadSapHanaScaleoutProtectableItem withIsProtectable(Boolean isProtectable) {
+ super.withIsProtectable(isProtectable);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadSapHanaScaleoutProtectableItem withBackupManagementType(String backupManagementType) {
+ super.withBackupManagementType(backupManagementType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadSapHanaScaleoutProtectableItem withWorkloadType(String workloadType) {
+ super.withWorkloadType(workloadType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadSapHanaScaleoutProtectableItem withFriendlyName(String friendlyName) {
+ super.withFriendlyName(friendlyName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureVmWorkloadSapHanaScaleoutProtectableItem withProtectionState(ProtectionStatus protectionState) {
+ super.withProtectionState(protectionState);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (prebackupvalidation() != null) {
+ prebackupvalidation().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentUniqueName", parentUniqueName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount());
+ jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation());
+ jsonWriter.writeBooleanField("isProtectable", isProtectable());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSapHanaScaleoutProtectableItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSapHanaScaleoutProtectableItem if the JsonReader was pointing to an
+ * instance of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSapHanaScaleoutProtectableItem.
+ */
+ public static AzureVmWorkloadSapHanaScaleoutProtectableItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSapHanaScaleoutProtectableItem deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem
+ = new AzureVmWorkloadSapHanaScaleoutProtectableItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem
+ .withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem.withParentName(reader.getString());
+ } else if ("parentUniqueName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem.withParentUniqueName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isAutoProtected".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem
+ .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subprotectableitemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem
+ .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("prebackupvalidation".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem
+ .withPrebackupvalidation(PreBackupValidation.fromJson(reader));
+ } else if ("isProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem
+ .withIsProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem.protectableItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSapHanaScaleoutProtectableItem;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java
index b4fac5616995f..f854590061a72 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload-specific protectable item representing SAP HANA System.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectableItemType",
- defaultImpl = AzureVmWorkloadSapHanaSystemProtectableItem.class,
- visible = true)
-@JsonTypeName("SAPHanaSystem")
@Fluent
public final class AzureVmWorkloadSapHanaSystemProtectableItem extends AzureVmWorkloadProtectableItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "protectableItemType", required = true)
private String protectableItemType = "SAPHanaSystem";
/**
@@ -169,6 +161,92 @@ public AzureVmWorkloadSapHanaSystemProtectableItem withProtectionState(Protectio
*/
@Override
public void validate() {
- super.validate();
+ if (prebackupvalidation() != null) {
+ prebackupvalidation().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentUniqueName", parentUniqueName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount());
+ jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation());
+ jsonWriter.writeBooleanField("isProtectable", isProtectable());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSapHanaSystemProtectableItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSapHanaSystemProtectableItem if the JsonReader was pointing to an instance
+ * of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSapHanaSystemProtectableItem.
+ */
+ public static AzureVmWorkloadSapHanaSystemProtectableItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSapHanaSystemProtectableItem deserializedAzureVmWorkloadSapHanaSystemProtectableItem
+ = new AzureVmWorkloadSapHanaSystemProtectableItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemProtectableItem
+ .withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemProtectableItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemProtectableItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemProtectableItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemProtectableItem.withParentName(reader.getString());
+ } else if ("parentUniqueName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemProtectableItem.withParentUniqueName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemProtectableItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemProtectableItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isAutoProtected".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemProtectableItem
+ .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemProtectableItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subprotectableitemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemProtectableItem
+ .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("prebackupvalidation".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemProtectableItem
+ .withPrebackupvalidation(PreBackupValidation.fromJson(reader));
+ } else if ("isProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemProtectableItem
+ .withIsProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemProtectableItem.protectableItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSapHanaSystemProtectableItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java
index ed6da77095139..3a865af5f3c48 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload-specific workload item representing SAP HANA System.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "workloadItemType",
- defaultImpl = AzureVmWorkloadSapHanaSystemWorkloadItem.class,
- visible = true)
-@JsonTypeName("SAPHanaSystem")
@Fluent
public final class AzureVmWorkloadSapHanaSystemWorkloadItem extends AzureVmWorkloadItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "workloadItemType", required = true)
private String workloadItemType = "SAPHanaSystem";
/**
@@ -132,6 +124,73 @@ public AzureVmWorkloadSapHanaSystemWorkloadItem withProtectionState(ProtectionSt
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subWorkloadItemCount", subWorkloadItemCount());
+ jsonWriter.writeStringField("workloadItemType", this.workloadItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSapHanaSystemWorkloadItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSapHanaSystemWorkloadItem if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSapHanaSystemWorkloadItem.
+ */
+ public static AzureVmWorkloadSapHanaSystemWorkloadItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSapHanaSystemWorkloadItem deserializedAzureVmWorkloadSapHanaSystemWorkloadItem
+ = new AzureVmWorkloadSapHanaSystemWorkloadItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemWorkloadItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemWorkloadItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemWorkloadItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemWorkloadItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemWorkloadItem.withParentName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemWorkloadItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemWorkloadItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemWorkloadItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subWorkloadItemCount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemWorkloadItem
+ .withSubWorkloadItemCount(reader.getNullable(JsonReader::getInt));
+ } else if ("workloadItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSapHanaSystemWorkloadItem.workloadItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSapHanaSystemWorkloadItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.java
index 420c04b1509e9..ef16689362e04 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.java
@@ -5,34 +5,25 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
/**
* Azure VM workload-specific protectable item representing SQL Availability Group.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectableItemType",
- defaultImpl = AzureVmWorkloadSqlAvailabilityGroupProtectableItem.class,
- visible = true)
-@JsonTypeName("SQLAvailabilityGroupContainer")
@Fluent
public final class AzureVmWorkloadSqlAvailabilityGroupProtectableItem extends AzureVmWorkloadProtectableItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "protectableItemType", required = true)
private String protectableItemType = "SQLAvailabilityGroupContainer";
/*
* List of the nodes in case of distributed container.
*/
- @JsonProperty(value = "nodesList")
private List nodesList;
/**
@@ -197,9 +188,103 @@ public AzureVmWorkloadSqlAvailabilityGroupProtectableItem withProtectionState(Pr
*/
@Override
public void validate() {
- super.validate();
if (nodesList() != null) {
nodesList().forEach(e -> e.validate());
}
+ if (prebackupvalidation() != null) {
+ prebackupvalidation().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentUniqueName", parentUniqueName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount());
+ jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation());
+ jsonWriter.writeBooleanField("isProtectable", isProtectable());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ jsonWriter.writeArrayField("nodesList", this.nodesList, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSqlAvailabilityGroupProtectableItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSqlAvailabilityGroupProtectableItem if the JsonReader was pointing to an
+ * instance of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSqlAvailabilityGroupProtectableItem.
+ */
+ public static AzureVmWorkloadSqlAvailabilityGroupProtectableItem fromJson(JsonReader jsonReader)
+ throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSqlAvailabilityGroupProtectableItem deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem
+ = new AzureVmWorkloadSqlAvailabilityGroupProtectableItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem
+ .withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem.withParentName(reader.getString());
+ } else if ("parentUniqueName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem
+ .withParentUniqueName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isAutoProtected".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem
+ .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subprotectableitemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem
+ .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("prebackupvalidation".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem
+ .withPrebackupvalidation(PreBackupValidation.fromJson(reader));
+ } else if ("isProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem
+ .withIsProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem.protectableItemType
+ = reader.getString();
+ } else if ("nodesList".equals(fieldName)) {
+ List nodesList
+ = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1));
+ deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem.nodesList = nodesList;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java
index 31ea2dbc498fa..f4237ab807059 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload-specific protectable item representing SQL Database.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectableItemType",
- defaultImpl = AzureVmWorkloadSqlDatabaseProtectableItem.class,
- visible = true)
-@JsonTypeName("SQLDataBase")
@Fluent
public final class AzureVmWorkloadSqlDatabaseProtectableItem extends AzureVmWorkloadProtectableItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "protectableItemType", required = true)
private String protectableItemType = "SQLDataBase";
/**
@@ -168,6 +160,91 @@ public AzureVmWorkloadSqlDatabaseProtectableItem withProtectionState(ProtectionS
*/
@Override
public void validate() {
- super.validate();
+ if (prebackupvalidation() != null) {
+ prebackupvalidation().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentUniqueName", parentUniqueName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount());
+ jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation());
+ jsonWriter.writeBooleanField("isProtectable", isProtectable());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSqlDatabaseProtectableItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSqlDatabaseProtectableItem if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSqlDatabaseProtectableItem.
+ */
+ public static AzureVmWorkloadSqlDatabaseProtectableItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSqlDatabaseProtectableItem deserializedAzureVmWorkloadSqlDatabaseProtectableItem
+ = new AzureVmWorkloadSqlDatabaseProtectableItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectableItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectableItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectableItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectableItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectableItem.withParentName(reader.getString());
+ } else if ("parentUniqueName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectableItem.withParentUniqueName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectableItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectableItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isAutoProtected".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectableItem
+ .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectableItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subprotectableitemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectableItem
+ .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("prebackupvalidation".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectableItem
+ .withPrebackupvalidation(PreBackupValidation.fromJson(reader));
+ } else if ("isProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectableItem
+ .withIsProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectableItem.protectableItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSqlDatabaseProtectableItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java
index 843f811a81644..42583bf9d05b1 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java
@@ -5,32 +5,51 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
/**
* Azure VM workload-specific protected item representing SQL Database.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectedItemType",
- defaultImpl = AzureVmWorkloadSqlDatabaseProtectedItem.class,
- visible = true)
-@JsonTypeName("AzureVmWorkloadSQLDatabase")
@Fluent
public final class AzureVmWorkloadSqlDatabaseProtectedItem extends AzureVmWorkloadProtectedItem {
/*
* backup item type.
*/
- @JsonTypeId
- @JsonProperty(value = "protectedItemType", required = true)
private String protectedItemType = "AzureVmWorkloadSQLDatabase";
+ /*
+ * Backup status of this backup item.
+ */
+ private String protectionStatus;
+
+ /*
+ * Friendly name of the DB represented by this backup item.
+ */
+ private String friendlyName;
+
+ /*
+ * ID of the vault which protects this item
+ */
+ private String vaultId;
+
+ /*
+ * Type of workload this item represents.
+ */
+ private DataSourceTypeAutoGenerated3 workloadType;
+
+ /*
+ * Type of backup management for the backed up item.
+ */
+ private BackupManagementType backupManagementType;
+
/**
* Creates an instance of AzureVmWorkloadSqlDatabaseProtectedItem class.
*/
@@ -47,6 +66,56 @@ public String protectedItemType() {
return this.protectedItemType;
}
+ /**
+ * Get the protectionStatus property: Backup status of this backup item.
+ *
+ * @return the protectionStatus value.
+ */
+ @Override
+ public String protectionStatus() {
+ return this.protectionStatus;
+ }
+
+ /**
+ * Get the friendlyName property: Friendly name of the DB represented by this backup item.
+ *
+ * @return the friendlyName value.
+ */
+ @Override
+ public String friendlyName() {
+ return this.friendlyName;
+ }
+
+ /**
+ * Get the vaultId property: ID of the vault which protects this item.
+ *
+ * @return the vaultId value.
+ */
+ @Override
+ public String vaultId() {
+ return this.vaultId;
+ }
+
+ /**
+ * Get the workloadType property: Type of workload this item represents.
+ *
+ * @return the workloadType value.
+ */
+ @Override
+ public DataSourceTypeAutoGenerated3 workloadType() {
+ return this.workloadType;
+ }
+
+ /**
+ * Get the backupManagementType property: Type of backup management for the backed up item.
+ *
+ * @return the backupManagementType value.
+ */
+ @Override
+ public BackupManagementType backupManagementType() {
+ return this.backupManagementType;
+ }
+
/**
* {@inheritDoc}
*/
@@ -302,6 +371,181 @@ public AzureVmWorkloadSqlDatabaseProtectedItem withSoftDeleteRetentionPeriod(Int
*/
@Override
public void validate() {
- super.validate();
+ if (lastBackupErrorDetail() != null) {
+ lastBackupErrorDetail().validate();
+ }
+ if (extendedInfo() != null) {
+ extendedInfo().validate();
+ }
+ if (kpisHealths() != null) {
+ kpisHealths().values().forEach(e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ if (nodesList() != null) {
+ nodesList().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("containerName", containerName());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("lastRecoveryPoint",
+ lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint()));
+ jsonWriter.writeStringField("backupSetName", backupSetName());
+ jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString());
+ jsonWriter.writeStringField("deferredDeleteTimeInUTC",
+ deferredDeleteTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc()));
+ jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete());
+ jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining());
+ jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming());
+ jsonWriter.writeBooleanField("isRehydrate", isRehydrate());
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled());
+ jsonWriter.writeStringField("policyName", policyName());
+ jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriod());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentType", parentType());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("lastBackupStatus",
+ lastBackupStatus() == null ? null : lastBackupStatus().toString());
+ jsonWriter.writeStringField("lastBackupTime",
+ lastBackupTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastBackupTime()));
+ jsonWriter.writeJsonField("lastBackupErrorDetail", lastBackupErrorDetail());
+ jsonWriter.writeStringField("protectedItemDataSourceId", protectedItemDataSourceId());
+ jsonWriter.writeStringField("protectedItemHealthStatus",
+ protectedItemHealthStatus() == null ? null : protectedItemHealthStatus().toString());
+ jsonWriter.writeJsonField("extendedInfo", extendedInfo());
+ jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("nodesList", nodesList(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("protectedItemType", this.protectedItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSqlDatabaseProtectedItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSqlDatabaseProtectedItem if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSqlDatabaseProtectedItem.
+ */
+ public static AzureVmWorkloadSqlDatabaseProtectedItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSqlDatabaseProtectedItem deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ = new AzureVmWorkloadSqlDatabaseProtectedItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.backupManagementType
+ = BackupManagementType.fromString(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.workloadType
+ = DataSourceTypeAutoGenerated3.fromString(reader.getString());
+ } else if ("containerName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withContainerName(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withSourceResourceId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withPolicyId(reader.getString());
+ } else if ("lastRecoveryPoint".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withLastRecoveryPoint(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("backupSetName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withBackupSetName(reader.getString());
+ } else if ("createMode".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ .withCreateMode(CreateMode.fromString(reader.getString()));
+ } else if ("deferredDeleteTimeInUTC".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withDeferredDeleteTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("isScheduledForDeferredDelete".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean));
+ } else if ("deferredDeleteTimeRemaining".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ .withDeferredDeleteTimeRemaining(reader.getString());
+ } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isRehydrate".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ .withIsRehydrate(reader.getNullable(JsonReader::getBoolean));
+ } else if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("isArchiveEnabled".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean));
+ } else if ("policyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withPolicyName(reader.getString());
+ } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ .withSoftDeleteRetentionPeriod(reader.getNullable(JsonReader::getInt));
+ } else if ("vaultId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.vaultId = reader.getString();
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.friendlyName = reader.getString();
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withServerName(reader.getString());
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withParentName(reader.getString());
+ } else if ("parentType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withParentType(reader.getString());
+ } else if ("protectionStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.protectionStatus = reader.getString();
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ .withProtectionState(ProtectionState.fromString(reader.getString()));
+ } else if ("lastBackupStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ .withLastBackupStatus(LastBackupStatus.fromString(reader.getString()));
+ } else if ("lastBackupTime".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withLastBackupTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("lastBackupErrorDetail".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ .withLastBackupErrorDetail(ErrorDetail.fromJson(reader));
+ } else if ("protectedItemDataSourceId".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ .withProtectedItemDataSourceId(reader.getString());
+ } else if ("protectedItemHealthStatus".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ .withProtectedItemHealthStatus(ProtectedItemHealthStatus.fromString(reader.getString()));
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem
+ .withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo.fromJson(reader));
+ } else if ("kpisHealths".equals(fieldName)) {
+ Map kpisHealths
+ = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1));
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withKpisHealths(kpisHealths);
+ } else if ("nodesList".equals(fieldName)) {
+ List nodesList
+ = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1));
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withNodesList(nodesList);
+ } else if ("protectedItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseProtectedItem.protectedItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSqlDatabaseProtectedItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java
index 8d72c303f90c4..617341dd404db 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload-specific workload item representing SQL Database.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "workloadItemType",
- defaultImpl = AzureVmWorkloadSqlDatabaseWorkloadItem.class,
- visible = true)
-@JsonTypeName("SQLDataBase")
@Fluent
public final class AzureVmWorkloadSqlDatabaseWorkloadItem extends AzureVmWorkloadItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "workloadItemType", required = true)
private String workloadItemType = "SQLDataBase";
/**
@@ -132,6 +124,73 @@ public AzureVmWorkloadSqlDatabaseWorkloadItem withProtectionState(ProtectionStat
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subWorkloadItemCount", subWorkloadItemCount());
+ jsonWriter.writeStringField("workloadItemType", this.workloadItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSqlDatabaseWorkloadItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSqlDatabaseWorkloadItem if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSqlDatabaseWorkloadItem.
+ */
+ public static AzureVmWorkloadSqlDatabaseWorkloadItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSqlDatabaseWorkloadItem deserializedAzureVmWorkloadSqlDatabaseWorkloadItem
+ = new AzureVmWorkloadSqlDatabaseWorkloadItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseWorkloadItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseWorkloadItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseWorkloadItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseWorkloadItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseWorkloadItem.withParentName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseWorkloadItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseWorkloadItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseWorkloadItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subWorkloadItemCount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseWorkloadItem
+ .withSubWorkloadItemCount(reader.getNullable(JsonReader::getInt));
+ } else if ("workloadItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlDatabaseWorkloadItem.workloadItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSqlDatabaseWorkloadItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java
index 70056b395acce..1399bd2954695 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload-specific protectable item representing SQL Instance.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectableItemType",
- defaultImpl = AzureVmWorkloadSqlInstanceProtectableItem.class,
- visible = true)
-@JsonTypeName("SQLInstance")
@Fluent
public final class AzureVmWorkloadSqlInstanceProtectableItem extends AzureVmWorkloadProtectableItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "protectableItemType", required = true)
private String protectableItemType = "SQLInstance";
/**
@@ -168,6 +160,91 @@ public AzureVmWorkloadSqlInstanceProtectableItem withProtectionState(ProtectionS
*/
@Override
public void validate() {
- super.validate();
+ if (prebackupvalidation() != null) {
+ prebackupvalidation().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("parentUniqueName", parentUniqueName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount());
+ jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation());
+ jsonWriter.writeBooleanField("isProtectable", isProtectable());
+ jsonWriter.writeStringField("protectableItemType", this.protectableItemType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSqlInstanceProtectableItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSqlInstanceProtectableItem if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSqlInstanceProtectableItem.
+ */
+ public static AzureVmWorkloadSqlInstanceProtectableItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSqlInstanceProtectableItem deserializedAzureVmWorkloadSqlInstanceProtectableItem
+ = new AzureVmWorkloadSqlInstanceProtectableItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceProtectableItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceProtectableItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceProtectableItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceProtectableItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceProtectableItem.withParentName(reader.getString());
+ } else if ("parentUniqueName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceProtectableItem.withParentUniqueName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceProtectableItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceProtectableItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("isAutoProtected".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceProtectableItem
+ .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceProtectableItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subprotectableitemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceProtectableItem
+ .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("prebackupvalidation".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceProtectableItem
+ .withPrebackupvalidation(PreBackupValidation.fromJson(reader));
+ } else if ("isProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceProtectableItem
+ .withIsProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("protectableItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceProtectableItem.protectableItemType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSqlInstanceProtectableItem;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceWorkloadItem.java
index a0b397a11d026..088b78e69f0c1 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceWorkloadItem.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceWorkloadItem.java
@@ -5,34 +5,25 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
/**
* Azure VM workload-specific workload item representing SQL Instance.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "workloadItemType",
- defaultImpl = AzureVmWorkloadSqlInstanceWorkloadItem.class,
- visible = true)
-@JsonTypeName("SQLInstance")
@Fluent
public final class AzureVmWorkloadSqlInstanceWorkloadItem extends AzureVmWorkloadItem {
/*
* Type of the backup item.
*/
- @JsonTypeId
- @JsonProperty(value = "workloadItemType", required = true)
private String workloadItemType = "SQLInstance";
/*
* Data Directory Paths for default directories
*/
- @JsonProperty(value = "dataDirectoryPaths")
private List dataDirectoryPaths;
/**
@@ -159,9 +150,82 @@ public AzureVmWorkloadSqlInstanceWorkloadItem withProtectionState(ProtectionStat
*/
@Override
public void validate() {
- super.validate();
if (dataDirectoryPaths() != null) {
dataDirectoryPaths().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType", backupManagementType());
+ jsonWriter.writeStringField("workloadType", workloadType());
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("parentName", parentName());
+ jsonWriter.writeStringField("serverName", serverName());
+ jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable());
+ jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount());
+ jsonWriter.writeNumberField("subWorkloadItemCount", subWorkloadItemCount());
+ jsonWriter.writeStringField("workloadItemType", this.workloadItemType);
+ jsonWriter.writeArrayField("dataDirectoryPaths", this.dataDirectoryPaths,
+ (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureVmWorkloadSqlInstanceWorkloadItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureVmWorkloadSqlInstanceWorkloadItem if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureVmWorkloadSqlInstanceWorkloadItem.
+ */
+ public static AzureVmWorkloadSqlInstanceWorkloadItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureVmWorkloadSqlInstanceWorkloadItem deserializedAzureVmWorkloadSqlInstanceWorkloadItem
+ = new AzureVmWorkloadSqlInstanceWorkloadItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceWorkloadItem.withBackupManagementType(reader.getString());
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceWorkloadItem.withWorkloadType(reader.getString());
+ } else if ("friendlyName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceWorkloadItem.withFriendlyName(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceWorkloadItem
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("parentName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceWorkloadItem.withParentName(reader.getString());
+ } else if ("serverName".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceWorkloadItem.withServerName(reader.getString());
+ } else if ("isAutoProtectable".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceWorkloadItem
+ .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean));
+ } else if ("subinquireditemcount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceWorkloadItem
+ .withSubinquireditemcount(reader.getNullable(JsonReader::getInt));
+ } else if ("subWorkloadItemCount".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceWorkloadItem
+ .withSubWorkloadItemCount(reader.getNullable(JsonReader::getInt));
+ } else if ("workloadItemType".equals(fieldName)) {
+ deserializedAzureVmWorkloadSqlInstanceWorkloadItem.workloadItemType = reader.getString();
+ } else if ("dataDirectoryPaths".equals(fieldName)) {
+ List dataDirectoryPaths
+ = reader.readArray(reader1 -> SqlDataDirectory.fromJson(reader1));
+ deserializedAzureVmWorkloadSqlInstanceWorkloadItem.dataDirectoryPaths = dataDirectoryPaths;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureVmWorkloadSqlInstanceWorkloadItem;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabasePointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabasePointInTimeRecoveryPoint.java
new file mode 100644
index 0000000000000..7840866dd3751
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabasePointInTimeRecoveryPoint.java
@@ -0,0 +1,198 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Recovery point specific to PointInTime for generic any database.
+ */
+@Fluent
+public final class AzureWorkloadAnyDatabasePointInTimeRecoveryPoint extends AzureWorkloadPointInTimeRecoveryPoint {
+ /*
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
+ */
+ private String objectType = "AzureWorkloadAnyDatabasePointInTimeRecoveryPoint";
+
+ /**
+ * Creates an instance of AzureWorkloadAnyDatabasePointInTimeRecoveryPoint class.
+ */
+ public AzureWorkloadAnyDatabasePointInTimeRecoveryPoint() {
+ }
+
+ /**
+ * Get the objectType property: This property will be used as the discriminator for deciding the specific types in
+ * the polymorphic chain of types.
+ *
+ * @return the objectType value.
+ */
+ @Override
+ public String objectType() {
+ return this.objectType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRecoveryPoint withTimeRanges(List timeRanges) {
+ super.withTimeRanges(timeRanges);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRecoveryPoint
+ withRecoveryPointTimeInUtc(OffsetDateTime recoveryPointTimeInUtc) {
+ super.withRecoveryPointTimeInUtc(recoveryPointTimeInUtc);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRecoveryPoint withType(RestorePointType type) {
+ super.withType(type);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRecoveryPoint
+ withRecoveryPointTierDetails(List recoveryPointTierDetails) {
+ super.withRecoveryPointTierDetails(recoveryPointTierDetails);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRecoveryPoint
+ withRecoveryPointMoveReadinessInfo(Map recoveryPointMoveReadinessInfo) {
+ super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRecoveryPoint
+ withRecoveryPointProperties(RecoveryPointProperties recoveryPointProperties) {
+ super.withRecoveryPointProperties(recoveryPointProperties);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (recoveryPointTierDetails() != null) {
+ recoveryPointTierDetails().forEach(e -> e.validate());
+ }
+ if (recoveryPointMoveReadinessInfo() != null) {
+ recoveryPointMoveReadinessInfo().values().forEach(e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ if (recoveryPointProperties() != null) {
+ recoveryPointProperties().validate();
+ }
+ if (timeRanges() != null) {
+ timeRanges().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("recoveryPointTimeInUTC",
+ recoveryPointTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(recoveryPointTimeInUtc()));
+ jsonWriter.writeStringField("type", type() == null ? null : type().toString());
+ jsonWriter.writeArrayField("recoveryPointTierDetails", recoveryPointTierDetails(),
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", recoveryPointMoveReadinessInfo(),
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeJsonField("recoveryPointProperties", recoveryPointProperties());
+ jsonWriter.writeArrayField("timeRanges", timeRanges(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("objectType", this.objectType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadAnyDatabasePointInTimeRecoveryPoint from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadAnyDatabasePointInTimeRecoveryPoint if the JsonReader was pointing to an
+ * instance of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadAnyDatabasePointInTimeRecoveryPoint.
+ */
+ public static AzureWorkloadAnyDatabasePointInTimeRecoveryPoint fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadAnyDatabasePointInTimeRecoveryPoint deserializedAzureWorkloadAnyDatabasePointInTimeRecoveryPoint
+ = new AzureWorkloadAnyDatabasePointInTimeRecoveryPoint();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("recoveryPointTimeInUTC".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRecoveryPoint.withRecoveryPointTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("type".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRecoveryPoint
+ .withType(RestorePointType.fromString(reader.getString()));
+ } else if ("recoveryPointTierDetails".equals(fieldName)) {
+ List recoveryPointTierDetails
+ = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1));
+ deserializedAzureWorkloadAnyDatabasePointInTimeRecoveryPoint
+ .withRecoveryPointTierDetails(recoveryPointTierDetails);
+ } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) {
+ Map recoveryPointMoveReadinessInfo
+ = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1));
+ deserializedAzureWorkloadAnyDatabasePointInTimeRecoveryPoint
+ .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo);
+ } else if ("recoveryPointProperties".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRecoveryPoint
+ .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader));
+ } else if ("timeRanges".equals(fieldName)) {
+ List timeRanges = reader.readArray(reader1 -> PointInTimeRange.fromJson(reader1));
+ deserializedAzureWorkloadAnyDatabasePointInTimeRecoveryPoint.withTimeRanges(timeRanges);
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRecoveryPoint.objectType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadAnyDatabasePointInTimeRecoveryPoint;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabasePointInTimeRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabasePointInTimeRestoreRequest.java
new file mode 100644
index 0000000000000..efbea0343b308
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabasePointInTimeRestoreRequest.java
@@ -0,0 +1,292 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AzureWorkload AnyDatabase -specific restore. Specifically for PointInTime/Log restore.
+ */
+@Fluent
+public class AzureWorkloadAnyDatabasePointInTimeRestoreRequest extends AzureWorkloadAnyDatabaseRestoreRequest {
+ /*
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
+ */
+ private String objectType = "AzureWorkloadAnyDatabasePointInTimeRestoreRequest";
+
+ /*
+ * PointInTime value
+ */
+ private OffsetDateTime pointInTime;
+
+ /**
+ * Creates an instance of AzureWorkloadAnyDatabasePointInTimeRestoreRequest class.
+ */
+ public AzureWorkloadAnyDatabasePointInTimeRestoreRequest() {
+ }
+
+ /**
+ * Get the objectType property: This property will be used as the discriminator for deciding the specific types in
+ * the polymorphic chain of types.
+ *
+ * @return the objectType value.
+ */
+ @Override
+ public String objectType() {
+ return this.objectType;
+ }
+
+ /**
+ * Get the pointInTime property: PointInTime value.
+ *
+ * @return the pointInTime value.
+ */
+ public OffsetDateTime pointInTime() {
+ return this.pointInTime;
+ }
+
+ /**
+ * Set the pointInTime property: PointInTime value.
+ *
+ * @param pointInTime the pointInTime value to set.
+ * @return the AzureWorkloadAnyDatabasePointInTimeRestoreRequest object itself.
+ */
+ public AzureWorkloadAnyDatabasePointInTimeRestoreRequest withPointInTime(OffsetDateTime pointInTime) {
+ this.pointInTime = pointInTime;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreRequest withRecoveryType(RecoveryType recoveryType) {
+ super.withRecoveryType(recoveryType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreRequest withSourceResourceId(String sourceResourceId) {
+ super.withSourceResourceId(sourceResourceId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreRequest withPropertyBag(Map propertyBag) {
+ super.withPropertyBag(propertyBag);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) {
+ super.withTargetInfo(targetInfo);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) {
+ super.withRecoveryMode(recoveryMode);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ withTargetResourceGroupName(String targetResourceGroupName) {
+ super.withTargetResourceGroupName(targetResourceGroupName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) {
+ super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) {
+ super.withSnapshotRestoreParameters(snapshotRestoreParameters);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) {
+ super.withTargetVirtualMachineId(targetVirtualMachineId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ withResourceGuardOperationRequests(List resourceGuardOperationRequests) {
+ super.withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (targetInfo() != null) {
+ targetInfo().validate();
+ }
+ if (userAssignedManagedIdentityDetails() != null) {
+ userAssignedManagedIdentityDetails().validate();
+ }
+ if (snapshotRestoreParameters() != null) {
+ snapshotRestoreParameters().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("targetInfo", targetInfo());
+ jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString());
+ jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName());
+ jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails());
+ jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters());
+ jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId());
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeStringField("pointInTime",
+ this.pointInTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.pointInTime));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadAnyDatabasePointInTimeRestoreRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadAnyDatabasePointInTimeRestoreRequest if the JsonReader was pointing to an
+ * instance of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadAnyDatabasePointInTimeRestoreRequest.
+ */
+ public static AzureWorkloadAnyDatabasePointInTimeRestoreRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("objectType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) {
+ return AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static AzureWorkloadAnyDatabasePointInTimeRestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader)
+ throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadAnyDatabasePointInTimeRestoreRequest deserializedAzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ = new AzureWorkloadAnyDatabasePointInTimeRestoreRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("recoveryType".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ .withRecoveryType(RecoveryType.fromString(reader.getString()));
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ .withSourceResourceId(reader.getString());
+ } else if ("propertyBag".equals(fieldName)) {
+ Map propertyBag = reader.readMap(reader1 -> reader1.getString());
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreRequest.withPropertyBag(propertyBag);
+ } else if ("targetInfo".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ .withTargetInfo(TargetRestoreInfo.fromJson(reader));
+ } else if ("recoveryMode".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ .withRecoveryMode(RecoveryMode.fromString(reader.getString()));
+ } else if ("targetResourceGroupName".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ .withTargetResourceGroupName(reader.getString());
+ } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader));
+ } else if ("snapshotRestoreParameters".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader));
+ } else if ("targetVirtualMachineId".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ .withTargetVirtualMachineId(reader.getString());
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreRequest.objectType = reader.getString();
+ } else if ("pointInTime".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreRequest.pointInTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadAnyDatabasePointInTimeRestoreRequest;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest.java
new file mode 100644
index 0000000000000..f61534f6f2250
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest.java
@@ -0,0 +1,291 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AzureWorkload AnyDatabase-specific restore with integrated rehydration of recovery point.
+ */
+@Fluent
+public final class AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ extends AzureWorkloadAnyDatabasePointInTimeRestoreRequest {
+ /*
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
+ */
+ private String objectType = "AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest";
+
+ /*
+ * RP Rehydration Info
+ */
+ private RecoveryPointRehydrationInfo recoveryPointRehydrationInfo;
+
+ /**
+ * Creates an instance of AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest class.
+ */
+ public AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest() {
+ }
+
+ /**
+ * Get the objectType property: This property will be used as the discriminator for deciding the specific types in
+ * the polymorphic chain of types.
+ *
+ * @return the objectType value.
+ */
+ @Override
+ public String objectType() {
+ return this.objectType;
+ }
+
+ /**
+ * Get the recoveryPointRehydrationInfo property: RP Rehydration Info.
+ *
+ * @return the recoveryPointRehydrationInfo value.
+ */
+ public RecoveryPointRehydrationInfo recoveryPointRehydrationInfo() {
+ return this.recoveryPointRehydrationInfo;
+ }
+
+ /**
+ * Set the recoveryPointRehydrationInfo property: RP Rehydration Info.
+ *
+ * @param recoveryPointRehydrationInfo the recoveryPointRehydrationInfo value to set.
+ * @return the AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest object itself.
+ */
+ public AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ withRecoveryPointRehydrationInfo(RecoveryPointRehydrationInfo recoveryPointRehydrationInfo) {
+ this.recoveryPointRehydrationInfo = recoveryPointRehydrationInfo;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest withPointInTime(OffsetDateTime pointInTime) {
+ super.withPointInTime(pointInTime);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest withRecoveryType(RecoveryType recoveryType) {
+ super.withRecoveryType(recoveryType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ withSourceResourceId(String sourceResourceId) {
+ super.withSourceResourceId(sourceResourceId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ withPropertyBag(Map propertyBag) {
+ super.withPropertyBag(propertyBag);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest withTargetInfo(TargetRestoreInfo targetInfo) {
+ super.withTargetInfo(targetInfo);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest withRecoveryMode(RecoveryMode recoveryMode) {
+ super.withRecoveryMode(recoveryMode);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ withTargetResourceGroupName(String targetResourceGroupName) {
+ super.withTargetResourceGroupName(targetResourceGroupName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) {
+ super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) {
+ super.withSnapshotRestoreParameters(snapshotRestoreParameters);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ withTargetVirtualMachineId(String targetVirtualMachineId) {
+ super.withTargetVirtualMachineId(targetVirtualMachineId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ withResourceGuardOperationRequests(List resourceGuardOperationRequests) {
+ super.withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (recoveryPointRehydrationInfo() != null) {
+ recoveryPointRehydrationInfo().validate();
+ }
+ if (targetInfo() != null) {
+ targetInfo().validate();
+ }
+ if (userAssignedManagedIdentityDetails() != null) {
+ userAssignedManagedIdentityDetails().validate();
+ }
+ if (snapshotRestoreParameters() != null) {
+ snapshotRestoreParameters().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("targetInfo", targetInfo());
+ jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString());
+ jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName());
+ jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails());
+ jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters());
+ jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId());
+ jsonWriter.writeStringField("pointInTime",
+ pointInTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(pointInTime()));
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeJsonField("recoveryPointRehydrationInfo", this.recoveryPointRehydrationInfo);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest if the JsonReader was
+ * pointing to an instance of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the
+ * AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest.
+ */
+ public static AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest fromJson(JsonReader jsonReader)
+ throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ = new AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("recoveryType".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ .withRecoveryType(RecoveryType.fromString(reader.getString()));
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ .withSourceResourceId(reader.getString());
+ } else if ("propertyBag".equals(fieldName)) {
+ Map propertyBag = reader.readMap(reader1 -> reader1.getString());
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ .withPropertyBag(propertyBag);
+ } else if ("targetInfo".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ .withTargetInfo(TargetRestoreInfo.fromJson(reader));
+ } else if ("recoveryMode".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ .withRecoveryMode(RecoveryMode.fromString(reader.getString()));
+ } else if ("targetResourceGroupName".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ .withTargetResourceGroupName(reader.getString());
+ } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader));
+ } else if ("snapshotRestoreParameters".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader));
+ } else if ("targetVirtualMachineId".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest
+ .withTargetVirtualMachineId(reader.getString());
+ } else if ("pointInTime".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest.withPointInTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest.objectType
+ = reader.getString();
+ } else if ("recoveryPointRehydrationInfo".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest.recoveryPointRehydrationInfo
+ = RecoveryPointRehydrationInfo.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabaseRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabaseRecoveryPoint.java
new file mode 100644
index 0000000000000..91810d69d669c
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabaseRecoveryPoint.java
@@ -0,0 +1,181 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Generic any database specific recoverypoint, specifically encapsulates full/diff recoverypoints.
+ */
+@Fluent
+public final class AzureWorkloadAnyDatabaseRecoveryPoint extends AzureWorkloadRecoveryPoint {
+ /*
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
+ */
+ private String objectType = "AzureWorkloadAnyDatabaseRecoveryPoint";
+
+ /**
+ * Creates an instance of AzureWorkloadAnyDatabaseRecoveryPoint class.
+ */
+ public AzureWorkloadAnyDatabaseRecoveryPoint() {
+ }
+
+ /**
+ * Get the objectType property: This property will be used as the discriminator for deciding the specific types in
+ * the polymorphic chain of types.
+ *
+ * @return the objectType value.
+ */
+ @Override
+ public String objectType() {
+ return this.objectType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRecoveryPoint withRecoveryPointTimeInUtc(OffsetDateTime recoveryPointTimeInUtc) {
+ super.withRecoveryPointTimeInUtc(recoveryPointTimeInUtc);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRecoveryPoint withType(RestorePointType type) {
+ super.withType(type);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRecoveryPoint
+ withRecoveryPointTierDetails(List recoveryPointTierDetails) {
+ super.withRecoveryPointTierDetails(recoveryPointTierDetails);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRecoveryPoint
+ withRecoveryPointMoveReadinessInfo(Map recoveryPointMoveReadinessInfo) {
+ super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRecoveryPoint
+ withRecoveryPointProperties(RecoveryPointProperties recoveryPointProperties) {
+ super.withRecoveryPointProperties(recoveryPointProperties);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (recoveryPointTierDetails() != null) {
+ recoveryPointTierDetails().forEach(e -> e.validate());
+ }
+ if (recoveryPointMoveReadinessInfo() != null) {
+ recoveryPointMoveReadinessInfo().values().forEach(e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ if (recoveryPointProperties() != null) {
+ recoveryPointProperties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("recoveryPointTimeInUTC",
+ recoveryPointTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(recoveryPointTimeInUtc()));
+ jsonWriter.writeStringField("type", type() == null ? null : type().toString());
+ jsonWriter.writeArrayField("recoveryPointTierDetails", recoveryPointTierDetails(),
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", recoveryPointMoveReadinessInfo(),
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeJsonField("recoveryPointProperties", recoveryPointProperties());
+ jsonWriter.writeStringField("objectType", this.objectType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadAnyDatabaseRecoveryPoint from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadAnyDatabaseRecoveryPoint if the JsonReader was pointing to an instance of it,
+ * or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadAnyDatabaseRecoveryPoint.
+ */
+ public static AzureWorkloadAnyDatabaseRecoveryPoint fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadAnyDatabaseRecoveryPoint deserializedAzureWorkloadAnyDatabaseRecoveryPoint
+ = new AzureWorkloadAnyDatabaseRecoveryPoint();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("recoveryPointTimeInUTC".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRecoveryPoint.withRecoveryPointTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("type".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRecoveryPoint
+ .withType(RestorePointType.fromString(reader.getString()));
+ } else if ("recoveryPointTierDetails".equals(fieldName)) {
+ List recoveryPointTierDetails
+ = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1));
+ deserializedAzureWorkloadAnyDatabaseRecoveryPoint
+ .withRecoveryPointTierDetails(recoveryPointTierDetails);
+ } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) {
+ Map recoveryPointMoveReadinessInfo
+ = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1));
+ deserializedAzureWorkloadAnyDatabaseRecoveryPoint
+ .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo);
+ } else if ("recoveryPointProperties".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRecoveryPoint
+ .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader));
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRecoveryPoint.objectType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadAnyDatabaseRecoveryPoint;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabaseRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabaseRestoreRequest.java
new file mode 100644
index 0000000000000..57acd21038056
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabaseRestoreRequest.java
@@ -0,0 +1,260 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AzureWorkload AnyDatabase-specific restore.
+ */
+@Fluent
+public class AzureWorkloadAnyDatabaseRestoreRequest extends AzureWorkloadRestoreRequest {
+ /*
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
+ */
+ private String objectType = "AzureWorkloadAnyDatabaseRestoreRequest";
+
+ /**
+ * Creates an instance of AzureWorkloadAnyDatabaseRestoreRequest class.
+ */
+ public AzureWorkloadAnyDatabaseRestoreRequest() {
+ }
+
+ /**
+ * Get the objectType property: This property will be used as the discriminator for deciding the specific types in
+ * the polymorphic chain of types.
+ *
+ * @return the objectType value.
+ */
+ @Override
+ public String objectType() {
+ return this.objectType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreRequest withRecoveryType(RecoveryType recoveryType) {
+ super.withRecoveryType(recoveryType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreRequest withSourceResourceId(String sourceResourceId) {
+ super.withSourceResourceId(sourceResourceId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreRequest withPropertyBag(Map propertyBag) {
+ super.withPropertyBag(propertyBag);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) {
+ super.withTargetInfo(targetInfo);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) {
+ super.withRecoveryMode(recoveryMode);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreRequest withTargetResourceGroupName(String targetResourceGroupName) {
+ super.withTargetResourceGroupName(targetResourceGroupName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreRequest
+ withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) {
+ super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreRequest
+ withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) {
+ super.withSnapshotRestoreParameters(snapshotRestoreParameters);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) {
+ super.withTargetVirtualMachineId(targetVirtualMachineId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreRequest
+ withResourceGuardOperationRequests(List resourceGuardOperationRequests) {
+ super.withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (targetInfo() != null) {
+ targetInfo().validate();
+ }
+ if (userAssignedManagedIdentityDetails() != null) {
+ userAssignedManagedIdentityDetails().validate();
+ }
+ if (snapshotRestoreParameters() != null) {
+ snapshotRestoreParameters().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("targetInfo", targetInfo());
+ jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString());
+ jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName());
+ jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails());
+ jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters());
+ jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId());
+ jsonWriter.writeStringField("objectType", this.objectType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadAnyDatabaseRestoreRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadAnyDatabaseRestoreRequest if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadAnyDatabaseRestoreRequest.
+ */
+ public static AzureWorkloadAnyDatabaseRestoreRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("objectType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("AzureWorkloadAnyDatabasePointInTimeRestoreRequest".equals(discriminatorValue)) {
+ return AzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ .fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest"
+ .equals(discriminatorValue)) {
+ return AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest".equals(discriminatorValue)) {
+ return AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static AzureWorkloadAnyDatabaseRestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadAnyDatabaseRestoreRequest deserializedAzureWorkloadAnyDatabaseRestoreRequest
+ = new AzureWorkloadAnyDatabaseRestoreRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureWorkloadAnyDatabaseRestoreRequest
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("recoveryType".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreRequest
+ .withRecoveryType(RecoveryType.fromString(reader.getString()));
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreRequest.withSourceResourceId(reader.getString());
+ } else if ("propertyBag".equals(fieldName)) {
+ Map propertyBag = reader.readMap(reader1 -> reader1.getString());
+ deserializedAzureWorkloadAnyDatabaseRestoreRequest.withPropertyBag(propertyBag);
+ } else if ("targetInfo".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreRequest
+ .withTargetInfo(TargetRestoreInfo.fromJson(reader));
+ } else if ("recoveryMode".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreRequest
+ .withRecoveryMode(RecoveryMode.fromString(reader.getString()));
+ } else if ("targetResourceGroupName".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreRequest.withTargetResourceGroupName(reader.getString());
+ } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreRequest
+ .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader));
+ } else if ("snapshotRestoreParameters".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreRequest
+ .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader));
+ } else if ("targetVirtualMachineId".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreRequest.withTargetVirtualMachineId(reader.getString());
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreRequest.objectType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadAnyDatabaseRestoreRequest;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest.java
new file mode 100644
index 0000000000000..94f2a8c14c4b0
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest.java
@@ -0,0 +1,268 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AzureWorkload AnyDatabase-specific restore with integrated rehydration of recovery point.
+ */
+@Fluent
+public final class AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest extends AzureWorkloadAnyDatabaseRestoreRequest {
+ /*
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
+ */
+ private String objectType = "AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest";
+
+ /*
+ * RP Rehydration Info
+ */
+ private RecoveryPointRehydrationInfo recoveryPointRehydrationInfo;
+
+ /**
+ * Creates an instance of AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest class.
+ */
+ public AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest() {
+ }
+
+ /**
+ * Get the objectType property: This property will be used as the discriminator for deciding the specific types in
+ * the polymorphic chain of types.
+ *
+ * @return the objectType value.
+ */
+ @Override
+ public String objectType() {
+ return this.objectType;
+ }
+
+ /**
+ * Get the recoveryPointRehydrationInfo property: RP Rehydration Info.
+ *
+ * @return the recoveryPointRehydrationInfo value.
+ */
+ public RecoveryPointRehydrationInfo recoveryPointRehydrationInfo() {
+ return this.recoveryPointRehydrationInfo;
+ }
+
+ /**
+ * Set the recoveryPointRehydrationInfo property: RP Rehydration Info.
+ *
+ * @param recoveryPointRehydrationInfo the recoveryPointRehydrationInfo value to set.
+ * @return the AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest object itself.
+ */
+ public AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ withRecoveryPointRehydrationInfo(RecoveryPointRehydrationInfo recoveryPointRehydrationInfo) {
+ this.recoveryPointRehydrationInfo = recoveryPointRehydrationInfo;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest withRecoveryType(RecoveryType recoveryType) {
+ super.withRecoveryType(recoveryType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest withSourceResourceId(String sourceResourceId) {
+ super.withSourceResourceId(sourceResourceId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest withPropertyBag(Map propertyBag) {
+ super.withPropertyBag(propertyBag);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest withTargetInfo(TargetRestoreInfo targetInfo) {
+ super.withTargetInfo(targetInfo);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest withRecoveryMode(RecoveryMode recoveryMode) {
+ super.withRecoveryMode(recoveryMode);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ withTargetResourceGroupName(String targetResourceGroupName) {
+ super.withTargetResourceGroupName(targetResourceGroupName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) {
+ super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) {
+ super.withSnapshotRestoreParameters(snapshotRestoreParameters);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ withTargetVirtualMachineId(String targetVirtualMachineId) {
+ super.withTargetVirtualMachineId(targetVirtualMachineId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ withResourceGuardOperationRequests(List resourceGuardOperationRequests) {
+ super.withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (recoveryPointRehydrationInfo() != null) {
+ recoveryPointRehydrationInfo().validate();
+ }
+ if (targetInfo() != null) {
+ targetInfo().validate();
+ }
+ if (userAssignedManagedIdentityDetails() != null) {
+ userAssignedManagedIdentityDetails().validate();
+ }
+ if (snapshotRestoreParameters() != null) {
+ snapshotRestoreParameters().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("targetInfo", targetInfo());
+ jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString());
+ jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName());
+ jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails());
+ jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters());
+ jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId());
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeJsonField("recoveryPointRehydrationInfo", this.recoveryPointRehydrationInfo);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest if the JsonReader was pointing to an
+ * instance of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest.
+ */
+ public static AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest fromJson(JsonReader jsonReader)
+ throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest deserializedAzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ = new AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("recoveryType".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ .withRecoveryType(RecoveryType.fromString(reader.getString()));
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ .withSourceResourceId(reader.getString());
+ } else if ("propertyBag".equals(fieldName)) {
+ Map propertyBag = reader.readMap(reader1 -> reader1.getString());
+ deserializedAzureWorkloadAnyDatabaseRestoreWithRehydrateRequest.withPropertyBag(propertyBag);
+ } else if ("targetInfo".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ .withTargetInfo(TargetRestoreInfo.fromJson(reader));
+ } else if ("recoveryMode".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ .withRecoveryMode(RecoveryMode.fromString(reader.getString()));
+ } else if ("targetResourceGroupName".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ .withTargetResourceGroupName(reader.getString());
+ } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader));
+ } else if ("snapshotRestoreParameters".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader));
+ } else if ("targetVirtualMachineId".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreWithRehydrateRequest
+ .withTargetVirtualMachineId(reader.getString());
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreWithRehydrateRequest.objectType = reader.getString();
+ } else if ("recoveryPointRehydrationInfo".equals(fieldName)) {
+ deserializedAzureWorkloadAnyDatabaseRestoreWithRehydrateRequest.recoveryPointRehydrationInfo
+ = RecoveryPointRehydrationInfo.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadAnyDatabaseRestoreWithRehydrateRequest;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java
index 9ac7c5f0bbcd6..53496d694e226 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java
@@ -5,32 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure Recovery Services Vault specific protection intent item.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectionIntentItemType",
- defaultImpl = AzureWorkloadAutoProtectionIntent.class,
- visible = true)
-@JsonTypeName("AzureWorkloadAutoProtectionIntent")
-@JsonSubTypes({
- @JsonSubTypes.Type(
- name = "AzureWorkloadSQLAutoProtectionIntent",
- value = AzureWorkloadSqlAutoProtectionIntent.class) })
@Fluent
public class AzureWorkloadAutoProtectionIntent extends AzureRecoveryServiceVaultProtectionIntent {
/*
* backup protectionIntent type.
*/
- @JsonTypeId
- @JsonProperty(value = "protectionIntentItemType", required = true)
private ProtectionIntentItemType protectionIntentItemType
= ProtectionIntentItemType.AZURE_WORKLOAD_AUTO_PROTECTION_INTENT;
@@ -102,6 +89,87 @@ public AzureWorkloadAutoProtectionIntent withProtectionState(ProtectionStatus pr
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("itemId", itemId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("protectionIntentItemType",
+ this.protectionIntentItemType == null ? null : this.protectionIntentItemType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadAutoProtectionIntent from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadAutoProtectionIntent if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadAutoProtectionIntent.
+ */
+ public static AzureWorkloadAutoProtectionIntent fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("protectionIntentItemType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("AzureWorkloadSQLAutoProtectionIntent".equals(discriminatorValue)) {
+ return AzureWorkloadSqlAutoProtectionIntent.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static AzureWorkloadAutoProtectionIntent fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadAutoProtectionIntent deserializedAzureWorkloadAutoProtectionIntent
+ = new AzureWorkloadAutoProtectionIntent();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureWorkloadAutoProtectionIntent
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureWorkloadAutoProtectionIntent.withSourceResourceId(reader.getString());
+ } else if ("itemId".equals(fieldName)) {
+ deserializedAzureWorkloadAutoProtectionIntent.withItemId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureWorkloadAutoProtectionIntent.withPolicyId(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureWorkloadAutoProtectionIntent
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("protectionIntentItemType".equals(fieldName)) {
+ deserializedAzureWorkloadAutoProtectionIntent.protectionIntentItemType
+ = ProtectionIntentItemType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadAutoProtectionIntent;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadBackupRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadBackupRequest.java
index 5568692e7c748..d253c2d52453f 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadBackupRequest.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadBackupRequest.java
@@ -5,46 +5,38 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
/**
* AzureWorkload workload-specific backup request.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "objectType",
- defaultImpl = AzureWorkloadBackupRequest.class,
- visible = true)
-@JsonTypeName("AzureWorkloadBackupRequest")
@Fluent
public final class AzureWorkloadBackupRequest extends BackupRequest {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "objectType", required = true)
private String objectType = "AzureWorkloadBackupRequest";
/*
* Type of backup, viz. Full, Differential, Log or CopyOnlyFull
*/
- @JsonProperty(value = "backupType")
private BackupType backupType;
/*
* Bool for Compression setting
*/
- @JsonProperty(value = "enableCompression")
private Boolean enableCompression;
/*
* Backup copy will expire after the time specified (UTC).
*/
- @JsonProperty(value = "recoveryPointExpiryTimeInUTC")
private OffsetDateTime recoveryPointExpiryTimeInUtc;
/**
@@ -131,6 +123,55 @@ public AzureWorkloadBackupRequest withRecoveryPointExpiryTimeInUtc(OffsetDateTim
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeStringField("backupType", this.backupType == null ? null : this.backupType.toString());
+ jsonWriter.writeBooleanField("enableCompression", this.enableCompression);
+ jsonWriter.writeStringField("recoveryPointExpiryTimeInUTC",
+ this.recoveryPointExpiryTimeInUtc == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.recoveryPointExpiryTimeInUtc));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadBackupRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadBackupRequest if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadBackupRequest.
+ */
+ public static AzureWorkloadBackupRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadBackupRequest deserializedAzureWorkloadBackupRequest = new AzureWorkloadBackupRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadBackupRequest.objectType = reader.getString();
+ } else if ("backupType".equals(fieldName)) {
+ deserializedAzureWorkloadBackupRequest.backupType = BackupType.fromString(reader.getString());
+ } else if ("enableCompression".equals(fieldName)) {
+ deserializedAzureWorkloadBackupRequest.enableCompression
+ = reader.getNullable(JsonReader::getBoolean);
+ } else if ("recoveryPointExpiryTimeInUTC".equals(fieldName)) {
+ deserializedAzureWorkloadBackupRequest.recoveryPointExpiryTimeInUtc = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadBackupRequest;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainer.java
index 7ef0272083cd1..1f9cd31628da6 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainer.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainer.java
@@ -5,65 +5,51 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
/**
* Container for the workloads running inside Azure Compute or Classic Compute.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "containerType",
- defaultImpl = AzureWorkloadContainer.class,
- visible = true)
-@JsonTypeName("AzureWorkloadContainer")
-@JsonSubTypes({
- @JsonSubTypes.Type(name = "SQLAGWorkLoadContainer", value = AzureSqlagWorkloadContainerProtectionContainer.class),
- @JsonSubTypes.Type(name = "VMAppContainer", value = AzureVMAppContainerProtectionContainer.class) })
@Fluent
public class AzureWorkloadContainer extends ProtectionContainer {
/*
- * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2.
+ * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines
+ * 2.
* Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is
* Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload
* Backup is VMAppContainer
*/
- @JsonTypeId
- @JsonProperty(value = "containerType", required = true)
private ProtectableContainerType containerType = ProtectableContainerType.AZURE_WORKLOAD_CONTAINER;
/*
* ARM ID of the virtual machine represented by this Azure Workload Container
*/
- @JsonProperty(value = "sourceResourceId")
private String sourceResourceId;
/*
* Time stamp when this container was updated.
*/
- @JsonProperty(value = "lastUpdatedTime")
private OffsetDateTime lastUpdatedTime;
/*
* Additional details of a workload container.
*/
- @JsonProperty(value = "extendedInfo")
private AzureWorkloadContainerExtendedInfo extendedInfo;
/*
* Workload type for which registration was sent.
*/
- @JsonProperty(value = "workloadType")
private WorkloadType workloadType;
/*
* Re-Do Operation
*/
- @JsonProperty(value = "operationType")
private OperationType operationType;
/**
@@ -238,9 +224,107 @@ public AzureWorkloadContainer withProtectableObjectType(String protectableObject
*/
@Override
public void validate() {
- super.validate();
if (extendedInfo() != null) {
extendedInfo().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("friendlyName", friendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("registrationStatus", registrationStatus());
+ jsonWriter.writeStringField("healthStatus", healthStatus());
+ jsonWriter.writeStringField("protectableObjectType", protectableObjectType());
+ jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString());
+ jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId);
+ jsonWriter.writeStringField("lastUpdatedTime",
+ this.lastUpdatedTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedTime));
+ jsonWriter.writeJsonField("extendedInfo", this.extendedInfo);
+ jsonWriter.writeStringField("workloadType", this.workloadType == null ? null : this.workloadType.toString());
+ jsonWriter.writeStringField("operationType", this.operationType == null ? null : this.operationType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadContainer from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadContainer if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadContainer.
+ */
+ public static AzureWorkloadContainer fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("containerType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("SQLAGWorkLoadContainer".equals(discriminatorValue)) {
+ return AzureSqlagWorkloadContainerProtectionContainer.fromJson(readerToUse.reset());
+ } else if ("VMAppContainer".equals(discriminatorValue)) {
+ return AzureVMAppContainerProtectionContainer.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static AzureWorkloadContainer fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadContainer deserializedAzureWorkloadContainer = new AzureWorkloadContainer();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("friendlyName".equals(fieldName)) {
+ deserializedAzureWorkloadContainer.withFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureWorkloadContainer
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("registrationStatus".equals(fieldName)) {
+ deserializedAzureWorkloadContainer.withRegistrationStatus(reader.getString());
+ } else if ("healthStatus".equals(fieldName)) {
+ deserializedAzureWorkloadContainer.withHealthStatus(reader.getString());
+ } else if ("protectableObjectType".equals(fieldName)) {
+ deserializedAzureWorkloadContainer.withProtectableObjectType(reader.getString());
+ } else if ("containerType".equals(fieldName)) {
+ deserializedAzureWorkloadContainer.containerType
+ = ProtectableContainerType.fromString(reader.getString());
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureWorkloadContainer.sourceResourceId = reader.getString();
+ } else if ("lastUpdatedTime".equals(fieldName)) {
+ deserializedAzureWorkloadContainer.lastUpdatedTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureWorkloadContainer.extendedInfo
+ = AzureWorkloadContainerExtendedInfo.fromJson(reader);
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureWorkloadContainer.workloadType = WorkloadType.fromString(reader.getString());
+ } else if ("operationType".equals(fieldName)) {
+ deserializedAzureWorkloadContainer.operationType = OperationType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadContainer;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerAutoProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerAutoProtectionIntent.java
index 882f3a0c3e914..8be60e4f008db 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerAutoProtectionIntent.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerAutoProtectionIntent.java
@@ -5,27 +5,19 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure workload specific protection intent item.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "protectionIntentItemType",
- defaultImpl = AzureWorkloadContainerAutoProtectionIntent.class,
- visible = true)
-@JsonTypeName("AzureWorkloadContainerAutoProtectionIntent")
@Fluent
public final class AzureWorkloadContainerAutoProtectionIntent extends ProtectionIntent {
/*
* backup protectionIntent type.
*/
- @JsonTypeId
- @JsonProperty(value = "protectionIntentItemType", required = true)
private ProtectionIntentItemType protectionIntentItemType
= ProtectionIntentItemType.AZURE_WORKLOAD_CONTAINER_AUTO_PROTECTION_INTENT;
@@ -98,6 +90,62 @@ public AzureWorkloadContainerAutoProtectionIntent withProtectionState(Protection
*/
@Override
public void validate() {
- super.validate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeStringField("itemId", itemId());
+ jsonWriter.writeStringField("policyId", policyId());
+ jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString());
+ jsonWriter.writeStringField("protectionIntentItemType",
+ this.protectionIntentItemType == null ? null : this.protectionIntentItemType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadContainerAutoProtectionIntent from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadContainerAutoProtectionIntent if the JsonReader was pointing to an instance
+ * of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadContainerAutoProtectionIntent.
+ */
+ public static AzureWorkloadContainerAutoProtectionIntent fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadContainerAutoProtectionIntent deserializedAzureWorkloadContainerAutoProtectionIntent
+ = new AzureWorkloadContainerAutoProtectionIntent();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureWorkloadContainerAutoProtectionIntent
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureWorkloadContainerAutoProtectionIntent.withSourceResourceId(reader.getString());
+ } else if ("itemId".equals(fieldName)) {
+ deserializedAzureWorkloadContainerAutoProtectionIntent.withItemId(reader.getString());
+ } else if ("policyId".equals(fieldName)) {
+ deserializedAzureWorkloadContainerAutoProtectionIntent.withPolicyId(reader.getString());
+ } else if ("protectionState".equals(fieldName)) {
+ deserializedAzureWorkloadContainerAutoProtectionIntent
+ .withProtectionState(ProtectionStatus.fromString(reader.getString()));
+ } else if ("protectionIntentItemType".equals(fieldName)) {
+ deserializedAzureWorkloadContainerAutoProtectionIntent.protectionIntentItemType
+ = ProtectionIntentItemType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadContainerAutoProtectionIntent;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerExtendedInfo.java
index d9658dade3a62..d46e065719fe2 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerExtendedInfo.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerExtendedInfo.java
@@ -5,30 +5,31 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
/**
* Extended information of the container.
*/
@Fluent
-public final class AzureWorkloadContainerExtendedInfo {
+public final class AzureWorkloadContainerExtendedInfo implements JsonSerializable {
/*
* Host Os Name in case of Stand Alone and Cluster Name in case of distributed container.
*/
- @JsonProperty(value = "hostServerName")
private String hostServerName;
/*
* Inquiry Status for the container.
*/
- @JsonProperty(value = "inquiryInfo")
private InquiryInfo inquiryInfo;
/*
* List of the nodes in case of distributed container.
*/
- @JsonProperty(value = "nodesList")
private List nodesList;
/**
@@ -112,4 +113,49 @@ public void validate() {
nodesList().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("hostServerName", this.hostServerName);
+ jsonWriter.writeJsonField("inquiryInfo", this.inquiryInfo);
+ jsonWriter.writeArrayField("nodesList", this.nodesList, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadContainerExtendedInfo from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadContainerExtendedInfo if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadContainerExtendedInfo.
+ */
+ public static AzureWorkloadContainerExtendedInfo fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadContainerExtendedInfo deserializedAzureWorkloadContainerExtendedInfo
+ = new AzureWorkloadContainerExtendedInfo();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("hostServerName".equals(fieldName)) {
+ deserializedAzureWorkloadContainerExtendedInfo.hostServerName = reader.getString();
+ } else if ("inquiryInfo".equals(fieldName)) {
+ deserializedAzureWorkloadContainerExtendedInfo.inquiryInfo = InquiryInfo.fromJson(reader);
+ } else if ("nodesList".equals(fieldName)) {
+ List nodesList
+ = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1));
+ deserializedAzureWorkloadContainerExtendedInfo.nodesList = nodesList;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadContainerExtendedInfo;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadErrorInfo.java
index c7f461741fc2b..16ca4c8154693 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadErrorInfo.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadErrorInfo.java
@@ -5,42 +5,41 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
/**
* Azure storage specific error information.
*/
@Fluent
-public final class AzureWorkloadErrorInfo {
+public final class AzureWorkloadErrorInfo implements JsonSerializable {
/*
* Error code.
*/
- @JsonProperty(value = "errorCode")
private Integer errorCode;
/*
* Localized error string.
*/
- @JsonProperty(value = "errorString")
private String errorString;
/*
* Title: Typically, the entity that the error pertains to.
*/
- @JsonProperty(value = "errorTitle")
private String errorTitle;
/*
* List of localized recommendations for above error code.
*/
- @JsonProperty(value = "recommendations")
private List recommendations;
/*
* Additional details for above error code.
*/
- @JsonProperty(value = "additionalDetails")
private String additionalDetails;
/**
@@ -156,4 +155,54 @@ public AzureWorkloadErrorInfo withAdditionalDetails(String additionalDetails) {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeNumberField("errorCode", this.errorCode);
+ jsonWriter.writeStringField("errorString", this.errorString);
+ jsonWriter.writeStringField("errorTitle", this.errorTitle);
+ jsonWriter.writeArrayField("recommendations", this.recommendations,
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("additionalDetails", this.additionalDetails);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadErrorInfo from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadErrorInfo if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadErrorInfo.
+ */
+ public static AzureWorkloadErrorInfo fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadErrorInfo deserializedAzureWorkloadErrorInfo = new AzureWorkloadErrorInfo();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("errorCode".equals(fieldName)) {
+ deserializedAzureWorkloadErrorInfo.errorCode = reader.getNullable(JsonReader::getInt);
+ } else if ("errorString".equals(fieldName)) {
+ deserializedAzureWorkloadErrorInfo.errorString = reader.getString();
+ } else if ("errorTitle".equals(fieldName)) {
+ deserializedAzureWorkloadErrorInfo.errorTitle = reader.getString();
+ } else if ("recommendations".equals(fieldName)) {
+ List recommendations = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureWorkloadErrorInfo.recommendations = recommendations;
+ } else if ("additionalDetails".equals(fieldName)) {
+ deserializedAzureWorkloadErrorInfo.additionalDetails = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadErrorInfo;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJob.java
index 72688886a058f..21140457b39e0 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJob.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJob.java
@@ -5,56 +5,50 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.Duration;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
/**
* Azure storage specific job.
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "jobType", defaultImpl = AzureWorkloadJob.class, visible = true)
-@JsonTypeName("AzureWorkloadJob")
@Fluent
public final class AzureWorkloadJob extends Job {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "jobType", required = true)
private String jobType = "AzureWorkloadJob";
/*
* Workload type of the job
*/
- @JsonProperty(value = "workloadType")
private String workloadType;
/*
* Time elapsed during the execution of this job.
*/
- @JsonProperty(value = "duration")
private Duration duration;
/*
* Gets or sets the state/actions applicable on this job like cancel/retry.
*/
- @JsonProperty(value = "actionsInfo")
private List actionsInfo;
/*
* Error details on execution of this job.
*/
- @JsonProperty(value = "errorDetails")
private List errorDetails;
/*
* Additional information about the job.
*/
- @JsonProperty(value = "extendedInfo")
private AzureWorkloadJobExtendedInfo extendedInfo;
/**
@@ -244,7 +238,6 @@ public AzureWorkloadJob withActivityId(String activityId) {
*/
@Override
public void validate() {
- super.validate();
if (errorDetails() != null) {
errorDetails().forEach(e -> e.validate());
}
@@ -252,4 +245,88 @@ public void validate() {
extendedInfo().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("entityFriendlyName", entityFriendlyName());
+ jsonWriter.writeStringField("backupManagementType",
+ backupManagementType() == null ? null : backupManagementType().toString());
+ jsonWriter.writeStringField("operation", operation());
+ jsonWriter.writeStringField("status", status());
+ jsonWriter.writeStringField("startTime",
+ startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime()));
+ jsonWriter.writeStringField("endTime",
+ endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime()));
+ jsonWriter.writeStringField("activityId", activityId());
+ jsonWriter.writeStringField("jobType", this.jobType);
+ jsonWriter.writeStringField("workloadType", this.workloadType);
+ jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration));
+ jsonWriter.writeArrayField("actionsInfo", this.actionsInfo,
+ (writer, element) -> writer.writeString(element == null ? null : element.toString()));
+ jsonWriter.writeArrayField("errorDetails", this.errorDetails, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeJsonField("extendedInfo", this.extendedInfo);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadJob from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadJob if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadJob.
+ */
+ public static AzureWorkloadJob fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadJob deserializedAzureWorkloadJob = new AzureWorkloadJob();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("entityFriendlyName".equals(fieldName)) {
+ deserializedAzureWorkloadJob.withEntityFriendlyName(reader.getString());
+ } else if ("backupManagementType".equals(fieldName)) {
+ deserializedAzureWorkloadJob
+ .withBackupManagementType(BackupManagementType.fromString(reader.getString()));
+ } else if ("operation".equals(fieldName)) {
+ deserializedAzureWorkloadJob.withOperation(reader.getString());
+ } else if ("status".equals(fieldName)) {
+ deserializedAzureWorkloadJob.withStatus(reader.getString());
+ } else if ("startTime".equals(fieldName)) {
+ deserializedAzureWorkloadJob.withStartTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("endTime".equals(fieldName)) {
+ deserializedAzureWorkloadJob.withEndTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("activityId".equals(fieldName)) {
+ deserializedAzureWorkloadJob.withActivityId(reader.getString());
+ } else if ("jobType".equals(fieldName)) {
+ deserializedAzureWorkloadJob.jobType = reader.getString();
+ } else if ("workloadType".equals(fieldName)) {
+ deserializedAzureWorkloadJob.workloadType = reader.getString();
+ } else if ("duration".equals(fieldName)) {
+ deserializedAzureWorkloadJob.duration
+ = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()));
+ } else if ("actionsInfo".equals(fieldName)) {
+ List actionsInfo
+ = reader.readArray(reader1 -> JobSupportedAction.fromString(reader1.getString()));
+ deserializedAzureWorkloadJob.actionsInfo = actionsInfo;
+ } else if ("errorDetails".equals(fieldName)) {
+ List errorDetails
+ = reader.readArray(reader1 -> AzureWorkloadErrorInfo.fromJson(reader1));
+ deserializedAzureWorkloadJob.errorDetails = errorDetails;
+ } else if ("extendedInfo".equals(fieldName)) {
+ deserializedAzureWorkloadJob.extendedInfo = AzureWorkloadJobExtendedInfo.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadJob;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.java
index f5c4fdd8caeab..0a4fec23f04b3 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.java
@@ -5,8 +5,11 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -14,24 +17,20 @@
* Azure VM workload-specific additional information for job.
*/
@Fluent
-public final class AzureWorkloadJobExtendedInfo {
+public final class AzureWorkloadJobExtendedInfo implements JsonSerializable {
/*
* List of tasks for this job
*/
- @JsonProperty(value = "tasksList")
private List tasksList;
/*
* Job properties.
*/
- @JsonProperty(value = "propertyBag")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map propertyBag;
/*
* Non localized error message on job execution.
*/
- @JsonProperty(value = "dynamicErrorMessage")
private String dynamicErrorMessage;
/**
@@ -110,4 +109,49 @@ public void validate() {
tasksList().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("tasksList", this.tasksList, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeMapField("propertyBag", this.propertyBag, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("dynamicErrorMessage", this.dynamicErrorMessage);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadJobExtendedInfo from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadJobExtendedInfo if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadJobExtendedInfo.
+ */
+ public static AzureWorkloadJobExtendedInfo fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadJobExtendedInfo deserializedAzureWorkloadJobExtendedInfo = new AzureWorkloadJobExtendedInfo();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("tasksList".equals(fieldName)) {
+ List tasksList
+ = reader.readArray(reader1 -> AzureWorkloadJobTaskDetails.fromJson(reader1));
+ deserializedAzureWorkloadJobExtendedInfo.tasksList = tasksList;
+ } else if ("propertyBag".equals(fieldName)) {
+ Map propertyBag = reader.readMap(reader1 -> reader1.getString());
+ deserializedAzureWorkloadJobExtendedInfo.propertyBag = propertyBag;
+ } else if ("dynamicErrorMessage".equals(fieldName)) {
+ deserializedAzureWorkloadJobExtendedInfo.dynamicErrorMessage = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadJobExtendedInfo;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobTaskDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobTaskDetails.java
index e1ebfe875e933..e83ba3c514d50 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobTaskDetails.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobTaskDetails.java
@@ -5,23 +5,25 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
/**
* Azure VM workload specific job task details.
*/
@Fluent
-public final class AzureWorkloadJobTaskDetails {
+public final class AzureWorkloadJobTaskDetails implements JsonSerializable {
/*
* The task display name.
*/
- @JsonProperty(value = "taskId")
private String taskId;
/*
* The status.
*/
- @JsonProperty(value = "status")
private String status;
/**
@@ -77,4 +79,43 @@ public AzureWorkloadJobTaskDetails withStatus(String status) {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("taskId", this.taskId);
+ jsonWriter.writeStringField("status", this.status);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadJobTaskDetails from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadJobTaskDetails if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadJobTaskDetails.
+ */
+ public static AzureWorkloadJobTaskDetails fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadJobTaskDetails deserializedAzureWorkloadJobTaskDetails = new AzureWorkloadJobTaskDetails();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("taskId".equals(fieldName)) {
+ deserializedAzureWorkloadJobTaskDetails.taskId = reader.getString();
+ } else if ("status".equals(fieldName)) {
+ deserializedAzureWorkloadJobTaskDetails.status = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadJobTaskDetails;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOraclePointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOraclePointInTimeRecoveryPoint.java
new file mode 100644
index 0000000000000..e71887f071b37
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOraclePointInTimeRecoveryPoint.java
@@ -0,0 +1,198 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Recovery point specific to PointInTime for Oracle.
+ */
+@Fluent
+public final class AzureWorkloadOraclePointInTimeRecoveryPoint extends AzureWorkloadPointInTimeRecoveryPoint {
+ /*
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
+ */
+ private String objectType = "AzureWorkloadOraclePointInTimeRecoveryPoint";
+
+ /**
+ * Creates an instance of AzureWorkloadOraclePointInTimeRecoveryPoint class.
+ */
+ public AzureWorkloadOraclePointInTimeRecoveryPoint() {
+ }
+
+ /**
+ * Get the objectType property: This property will be used as the discriminator for deciding the specific types in
+ * the polymorphic chain of types.
+ *
+ * @return the objectType value.
+ */
+ @Override
+ public String objectType() {
+ return this.objectType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRecoveryPoint withTimeRanges(List timeRanges) {
+ super.withTimeRanges(timeRanges);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRecoveryPoint
+ withRecoveryPointTimeInUtc(OffsetDateTime recoveryPointTimeInUtc) {
+ super.withRecoveryPointTimeInUtc(recoveryPointTimeInUtc);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRecoveryPoint withType(RestorePointType type) {
+ super.withType(type);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRecoveryPoint
+ withRecoveryPointTierDetails(List recoveryPointTierDetails) {
+ super.withRecoveryPointTierDetails(recoveryPointTierDetails);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRecoveryPoint
+ withRecoveryPointMoveReadinessInfo(Map recoveryPointMoveReadinessInfo) {
+ super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRecoveryPoint
+ withRecoveryPointProperties(RecoveryPointProperties recoveryPointProperties) {
+ super.withRecoveryPointProperties(recoveryPointProperties);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (recoveryPointTierDetails() != null) {
+ recoveryPointTierDetails().forEach(e -> e.validate());
+ }
+ if (recoveryPointMoveReadinessInfo() != null) {
+ recoveryPointMoveReadinessInfo().values().forEach(e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ if (recoveryPointProperties() != null) {
+ recoveryPointProperties().validate();
+ }
+ if (timeRanges() != null) {
+ timeRanges().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("recoveryPointTimeInUTC",
+ recoveryPointTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(recoveryPointTimeInUtc()));
+ jsonWriter.writeStringField("type", type() == null ? null : type().toString());
+ jsonWriter.writeArrayField("recoveryPointTierDetails", recoveryPointTierDetails(),
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", recoveryPointMoveReadinessInfo(),
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeJsonField("recoveryPointProperties", recoveryPointProperties());
+ jsonWriter.writeArrayField("timeRanges", timeRanges(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("objectType", this.objectType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadOraclePointInTimeRecoveryPoint from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadOraclePointInTimeRecoveryPoint if the JsonReader was pointing to an instance
+ * of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadOraclePointInTimeRecoveryPoint.
+ */
+ public static AzureWorkloadOraclePointInTimeRecoveryPoint fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadOraclePointInTimeRecoveryPoint deserializedAzureWorkloadOraclePointInTimeRecoveryPoint
+ = new AzureWorkloadOraclePointInTimeRecoveryPoint();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("recoveryPointTimeInUTC".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRecoveryPoint.withRecoveryPointTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("type".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRecoveryPoint
+ .withType(RestorePointType.fromString(reader.getString()));
+ } else if ("recoveryPointTierDetails".equals(fieldName)) {
+ List recoveryPointTierDetails
+ = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1));
+ deserializedAzureWorkloadOraclePointInTimeRecoveryPoint
+ .withRecoveryPointTierDetails(recoveryPointTierDetails);
+ } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) {
+ Map recoveryPointMoveReadinessInfo
+ = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1));
+ deserializedAzureWorkloadOraclePointInTimeRecoveryPoint
+ .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo);
+ } else if ("recoveryPointProperties".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRecoveryPoint
+ .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader));
+ } else if ("timeRanges".equals(fieldName)) {
+ List timeRanges = reader.readArray(reader1 -> PointInTimeRange.fromJson(reader1));
+ deserializedAzureWorkloadOraclePointInTimeRecoveryPoint.withTimeRanges(timeRanges);
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRecoveryPoint.objectType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadOraclePointInTimeRecoveryPoint;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOraclePointInTimeRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOraclePointInTimeRestoreRequest.java
new file mode 100644
index 0000000000000..fd78216e0d4df
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOraclePointInTimeRestoreRequest.java
@@ -0,0 +1,290 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AzureWorkload Oracle -specific restore. Specifically for PointInTime/Log restore.
+ */
+@Fluent
+public class AzureWorkloadOraclePointInTimeRestoreRequest extends AzureWorkloadOracleRestoreRequest {
+ /*
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
+ */
+ private String objectType = "AzureWorkloadOraclePointInTimeRestoreRequest";
+
+ /*
+ * PointInTime value
+ */
+ private OffsetDateTime pointInTime;
+
+ /**
+ * Creates an instance of AzureWorkloadOraclePointInTimeRestoreRequest class.
+ */
+ public AzureWorkloadOraclePointInTimeRestoreRequest() {
+ }
+
+ /**
+ * Get the objectType property: This property will be used as the discriminator for deciding the specific types in
+ * the polymorphic chain of types.
+ *
+ * @return the objectType value.
+ */
+ @Override
+ public String objectType() {
+ return this.objectType;
+ }
+
+ /**
+ * Get the pointInTime property: PointInTime value.
+ *
+ * @return the pointInTime value.
+ */
+ public OffsetDateTime pointInTime() {
+ return this.pointInTime;
+ }
+
+ /**
+ * Set the pointInTime property: PointInTime value.
+ *
+ * @param pointInTime the pointInTime value to set.
+ * @return the AzureWorkloadOraclePointInTimeRestoreRequest object itself.
+ */
+ public AzureWorkloadOraclePointInTimeRestoreRequest withPointInTime(OffsetDateTime pointInTime) {
+ this.pointInTime = pointInTime;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreRequest withRecoveryType(RecoveryType recoveryType) {
+ super.withRecoveryType(recoveryType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreRequest withSourceResourceId(String sourceResourceId) {
+ super.withSourceResourceId(sourceResourceId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreRequest withPropertyBag(Map propertyBag) {
+ super.withPropertyBag(propertyBag);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) {
+ super.withTargetInfo(targetInfo);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) {
+ super.withRecoveryMode(recoveryMode);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreRequest withTargetResourceGroupName(String targetResourceGroupName) {
+ super.withTargetResourceGroupName(targetResourceGroupName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreRequest
+ withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) {
+ super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreRequest
+ withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) {
+ super.withSnapshotRestoreParameters(snapshotRestoreParameters);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) {
+ super.withTargetVirtualMachineId(targetVirtualMachineId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreRequest
+ withResourceGuardOperationRequests(List resourceGuardOperationRequests) {
+ super.withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (targetInfo() != null) {
+ targetInfo().validate();
+ }
+ if (userAssignedManagedIdentityDetails() != null) {
+ userAssignedManagedIdentityDetails().validate();
+ }
+ if (snapshotRestoreParameters() != null) {
+ snapshotRestoreParameters().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("targetInfo", targetInfo());
+ jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString());
+ jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName());
+ jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails());
+ jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters());
+ jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId());
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeStringField("pointInTime",
+ this.pointInTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.pointInTime));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadOraclePointInTimeRestoreRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadOraclePointInTimeRestoreRequest if the JsonReader was pointing to an instance
+ * of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadOraclePointInTimeRestoreRequest.
+ */
+ public static AzureWorkloadOraclePointInTimeRestoreRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("objectType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) {
+ return AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static AzureWorkloadOraclePointInTimeRestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader)
+ throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadOraclePointInTimeRestoreRequest deserializedAzureWorkloadOraclePointInTimeRestoreRequest
+ = new AzureWorkloadOraclePointInTimeRestoreRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureWorkloadOraclePointInTimeRestoreRequest
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("recoveryType".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreRequest
+ .withRecoveryType(RecoveryType.fromString(reader.getString()));
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreRequest.withSourceResourceId(reader.getString());
+ } else if ("propertyBag".equals(fieldName)) {
+ Map propertyBag = reader.readMap(reader1 -> reader1.getString());
+ deserializedAzureWorkloadOraclePointInTimeRestoreRequest.withPropertyBag(propertyBag);
+ } else if ("targetInfo".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreRequest
+ .withTargetInfo(TargetRestoreInfo.fromJson(reader));
+ } else if ("recoveryMode".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreRequest
+ .withRecoveryMode(RecoveryMode.fromString(reader.getString()));
+ } else if ("targetResourceGroupName".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreRequest
+ .withTargetResourceGroupName(reader.getString());
+ } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreRequest
+ .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader));
+ } else if ("snapshotRestoreParameters".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreRequest
+ .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader));
+ } else if ("targetVirtualMachineId".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreRequest
+ .withTargetVirtualMachineId(reader.getString());
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreRequest.objectType = reader.getString();
+ } else if ("pointInTime".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreRequest.pointInTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadOraclePointInTimeRestoreRequest;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest.java
new file mode 100644
index 0000000000000..294cdef9e6e8a
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest.java
@@ -0,0 +1,288 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AzureWorkload Oracle-specific restore with integrated rehydration of recovery point.
+ */
+@Fluent
+public final class AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ extends AzureWorkloadOraclePointInTimeRestoreRequest {
+ /*
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
+ */
+ private String objectType = "AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest";
+
+ /*
+ * RP Rehydration Info
+ */
+ private RecoveryPointRehydrationInfo recoveryPointRehydrationInfo;
+
+ /**
+ * Creates an instance of AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest class.
+ */
+ public AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest() {
+ }
+
+ /**
+ * Get the objectType property: This property will be used as the discriminator for deciding the specific types in
+ * the polymorphic chain of types.
+ *
+ * @return the objectType value.
+ */
+ @Override
+ public String objectType() {
+ return this.objectType;
+ }
+
+ /**
+ * Get the recoveryPointRehydrationInfo property: RP Rehydration Info.
+ *
+ * @return the recoveryPointRehydrationInfo value.
+ */
+ public RecoveryPointRehydrationInfo recoveryPointRehydrationInfo() {
+ return this.recoveryPointRehydrationInfo;
+ }
+
+ /**
+ * Set the recoveryPointRehydrationInfo property: RP Rehydration Info.
+ *
+ * @param recoveryPointRehydrationInfo the recoveryPointRehydrationInfo value to set.
+ * @return the AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest object itself.
+ */
+ public AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ withRecoveryPointRehydrationInfo(RecoveryPointRehydrationInfo recoveryPointRehydrationInfo) {
+ this.recoveryPointRehydrationInfo = recoveryPointRehydrationInfo;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest withPointInTime(OffsetDateTime pointInTime) {
+ super.withPointInTime(pointInTime);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest withRecoveryType(RecoveryType recoveryType) {
+ super.withRecoveryType(recoveryType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest withSourceResourceId(String sourceResourceId) {
+ super.withSourceResourceId(sourceResourceId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest withPropertyBag(Map propertyBag) {
+ super.withPropertyBag(propertyBag);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest withTargetInfo(TargetRestoreInfo targetInfo) {
+ super.withTargetInfo(targetInfo);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest withRecoveryMode(RecoveryMode recoveryMode) {
+ super.withRecoveryMode(recoveryMode);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ withTargetResourceGroupName(String targetResourceGroupName) {
+ super.withTargetResourceGroupName(targetResourceGroupName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) {
+ super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) {
+ super.withSnapshotRestoreParameters(snapshotRestoreParameters);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ withTargetVirtualMachineId(String targetVirtualMachineId) {
+ super.withTargetVirtualMachineId(targetVirtualMachineId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ withResourceGuardOperationRequests(List resourceGuardOperationRequests) {
+ super.withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (recoveryPointRehydrationInfo() != null) {
+ recoveryPointRehydrationInfo().validate();
+ }
+ if (targetInfo() != null) {
+ targetInfo().validate();
+ }
+ if (userAssignedManagedIdentityDetails() != null) {
+ userAssignedManagedIdentityDetails().validate();
+ }
+ if (snapshotRestoreParameters() != null) {
+ snapshotRestoreParameters().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("targetInfo", targetInfo());
+ jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString());
+ jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName());
+ jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails());
+ jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters());
+ jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId());
+ jsonWriter.writeStringField("pointInTime",
+ pointInTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(pointInTime()));
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeJsonField("recoveryPointRehydrationInfo", this.recoveryPointRehydrationInfo);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest if the JsonReader was pointing
+ * to an instance of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the
+ * AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest.
+ */
+ public static AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest fromJson(JsonReader jsonReader)
+ throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ = new AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("recoveryType".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ .withRecoveryType(RecoveryType.fromString(reader.getString()));
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ .withSourceResourceId(reader.getString());
+ } else if ("propertyBag".equals(fieldName)) {
+ Map propertyBag = reader.readMap(reader1 -> reader1.getString());
+ deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest.withPropertyBag(propertyBag);
+ } else if ("targetInfo".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ .withTargetInfo(TargetRestoreInfo.fromJson(reader));
+ } else if ("recoveryMode".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ .withRecoveryMode(RecoveryMode.fromString(reader.getString()));
+ } else if ("targetResourceGroupName".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ .withTargetResourceGroupName(reader.getString());
+ } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader));
+ } else if ("snapshotRestoreParameters".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader));
+ } else if ("targetVirtualMachineId".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest
+ .withTargetVirtualMachineId(reader.getString());
+ } else if ("pointInTime".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest.withPointInTime(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest.objectType
+ = reader.getString();
+ } else if ("recoveryPointRehydrationInfo".equals(fieldName)) {
+ deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest.recoveryPointRehydrationInfo
+ = RecoveryPointRehydrationInfo.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOracleRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOracleRecoveryPoint.java
new file mode 100644
index 0000000000000..7e04289d4224f
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOracleRecoveryPoint.java
@@ -0,0 +1,180 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Oracle specific recoverypoint, specifically encapsulates full/diff recoverypoints.
+ */
+@Fluent
+public final class AzureWorkloadOracleRecoveryPoint extends AzureWorkloadRecoveryPoint {
+ /*
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
+ */
+ private String objectType = "AzureWorkloadOracleRecoveryPoint";
+
+ /**
+ * Creates an instance of AzureWorkloadOracleRecoveryPoint class.
+ */
+ public AzureWorkloadOracleRecoveryPoint() {
+ }
+
+ /**
+ * Get the objectType property: This property will be used as the discriminator for deciding the specific types in
+ * the polymorphic chain of types.
+ *
+ * @return the objectType value.
+ */
+ @Override
+ public String objectType() {
+ return this.objectType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRecoveryPoint withRecoveryPointTimeInUtc(OffsetDateTime recoveryPointTimeInUtc) {
+ super.withRecoveryPointTimeInUtc(recoveryPointTimeInUtc);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRecoveryPoint withType(RestorePointType type) {
+ super.withType(type);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRecoveryPoint
+ withRecoveryPointTierDetails(List recoveryPointTierDetails) {
+ super.withRecoveryPointTierDetails(recoveryPointTierDetails);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRecoveryPoint
+ withRecoveryPointMoveReadinessInfo(Map recoveryPointMoveReadinessInfo) {
+ super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRecoveryPoint
+ withRecoveryPointProperties(RecoveryPointProperties recoveryPointProperties) {
+ super.withRecoveryPointProperties(recoveryPointProperties);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (recoveryPointTierDetails() != null) {
+ recoveryPointTierDetails().forEach(e -> e.validate());
+ }
+ if (recoveryPointMoveReadinessInfo() != null) {
+ recoveryPointMoveReadinessInfo().values().forEach(e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ if (recoveryPointProperties() != null) {
+ recoveryPointProperties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("recoveryPointTimeInUTC",
+ recoveryPointTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(recoveryPointTimeInUtc()));
+ jsonWriter.writeStringField("type", type() == null ? null : type().toString());
+ jsonWriter.writeArrayField("recoveryPointTierDetails", recoveryPointTierDetails(),
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", recoveryPointMoveReadinessInfo(),
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeJsonField("recoveryPointProperties", recoveryPointProperties());
+ jsonWriter.writeStringField("objectType", this.objectType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadOracleRecoveryPoint from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadOracleRecoveryPoint if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadOracleRecoveryPoint.
+ */
+ public static AzureWorkloadOracleRecoveryPoint fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadOracleRecoveryPoint deserializedAzureWorkloadOracleRecoveryPoint
+ = new AzureWorkloadOracleRecoveryPoint();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("recoveryPointTimeInUTC".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRecoveryPoint.withRecoveryPointTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("type".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRecoveryPoint
+ .withType(RestorePointType.fromString(reader.getString()));
+ } else if ("recoveryPointTierDetails".equals(fieldName)) {
+ List recoveryPointTierDetails
+ = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1));
+ deserializedAzureWorkloadOracleRecoveryPoint.withRecoveryPointTierDetails(recoveryPointTierDetails);
+ } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) {
+ Map recoveryPointMoveReadinessInfo
+ = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1));
+ deserializedAzureWorkloadOracleRecoveryPoint
+ .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo);
+ } else if ("recoveryPointProperties".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRecoveryPoint
+ .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader));
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRecoveryPoint.objectType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadOracleRecoveryPoint;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOracleRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOracleRestoreRequest.java
new file mode 100644
index 0000000000000..83abdb94f1265
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOracleRestoreRequest.java
@@ -0,0 +1,257 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AzureWorkload Oracle-specific restore.
+ */
+@Fluent
+public class AzureWorkloadOracleRestoreRequest extends AzureWorkloadRestoreRequest {
+ /*
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
+ */
+ private String objectType = "AzureWorkloadOracleRestoreRequest";
+
+ /**
+ * Creates an instance of AzureWorkloadOracleRestoreRequest class.
+ */
+ public AzureWorkloadOracleRestoreRequest() {
+ }
+
+ /**
+ * Get the objectType property: This property will be used as the discriminator for deciding the specific types in
+ * the polymorphic chain of types.
+ *
+ * @return the objectType value.
+ */
+ @Override
+ public String objectType() {
+ return this.objectType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreRequest withRecoveryType(RecoveryType recoveryType) {
+ super.withRecoveryType(recoveryType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreRequest withSourceResourceId(String sourceResourceId) {
+ super.withSourceResourceId(sourceResourceId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreRequest withPropertyBag(Map propertyBag) {
+ super.withPropertyBag(propertyBag);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) {
+ super.withTargetInfo(targetInfo);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) {
+ super.withRecoveryMode(recoveryMode);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreRequest withTargetResourceGroupName(String targetResourceGroupName) {
+ super.withTargetResourceGroupName(targetResourceGroupName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreRequest
+ withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) {
+ super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreRequest
+ withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) {
+ super.withSnapshotRestoreParameters(snapshotRestoreParameters);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) {
+ super.withTargetVirtualMachineId(targetVirtualMachineId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreRequest
+ withResourceGuardOperationRequests(List resourceGuardOperationRequests) {
+ super.withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (targetInfo() != null) {
+ targetInfo().validate();
+ }
+ if (userAssignedManagedIdentityDetails() != null) {
+ userAssignedManagedIdentityDetails().validate();
+ }
+ if (snapshotRestoreParameters() != null) {
+ snapshotRestoreParameters().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("targetInfo", targetInfo());
+ jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString());
+ jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName());
+ jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails());
+ jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters());
+ jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId());
+ jsonWriter.writeStringField("objectType", this.objectType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadOracleRestoreRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadOracleRestoreRequest if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadOracleRestoreRequest.
+ */
+ public static AzureWorkloadOracleRestoreRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("objectType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("AzureWorkloadOraclePointInTimeRestoreRequest".equals(discriminatorValue)) {
+ return AzureWorkloadOraclePointInTimeRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) {
+ return AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadOracleRestoreWithRehydrateRequest".equals(discriminatorValue)) {
+ return AzureWorkloadOracleRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static AzureWorkloadOracleRestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadOracleRestoreRequest deserializedAzureWorkloadOracleRestoreRequest
+ = new AzureWorkloadOracleRestoreRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureWorkloadOracleRestoreRequest
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("recoveryType".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreRequest
+ .withRecoveryType(RecoveryType.fromString(reader.getString()));
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreRequest.withSourceResourceId(reader.getString());
+ } else if ("propertyBag".equals(fieldName)) {
+ Map propertyBag = reader.readMap(reader1 -> reader1.getString());
+ deserializedAzureWorkloadOracleRestoreRequest.withPropertyBag(propertyBag);
+ } else if ("targetInfo".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreRequest.withTargetInfo(TargetRestoreInfo.fromJson(reader));
+ } else if ("recoveryMode".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreRequest
+ .withRecoveryMode(RecoveryMode.fromString(reader.getString()));
+ } else if ("targetResourceGroupName".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreRequest.withTargetResourceGroupName(reader.getString());
+ } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreRequest
+ .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader));
+ } else if ("snapshotRestoreParameters".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreRequest
+ .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader));
+ } else if ("targetVirtualMachineId".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreRequest.withTargetVirtualMachineId(reader.getString());
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreRequest.objectType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadOracleRestoreRequest;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOracleRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOracleRestoreWithRehydrateRequest.java
new file mode 100644
index 0000000000000..8ceecfaa0a5a7
--- /dev/null
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadOracleRestoreWithRehydrateRequest.java
@@ -0,0 +1,264 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.recoveryservicesbackup.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AzureWorkload Oracle-specific restore with integrated rehydration of recovery point.
+ */
+@Fluent
+public final class AzureWorkloadOracleRestoreWithRehydrateRequest extends AzureWorkloadOracleRestoreRequest {
+ /*
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
+ */
+ private String objectType = "AzureWorkloadOracleRestoreWithRehydrateRequest";
+
+ /*
+ * RP Rehydration Info
+ */
+ private RecoveryPointRehydrationInfo recoveryPointRehydrationInfo;
+
+ /**
+ * Creates an instance of AzureWorkloadOracleRestoreWithRehydrateRequest class.
+ */
+ public AzureWorkloadOracleRestoreWithRehydrateRequest() {
+ }
+
+ /**
+ * Get the objectType property: This property will be used as the discriminator for deciding the specific types in
+ * the polymorphic chain of types.
+ *
+ * @return the objectType value.
+ */
+ @Override
+ public String objectType() {
+ return this.objectType;
+ }
+
+ /**
+ * Get the recoveryPointRehydrationInfo property: RP Rehydration Info.
+ *
+ * @return the recoveryPointRehydrationInfo value.
+ */
+ public RecoveryPointRehydrationInfo recoveryPointRehydrationInfo() {
+ return this.recoveryPointRehydrationInfo;
+ }
+
+ /**
+ * Set the recoveryPointRehydrationInfo property: RP Rehydration Info.
+ *
+ * @param recoveryPointRehydrationInfo the recoveryPointRehydrationInfo value to set.
+ * @return the AzureWorkloadOracleRestoreWithRehydrateRequest object itself.
+ */
+ public AzureWorkloadOracleRestoreWithRehydrateRequest
+ withRecoveryPointRehydrationInfo(RecoveryPointRehydrationInfo recoveryPointRehydrationInfo) {
+ this.recoveryPointRehydrationInfo = recoveryPointRehydrationInfo;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreWithRehydrateRequest withRecoveryType(RecoveryType recoveryType) {
+ super.withRecoveryType(recoveryType);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreWithRehydrateRequest withSourceResourceId(String sourceResourceId) {
+ super.withSourceResourceId(sourceResourceId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreWithRehydrateRequest withPropertyBag(Map propertyBag) {
+ super.withPropertyBag(propertyBag);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreWithRehydrateRequest withTargetInfo(TargetRestoreInfo targetInfo) {
+ super.withTargetInfo(targetInfo);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreWithRehydrateRequest withRecoveryMode(RecoveryMode recoveryMode) {
+ super.withRecoveryMode(recoveryMode);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreWithRehydrateRequest withTargetResourceGroupName(String targetResourceGroupName) {
+ super.withTargetResourceGroupName(targetResourceGroupName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreWithRehydrateRequest
+ withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) {
+ super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreWithRehydrateRequest
+ withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) {
+ super.withSnapshotRestoreParameters(snapshotRestoreParameters);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreWithRehydrateRequest withTargetVirtualMachineId(String targetVirtualMachineId) {
+ super.withTargetVirtualMachineId(targetVirtualMachineId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AzureWorkloadOracleRestoreWithRehydrateRequest
+ withResourceGuardOperationRequests(List resourceGuardOperationRequests) {
+ super.withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (recoveryPointRehydrationInfo() != null) {
+ recoveryPointRehydrationInfo().validate();
+ }
+ if (targetInfo() != null) {
+ targetInfo().validate();
+ }
+ if (userAssignedManagedIdentityDetails() != null) {
+ userAssignedManagedIdentityDetails().validate();
+ }
+ if (snapshotRestoreParameters() != null) {
+ snapshotRestoreParameters().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("targetInfo", targetInfo());
+ jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString());
+ jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName());
+ jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails());
+ jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters());
+ jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId());
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeJsonField("recoveryPointRehydrationInfo", this.recoveryPointRehydrationInfo);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadOracleRestoreWithRehydrateRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadOracleRestoreWithRehydrateRequest if the JsonReader was pointing to an
+ * instance of it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadOracleRestoreWithRehydrateRequest.
+ */
+ public static AzureWorkloadOracleRestoreWithRehydrateRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadOracleRestoreWithRehydrateRequest deserializedAzureWorkloadOracleRestoreWithRehydrateRequest
+ = new AzureWorkloadOracleRestoreWithRehydrateRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureWorkloadOracleRestoreWithRehydrateRequest
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("recoveryType".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreWithRehydrateRequest
+ .withRecoveryType(RecoveryType.fromString(reader.getString()));
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreWithRehydrateRequest.withSourceResourceId(reader.getString());
+ } else if ("propertyBag".equals(fieldName)) {
+ Map propertyBag = reader.readMap(reader1 -> reader1.getString());
+ deserializedAzureWorkloadOracleRestoreWithRehydrateRequest.withPropertyBag(propertyBag);
+ } else if ("targetInfo".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreWithRehydrateRequest
+ .withTargetInfo(TargetRestoreInfo.fromJson(reader));
+ } else if ("recoveryMode".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreWithRehydrateRequest
+ .withRecoveryMode(RecoveryMode.fromString(reader.getString()));
+ } else if ("targetResourceGroupName".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreWithRehydrateRequest
+ .withTargetResourceGroupName(reader.getString());
+ } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreWithRehydrateRequest
+ .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader));
+ } else if ("snapshotRestoreParameters".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreWithRehydrateRequest
+ .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader));
+ } else if ("targetVirtualMachineId".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreWithRehydrateRequest
+ .withTargetVirtualMachineId(reader.getString());
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreWithRehydrateRequest.objectType = reader.getString();
+ } else if ("recoveryPointRehydrationInfo".equals(fieldName)) {
+ deserializedAzureWorkloadOracleRestoreWithRehydrateRequest.recoveryPointRehydrationInfo
+ = RecoveryPointRehydrationInfo.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadOracleRestoreWithRehydrateRequest;
+ });
+ }
+}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPoint.java
index 084613c6fe4a5..734b229988668 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPoint.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPoint.java
@@ -5,41 +5,30 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
/**
* Recovery point specific to PointInTime.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "objectType",
- defaultImpl = AzureWorkloadPointInTimeRecoveryPoint.class,
- visible = true)
-@JsonTypeName("AzureWorkloadPointInTimeRecoveryPoint")
-@JsonSubTypes({
- @JsonSubTypes.Type(
- name = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint",
- value = AzureWorkloadSapHanaPointInTimeRecoveryPoint.class) })
@Fluent
public class AzureWorkloadPointInTimeRecoveryPoint extends AzureWorkloadRecoveryPoint {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "objectType", required = true)
private String objectType = "AzureWorkloadPointInTimeRecoveryPoint";
/*
* List of log ranges
*/
- @JsonProperty(value = "timeRanges")
private List timeRanges;
/**
@@ -134,9 +123,122 @@ public AzureWorkloadPointInTimeRecoveryPoint withType(RestorePointType type) {
*/
@Override
public void validate() {
- super.validate();
if (timeRanges() != null) {
timeRanges().forEach(e -> e.validate());
}
+ if (recoveryPointTierDetails() != null) {
+ recoveryPointTierDetails().forEach(e -> e.validate());
+ }
+ if (recoveryPointMoveReadinessInfo() != null) {
+ recoveryPointMoveReadinessInfo().values().forEach(e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ if (recoveryPointProperties() != null) {
+ recoveryPointProperties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("recoveryPointTimeInUTC",
+ recoveryPointTimeInUtc() == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(recoveryPointTimeInUtc()));
+ jsonWriter.writeStringField("type", type() == null ? null : type().toString());
+ jsonWriter.writeArrayField("recoveryPointTierDetails", recoveryPointTierDetails(),
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", recoveryPointMoveReadinessInfo(),
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeJsonField("recoveryPointProperties", recoveryPointProperties());
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeArrayField("timeRanges", this.timeRanges, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadPointInTimeRecoveryPoint from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadPointInTimeRecoveryPoint if the JsonReader was pointing to an instance of it,
+ * or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadPointInTimeRecoveryPoint.
+ */
+ public static AzureWorkloadPointInTimeRecoveryPoint fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("objectType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("AzureWorkloadSAPHanaPointInTimeRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadSapHanaPointInTimeRecoveryPoint.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadSAPAsePointInTimeRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadSapAsePointInTimeRecoveryPoint.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadOraclePointInTimeRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadOraclePointInTimeRecoveryPoint.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadAnyDatabasePointInTimeRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadAnyDatabasePointInTimeRecoveryPoint.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static AzureWorkloadPointInTimeRecoveryPoint fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadPointInTimeRecoveryPoint deserializedAzureWorkloadPointInTimeRecoveryPoint
+ = new AzureWorkloadPointInTimeRecoveryPoint();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("recoveryPointTimeInUTC".equals(fieldName)) {
+ deserializedAzureWorkloadPointInTimeRecoveryPoint.withRecoveryPointTimeInUtc(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("type".equals(fieldName)) {
+ deserializedAzureWorkloadPointInTimeRecoveryPoint
+ .withType(RestorePointType.fromString(reader.getString()));
+ } else if ("recoveryPointTierDetails".equals(fieldName)) {
+ List recoveryPointTierDetails
+ = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1));
+ deserializedAzureWorkloadPointInTimeRecoveryPoint
+ .withRecoveryPointTierDetails(recoveryPointTierDetails);
+ } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) {
+ Map recoveryPointMoveReadinessInfo
+ = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1));
+ deserializedAzureWorkloadPointInTimeRecoveryPoint
+ .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo);
+ } else if ("recoveryPointProperties".equals(fieldName)) {
+ deserializedAzureWorkloadPointInTimeRecoveryPoint
+ .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader));
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadPointInTimeRecoveryPoint.objectType = reader.getString();
+ } else if ("timeRanges".equals(fieldName)) {
+ List timeRanges = reader.readArray(reader1 -> PointInTimeRange.fromJson(reader1));
+ deserializedAzureWorkloadPointInTimeRecoveryPoint.timeRanges = timeRanges;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadPointInTimeRecoveryPoint;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.java
index 457513aa7115c..16d452b8ca5b9 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.java
@@ -5,36 +5,30 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
/**
* AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "objectType",
- defaultImpl = AzureWorkloadPointInTimeRestoreRequest.class,
- visible = true)
-@JsonTypeName("AzureWorkloadPointInTimeRestoreRequest")
@Fluent
public final class AzureWorkloadPointInTimeRestoreRequest extends AzureWorkloadRestoreRequest {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "objectType", required = true)
private String objectType = "AzureWorkloadPointInTimeRestoreRequest";
/*
* PointInTime value
*/
- @JsonProperty(value = "pointInTime")
private OffsetDateTime pointInTime;
/**
@@ -174,6 +168,95 @@ public AzureWorkloadPointInTimeRestoreRequest withTargetVirtualMachineId(String
*/
@Override
public void validate() {
- super.validate();
+ if (targetInfo() != null) {
+ targetInfo().validate();
+ }
+ if (userAssignedManagedIdentityDetails() != null) {
+ userAssignedManagedIdentityDetails().validate();
+ }
+ if (snapshotRestoreParameters() != null) {
+ snapshotRestoreParameters().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(),
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString());
+ jsonWriter.writeStringField("sourceResourceId", sourceResourceId());
+ jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("targetInfo", targetInfo());
+ jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString());
+ jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName());
+ jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails());
+ jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters());
+ jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId());
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeStringField("pointInTime",
+ this.pointInTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.pointInTime));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadPointInTimeRestoreRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadPointInTimeRestoreRequest if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadPointInTimeRestoreRequest.
+ */
+ public static AzureWorkloadPointInTimeRestoreRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadPointInTimeRestoreRequest deserializedAzureWorkloadPointInTimeRestoreRequest
+ = new AzureWorkloadPointInTimeRestoreRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString());
+ deserializedAzureWorkloadPointInTimeRestoreRequest
+ .withResourceGuardOperationRequests(resourceGuardOperationRequests);
+ } else if ("recoveryType".equals(fieldName)) {
+ deserializedAzureWorkloadPointInTimeRestoreRequest
+ .withRecoveryType(RecoveryType.fromString(reader.getString()));
+ } else if ("sourceResourceId".equals(fieldName)) {
+ deserializedAzureWorkloadPointInTimeRestoreRequest.withSourceResourceId(reader.getString());
+ } else if ("propertyBag".equals(fieldName)) {
+ Map propertyBag = reader.readMap(reader1 -> reader1.getString());
+ deserializedAzureWorkloadPointInTimeRestoreRequest.withPropertyBag(propertyBag);
+ } else if ("targetInfo".equals(fieldName)) {
+ deserializedAzureWorkloadPointInTimeRestoreRequest
+ .withTargetInfo(TargetRestoreInfo.fromJson(reader));
+ } else if ("recoveryMode".equals(fieldName)) {
+ deserializedAzureWorkloadPointInTimeRestoreRequest
+ .withRecoveryMode(RecoveryMode.fromString(reader.getString()));
+ } else if ("targetResourceGroupName".equals(fieldName)) {
+ deserializedAzureWorkloadPointInTimeRestoreRequest.withTargetResourceGroupName(reader.getString());
+ } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) {
+ deserializedAzureWorkloadPointInTimeRestoreRequest
+ .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader));
+ } else if ("snapshotRestoreParameters".equals(fieldName)) {
+ deserializedAzureWorkloadPointInTimeRestoreRequest
+ .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader));
+ } else if ("targetVirtualMachineId".equals(fieldName)) {
+ deserializedAzureWorkloadPointInTimeRestoreRequest.withTargetVirtualMachineId(reader.getString());
+ } else if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadPointInTimeRestoreRequest.objectType = reader.getString();
+ } else if ("pointInTime".equals(fieldName)) {
+ deserializedAzureWorkloadPointInTimeRestoreRequest.pointInTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadPointInTimeRestoreRequest;
+ });
}
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java
index 9b98316fd70d3..62b93003d4d1a 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java
@@ -5,69 +5,50 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
/**
* Workload specific recovery point, specifically encapsulates full/diff recovery point.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "objectType",
- defaultImpl = AzureWorkloadRecoveryPoint.class,
- visible = true)
-@JsonTypeName("AzureWorkloadRecoveryPoint")
-@JsonSubTypes({
- @JsonSubTypes.Type(
- name = "AzureWorkloadPointInTimeRecoveryPoint",
- value = AzureWorkloadPointInTimeRecoveryPoint.class),
- @JsonSubTypes.Type(name = "AzureWorkloadSAPHanaRecoveryPoint", value = AzureWorkloadSapHanaRecoveryPoint.class),
- @JsonSubTypes.Type(name = "AzureWorkloadSQLRecoveryPoint", value = AzureWorkloadSqlRecoveryPoint.class) })
@Fluent
public class AzureWorkloadRecoveryPoint extends RecoveryPoint {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "objectType", required = true)
private String objectType = "AzureWorkloadRecoveryPoint";
/*
* UTC time at which recovery point was created
*/
- @JsonProperty(value = "recoveryPointTimeInUTC")
private OffsetDateTime recoveryPointTimeInUtc;
/*
* Type of restore point
*/
- @JsonProperty(value = "type")
private RestorePointType type;
/*
* Recovery point tier information.
*/
- @JsonProperty(value = "recoveryPointTierDetails")
private List recoveryPointTierDetails;
/*
* Eligibility of RP to be moved to another tier
*/
- @JsonProperty(value = "recoveryPointMoveReadinessInfo")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map recoveryPointMoveReadinessInfo;
/*
* Properties of Recovery Point
*/
- @JsonProperty(value = "recoveryPointProperties")
private RecoveryPointProperties recoveryPointProperties;
/**
@@ -196,7 +177,6 @@ public AzureWorkloadRecoveryPoint withRecoveryPointProperties(RecoveryPointPrope
*/
@Override
public void validate() {
- super.validate();
if (recoveryPointTierDetails() != null) {
recoveryPointTierDetails().forEach(e -> e.validate());
}
@@ -211,4 +191,112 @@ public void validate() {
recoveryPointProperties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeStringField("recoveryPointTimeInUTC",
+ this.recoveryPointTimeInUtc == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.recoveryPointTimeInUtc));
+ jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
+ jsonWriter.writeArrayField("recoveryPointTierDetails", this.recoveryPointTierDetails,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", this.recoveryPointMoveReadinessInfo,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeJsonField("recoveryPointProperties", this.recoveryPointProperties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadRecoveryPoint from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadRecoveryPoint if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadRecoveryPoint.
+ */
+ public static AzureWorkloadRecoveryPoint fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("objectType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("AzureWorkloadPointInTimeRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadPointInTimeRecoveryPoint.fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadSAPHanaPointInTimeRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadSapHanaPointInTimeRecoveryPoint.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadSAPAsePointInTimeRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadSapAsePointInTimeRecoveryPoint.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadOraclePointInTimeRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadOraclePointInTimeRecoveryPoint.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadAnyDatabasePointInTimeRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadAnyDatabasePointInTimeRecoveryPoint.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadSAPAseRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadSapAseRecoveryPoint.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadOracleRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadOracleRecoveryPoint.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadAnyDatabaseRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadAnyDatabaseRecoveryPoint.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadSAPHanaRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadSapHanaRecoveryPoint.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadSQLRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadSqlRecoveryPoint.fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadSQLPointInTimeRecoveryPoint".equals(discriminatorValue)) {
+ return AzureWorkloadSqlPointInTimeRecoveryPoint.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static AzureWorkloadRecoveryPoint fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadRecoveryPoint deserializedAzureWorkloadRecoveryPoint = new AzureWorkloadRecoveryPoint();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("objectType".equals(fieldName)) {
+ deserializedAzureWorkloadRecoveryPoint.objectType = reader.getString();
+ } else if ("recoveryPointTimeInUTC".equals(fieldName)) {
+ deserializedAzureWorkloadRecoveryPoint.recoveryPointTimeInUtc = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("type".equals(fieldName)) {
+ deserializedAzureWorkloadRecoveryPoint.type = RestorePointType.fromString(reader.getString());
+ } else if ("recoveryPointTierDetails".equals(fieldName)) {
+ List recoveryPointTierDetails
+ = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1));
+ deserializedAzureWorkloadRecoveryPoint.recoveryPointTierDetails = recoveryPointTierDetails;
+ } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) {
+ Map recoveryPointMoveReadinessInfo
+ = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1));
+ deserializedAzureWorkloadRecoveryPoint.recoveryPointMoveReadinessInfo
+ = recoveryPointMoveReadinessInfo;
+ } else if ("recoveryPointProperties".equals(fieldName)) {
+ deserializedAzureWorkloadRecoveryPoint.recoveryPointProperties
+ = RecoveryPointProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAzureWorkloadRecoveryPoint;
+ });
+ }
}
diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java
index c81dbbc3ffa2c..26b9bfb27ba3b 100644
--- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java
+++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java
@@ -5,95 +5,70 @@
package com.azure.resourcemanager.recoveryservicesbackup.models;
import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeId;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* AzureWorkload-specific restore.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- property = "objectType",
- defaultImpl = AzureWorkloadRestoreRequest.class,
- visible = true)
-@JsonTypeName("AzureWorkloadRestoreRequest")
-@JsonSubTypes({
- @JsonSubTypes.Type(
- name = "AzureWorkloadPointInTimeRestoreRequest",
- value = AzureWorkloadPointInTimeRestoreRequest.class),
- @JsonSubTypes.Type(name = "AzureWorkloadSAPHanaRestoreRequest", value = AzureWorkloadSapHanaRestoreRequest.class),
- @JsonSubTypes.Type(name = "AzureWorkloadSQLRestoreRequest", value = AzureWorkloadSqlRestoreRequest.class) })
@Fluent
public class AzureWorkloadRestoreRequest extends RestoreRequest {
/*
- * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.
+ * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of
+ * types.
*/
- @JsonTypeId
- @JsonProperty(value = "objectType", required = true)
private String objectType = "AzureWorkloadRestoreRequest";
/*
* Type of this recovery.
*/
- @JsonProperty(value = "recoveryType")
private RecoveryType recoveryType;
/*
* Fully qualified ARM ID of the VM on which workload that was running is being recovered.
*/
- @JsonProperty(value = "sourceResourceId")
private String sourceResourceId;
/*
* Workload specific property bag.
*/
- @JsonProperty(value = "propertyBag")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map propertyBag;
/*
* Details of target database
*/
- @JsonProperty(value = "targetInfo")
private TargetRestoreInfo targetInfo;
/*
* Defines whether the current recovery mode is file restore or database restore
*/
- @JsonProperty(value = "recoveryMode")
private RecoveryMode recoveryMode;
/*
* Defines the Resource group of the Target VM
*/
- @JsonProperty(value = "targetResourceGroupName")
private String targetResourceGroupName;
/*
* User Assigned managed identity details
* Currently used for snapshot.
*/
- @JsonProperty(value = "userAssignedManagedIdentityDetails")
private UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails;
/*
* Additional details for snapshot recovery
* Currently used for snapshot for SAP Hana.
*/
- @JsonProperty(value = "snapshotRestoreParameters")
private SnapshotRestoreParameters snapshotRestoreParameters;
/*
* This is the complete ARM Id of the target VM
* For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}
*/
- @JsonProperty(value = "targetVirtualMachineId")
private String targetVirtualMachineId;
/**
@@ -319,7 +294,6 @@ public AzureWorkloadRestoreRequest withResourceGuardOperationRequests(List writer.writeString(element));
+ jsonWriter.writeStringField("objectType", this.objectType);
+ jsonWriter.writeStringField("recoveryType", this.recoveryType == null ? null : this.recoveryType.toString());
+ jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId);
+ jsonWriter.writeMapField("propertyBag", this.propertyBag, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("targetInfo", this.targetInfo);
+ jsonWriter.writeStringField("recoveryMode", this.recoveryMode == null ? null : this.recoveryMode.toString());
+ jsonWriter.writeStringField("targetResourceGroupName", this.targetResourceGroupName);
+ jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", this.userAssignedManagedIdentityDetails);
+ jsonWriter.writeJsonField("snapshotRestoreParameters", this.snapshotRestoreParameters);
+ jsonWriter.writeStringField("targetVirtualMachineId", this.targetVirtualMachineId);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AzureWorkloadRestoreRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AzureWorkloadRestoreRequest if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AzureWorkloadRestoreRequest.
+ */
+ public static AzureWorkloadRestoreRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("objectType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("AzureWorkloadPointInTimeRestoreRequest".equals(discriminatorValue)) {
+ return AzureWorkloadPointInTimeRestoreRequest.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadSAPHanaRestoreRequest".equals(discriminatorValue)) {
+ return AzureWorkloadSapHanaRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadSAPHanaPointInTimeRestoreRequest".equals(discriminatorValue)) {
+ return AzureWorkloadSapHanaPointInTimeRestoreRequest
+ .fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) {
+ return AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadSAPHanaRestoreWithRehydrateRequest".equals(discriminatorValue)) {
+ return AzureWorkloadSapHanaRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadSAPAseRestoreRequest".equals(discriminatorValue)) {
+ return AzureWorkloadSapAseRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadSAPAsePointInTimeRestoreRequest".equals(discriminatorValue)) {
+ return AzureWorkloadSapAsePointInTimeRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadSAPAsePointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) {
+ return AzureWorkloadSapAsePointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadSAPAseRestoreWithRehydrateRequest".equals(discriminatorValue)) {
+ return AzureWorkloadSapAseRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadOracleRestoreRequest".equals(discriminatorValue)) {
+ return AzureWorkloadOracleRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadOraclePointInTimeRestoreRequest".equals(discriminatorValue)) {
+ return AzureWorkloadOraclePointInTimeRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) {
+ return AzureWorkloadOraclePointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadOracleRestoreWithRehydrateRequest".equals(discriminatorValue)) {
+ return AzureWorkloadOracleRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadAnyDatabaseRestoreRequest".equals(discriminatorValue)) {
+ return AzureWorkloadAnyDatabaseRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadAnyDatabasePointInTimeRestoreRequest".equals(discriminatorValue)) {
+ return AzureWorkloadAnyDatabasePointInTimeRestoreRequest
+ .fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest"
+ .equals(discriminatorValue)) {
+ return AzureWorkloadAnyDatabasePointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest".equals(discriminatorValue)) {
+ return AzureWorkloadAnyDatabaseRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadSQLRestoreRequest".equals(discriminatorValue)) {
+ return AzureWorkloadSqlRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadSQLPointInTimeRestoreRequest".equals(discriminatorValue)) {
+ return AzureWorkloadSqlPointInTimeRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) {
+ return AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else if ("AzureWorkloadSQLRestoreWithRehydrateRequest".equals(discriminatorValue)) {
+ return AzureWorkloadSqlRestoreWithRehydrateRequest.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static AzureWorkloadRestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AzureWorkloadRestoreRequest deserializedAzureWorkloadRestoreRequest = new AzureWorkloadRestoreRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("resourceGuardOperationRequests".equals(fieldName)) {
+ List