From cb48a4ee583aca390a04bc2f2c8c8313a19befcb Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 22 Jul 2026 10:51:53 +0000 Subject: [PATCH] Configurations: 'specification/recoveryservicesbackupcrr/resource-manager/Microsoft.RecoveryServices/RecoveryServicesBackupCrr/tspconfig.yaml', and CommitSHA: 'e2b167bfbb5cb118d84bdc44774324c5bd52620d' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6601119 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 8 + .../README.md | 102 +++ .../SAMPLE.md | 372 ++++++++ .../pom.xml | 74 ++ .../RecoveryServicesBackupCrrManager.java | 448 ++++++++++ .../fluent/AadPropertiesOperationsClient.java | 48 ++ .../fluent/BackupCrrJobDetailsClient.java | 44 + .../fluent/BackupCrrJobsClient.java | 47 + .../BackupProtectedItemsCrrsClient.java | 46 + .../BackupResourceStorageConfigsClient.java | 104 +++ .../BackupUsageSummariesCRRsClient.java | 46 + .../fluent/CrossRegionRestoresClient.java | 42 + .../fluent/CrrOperationResultsClient.java | 41 + .../fluent/CrrOperationStatusClient.java | 43 + .../fluent/RecoveryPointsClient.java | 61 ++ .../fluent/RecoveryPointsCrrsClient.java | 90 ++ ...veryServicesBackupCrrManagementClient.java | 125 +++ .../models/AADPropertiesResourceInner.java | 192 +++++ .../BackupManagementUsageListInner.java | 79 ++ .../BackupResourceConfigResourceInner.java | 242 ++++++ .../models/CrrAccessTokenResourceInner.java | 152 ++++ .../fluent/models/JobResourceInner.java | 152 ++++ .../fluent/models/JobResourceListInner.java | 95 +++ .../fluent/models/OperationStatusInner.java | 186 ++++ .../ProtectedItemResourceListInner.java | 98 +++ .../models/RecoveryPointResourceInner.java | 197 +++++ .../fluent/models/package-info.java | 9 + .../fluent/package-info.java | 9 + .../AADPropertiesResourceImpl.java | 65 ++ .../AadPropertiesOperationsClientImpl.java | 157 ++++ .../AadPropertiesOperationsImpl.java | 52 ++ .../BackupCrrJobDetailsClientImpl.java | 148 ++++ .../BackupCrrJobDetailsImpl.java | 53 ++ .../BackupCrrJobsClientImpl.java | 162 ++++ .../implementation/BackupCrrJobsImpl.java | 55 ++ .../BackupManagementUsageListImpl.java | 41 + .../BackupProtectedItemsCrrsClientImpl.java | 158 ++++ .../BackupProtectedItemsCrrsImpl.java | 54 ++ .../BackupResourceConfigResourceImpl.java | 70 ++ ...ackupResourceStorageConfigsClientImpl.java | 338 ++++++++ .../BackupResourceStorageConfigsImpl.java | 81 ++ .../BackupUsageSummariesCRRsClientImpl.java | 158 ++++ .../BackupUsageSummariesCRRsImpl.java | 54 ++ .../CrossRegionRestoresClientImpl.java | 146 ++++ .../CrossRegionRestoresImpl.java | 44 + .../CrrAccessTokenResourceImpl.java | 65 ++ .../CrrOperationResultsClientImpl.java | 138 +++ .../CrrOperationResultsImpl.java | 42 + .../CrrOperationStatusClientImpl.java | 145 ++++ .../CrrOperationStatusImpl.java | 52 ++ .../implementation/JobResourceImpl.java | 65 ++ .../implementation/JobResourceListImpl.java | 48 ++ .../implementation/OperationStatusImpl.java | 61 ++ .../ProtectedItemResourceListImpl.java | 45 + .../RecoveryPointResourceImpl.java | 70 ++ .../RecoveryPointsClientImpl.java | 191 +++++ .../RecoveryPointsCrrsClientImpl.java | 366 ++++++++ .../RecoveryPointsCrrsImpl.java | 72 ++ .../implementation/RecoveryPointsImpl.java | 60 ++ ...vicesBackupCrrManagementClientBuilder.java | 139 +++ ...ServicesBackupCrrManagementClientImpl.java | 468 ++++++++++ .../implementation/ResourceManagerUtils.java | 195 +++++ .../models/RecoveryPointResourceList.java | 97 +++ .../implementation/package-info.java | 9 + .../models/AADProperties.java | 197 +++++ .../models/AADPropertiesResource.java | 71 ++ .../models/AadPropertiesOperations.java | 43 + .../models/ArmResource.java | 174 ++++ .../models/AzureFileShareRecoveryPoint.java | 163 ++++ .../models/AzureFileShareRestoreRequest.java | 252 ++++++ .../models/AzureFileshareProtectedItem.java | 278 ++++++ ...ureFileshareProtectedItemExtendedInfo.java | 153 ++++ ...zureIaaSClassicComputeVMProtectedItem.java | 184 ++++ .../AzureIaaSComputeVMProtectedItem.java | 183 ++++ .../models/AzureIaaSVMErrorInfo.java | 123 +++ .../models/AzureIaaSVMHealthDetails.java | 126 +++ .../models/AzureIaaSVMJob.java | 199 +++++ .../models/AzureIaaSVMJobExtendedInfo.java | 167 ++++ .../models/AzureIaaSVMJobTaskDetails.java | 207 +++++ .../models/AzureIaaSVMProtectedItem.java | 507 +++++++++++ .../AzureIaaSVMProtectedItemExtendedInfo.java | 119 +++ .../models/AzureSqlProtectedItem.java | 186 ++++ .../AzureSqlProtectedItemExtendedInfo.java | 117 +++ .../models/AzureStorageErrorInfo.java | 111 +++ .../models/AzureStorageJob.java | 216 +++++ .../models/AzureStorageJobExtendedInfo.java | 113 +++ .../models/AzureStorageJobTaskDetails.java | 91 ++ .../models/AzureVmWorkloadProtectedItem.java | 542 ++++++++++++ ...reVmWorkloadProtectedItemExtendedInfo.java | 118 +++ ...VmWorkloadSAPAseDatabaseProtectedItem.java | 189 +++++ ...mWorkloadSAPHanaDatabaseProtectedItem.java | 189 +++++ ...ureVmWorkloadSQLDatabaseProtectedItem.java | 189 +++++ .../models/AzureWorkloadErrorInfo.java | 145 ++++ .../models/AzureWorkloadJob.java | 198 +++++ .../models/AzureWorkloadJobExtendedInfo.java | 113 +++ .../models/AzureWorkloadJobTaskDetails.java | 91 ++ ...AzureWorkloadPointInTimeRecoveryPoint.java | 158 ++++ ...zureWorkloadPointInTimeRestoreRequest.java | 187 ++++ .../models/AzureWorkloadRecoveryPoint.java | 262 ++++++ .../models/AzureWorkloadRestoreRequest.java | 284 +++++++ ...rkloadSAPHanaPointInTimeRecoveryPoint.java | 108 +++ ...kloadSAPHanaPointInTimeRestoreRequest.java | 188 ++++ .../AzureWorkloadSAPHanaRecoveryPoint.java | 104 +++ .../AzureWorkloadSAPHanaRestoreRequest.java | 178 ++++ ...reWorkloadSQLPointInTimeRecoveryPoint.java | 126 +++ ...eWorkloadSQLPointInTimeRestoreRequest.java | 233 +++++ .../models/AzureWorkloadSQLRecoveryPoint.java | 164 ++++ ...eWorkloadSQLRecoveryPointExtendedInfo.java | 97 +++ .../AzureWorkloadSQLRestoreRequest.java | 274 ++++++ .../models/BEKDetails.java | 108 +++ .../models/BackupCrrJobDetails.java | 38 + .../models/BackupCrrJobs.java | 41 + .../models/BackupManagementType.java | 86 ++ .../models/BackupManagementUsage.java | 164 ++++ .../models/BackupManagementUsageList.java | 29 + .../models/BackupProtectedItemsCrrs.java | 41 + .../models/BackupResourceConfig.java | 174 ++++ .../models/BackupResourceConfigResource.java | 79 ++ .../models/BackupResourceStorageConfigs.java | 95 +++ .../models/BackupUsageSummariesCRRs.java | 41 + .../models/ClientScriptForConnect.java | 147 ++++ .../models/CopyOptions.java | 66 ++ .../models/CreateMode.java | 56 ++ .../models/CrossRegionRestoreRequest.java | 115 +++ .../models/CrossRegionRestores.java | 37 + .../models/CrrAccessToken.java | 802 ++++++++++++++++++ .../models/CrrAccessTokenResource.java | 71 ++ .../models/CrrJobRequest.java | 113 +++ .../models/CrrOperationResults.java | 37 + .../models/CrrOperationStatus.java | 38 + .../models/DPMProtectedItem.java | 200 +++++ .../models/DPMProtectedItemExtendedInfo.java | 319 +++++++ .../models/DataSourceType.java | 116 +++ .../models/DiskExclusionProperties.java | 93 ++ .../models/DiskInformation.java | 91 ++ .../models/DpmErrorInfo.java | 94 ++ .../models/DpmJob.java | 247 ++++++ .../models/DpmJobExtendedInfo.java | 113 +++ .../models/DpmJobTaskDetails.java | 151 ++++ .../models/EncryptionDetails.java | 199 +++++ .../models/ErrorDetail.java | 107 +++ .../models/ExtendedProperties.java | 74 ++ .../models/GenericProtectedItem.java | 238 ++++++ .../models/GenericRecoveryPoint.java | 168 ++++ .../models/HealthStatus.java | 61 ++ .../models/IaasVMRecoveryPoint.java | 360 ++++++++ .../models/IaasVMRestoreRequest.java | 688 +++++++++++++++ .../models/IdentityBasedRestoreDetails.java | 113 +++ .../models/IdentityInfo.java | 118 +++ .../models/InstantItemRecoveryTarget.java | 77 ++ .../models/Job.java | 313 +++++++ .../models/JobResource.java | 70 ++ .../models/JobResourceList.java | 36 + .../models/JobSupportedAction.java | 61 ++ .../models/KEKDetails.java | 108 +++ .../models/KPIResourceHealthDetails.java | 97 +++ .../models/KeyAndSecretDetails.java | 114 +++ .../models/LastBackupStatus.java | 61 ++ .../models/MabErrorInfo.java | 91 ++ .../models/MabFileFolderProtectedItem.java | 257 ++++++ ...abFileFolderProtectedItemExtendedInfo.java | 120 +++ .../models/MabJob.java | 230 +++++ .../models/MabJobExtendedInfo.java | 113 +++ .../models/MabJobTaskDetails.java | 151 ++++ .../models/MabServerType.java | 116 +++ .../models/NameInfo.java | 91 ++ .../models/OperationStatus.java | 70 ++ .../models/OperationStatusError.java | 91 ++ .../models/OperationStatusExtendedInfo.java | 107 +++ .../OperationStatusJobExtendedInfo.java | 94 ++ .../OperationStatusJobsExtendedInfo.java | 116 +++ ...erationStatusProvisionILRExtendedInfo.java | 95 +++ ...rationStatusRecoveryPointExtendedInfo.java | 113 +++ .../models/OperationStatusValues.java | 66 ++ .../models/OverwriteOptions.java | 56 ++ .../models/PointInTimeRange.java | 98 +++ .../models/ProtectedItem.java | 540 ++++++++++++ .../models/ProtectedItemHealthStatus.java | 66 ++ .../models/ProtectedItemResource.java | 151 ++++ .../models/ProtectedItemResourceList.java | 37 + .../models/ProtectedItemState.java | 71 ++ .../models/ProtectionState.java | 71 ++ .../models/RecoveryMode.java | 56 ++ .../models/RecoveryPoint.java | 117 +++ .../RecoveryPointDiskConfiguration.java | 135 +++ .../RecoveryPointMoveReadinessInfo.java | 93 ++ .../models/RecoveryPointProperties.java | 108 +++ .../models/RecoveryPointResource.java | 79 ++ .../models/RecoveryPointTierInformation.java | 112 +++ .../models/RecoveryPointTierStatus.java | 71 ++ .../models/RecoveryPointTierType.java | 66 ++ .../models/RecoveryPoints.java | 56 ++ .../models/RecoveryPointsCrrs.java | 83 ++ .../models/RecoveryType.java | 66 ++ .../models/ResourceHealthDetails.java | 167 ++++ .../models/ResourceHealthStatus.java | 71 ++ .../models/ResourceList.java | 87 ++ .../models/RestoreFileSpecs.java | 141 +++ .../models/RestorePointType.java | 66 ++ .../models/RestoreRequest.java | 115 +++ .../models/RestoreRequestType.java | 56 ++ .../models/SQLDataDirectory.java | 108 +++ .../models/SQLDataDirectoryMapping.java | 170 ++++ .../models/SQLDataDirectoryType.java | 56 ++ .../models/StorageType.java | 66 ++ .../models/StorageTypeState.java | 56 ++ .../models/TargetAFSRestoreInfo.java | 113 +++ .../models/TargetRestoreInfo.java | 170 ++++ .../models/UsagesUnit.java | 71 ++ .../models/WorkloadCrrAccessToken.java | 637 ++++++++++++++ .../models/WorkloadType.java | 116 +++ .../models/package-info.java | 9 + .../package-info.java | 9 + .../src/main/java/module-info.java | 16 + ...icesbackupcrossregionrestore_metadata.json | 1 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + ...ervicesbackupcrossregionrestore.properties | 1 + .../generated/AadPropeSamples.java | 23 + .../generated/BackupCrSamples.java | 28 + .../generated/BackupPrSamples.java | 25 + .../generated/BackupReSamples.java | 24 + .../generated/BackupUsSamples.java | 40 + .../generated/CrossRegSamples.java | 133 +++ .../generated/CrrOperaSamples.java | 24 + .../generated/RecoverySamples.java | 34 + .../generated/AADPropertiesTests.java | 63 ++ .../generated/AadProperMockTests.java | 46 + .../generated/ArmResourceTests.java | 22 + .../generated/AzureFileSharTests.java | 21 + .../generated/AzureFilesharTests.java | 22 + .../generated/AzureIaaSVMJoTests.java | 33 + .../generated/AzureIaaSVMPrTests.java | 22 + .../generated/AzureSqlProteTests.java | 43 + .../generated/AzureStorageJTests.java | 22 + .../generated/AzureVmWorkloTests.java | 22 + .../generated/AzureWorkloadTests.java | 32 + .../generated/BackupCrrMockTests.java | 51 ++ .../generated/BackupManagemTests.java | 27 + .../generated/BackupProMockTests.java | 63 ++ .../generated/BackupResMockTests.java | 47 + .../generated/BackupResourcTests.java | 62 ++ .../generated/BackupUsaMockTests.java | 46 + .../generated/ClientScriptFTests.java | 23 + .../generated/CrrJobRequestTests.java | 27 + .../generated/CrrOperatMockTests.java | 33 + .../generated/DPMProtectedITests.java | 57 ++ .../generated/DiskExclusionTests.java | 20 + .../generated/DiskInformatiTests.java | 19 + .../generated/DpmErrorInfoTests.java | 21 + .../generated/DpmJobExtendeTests.java | 27 + .../generated/DpmJobTaskDetTests.java | 25 + .../generated/DpmJobTests.java | 46 + .../generated/ExtendedPropeTests.java | 20 + .../generated/GenericProtecTests.java | 43 + .../generated/GenericRecoveTests.java | 26 + .../generated/IdentityBasedTests.java | 29 + .../generated/IdentityInfoTests.java | 29 + .../generated/InstantItemReTests.java | 23 + .../generated/JobResourceInTests.java | 30 + .../generated/JobResourceLiTests.java | 33 + .../generated/JobTests.java | 27 + .../generated/MabErrorInfoTests.java | 18 + .../generated/MabFileFolderTests.java | 46 + .../generated/MabJobExtendeTests.java | 27 + .../generated/MabJobTaskDetTests.java | 25 + .../generated/MabJobTests.java | 45 + .../generated/NameInfoTests.java | 19 + .../generated/OperationStatTests.java | 16 + .../generated/PointInTimeRaTests.java | 21 + .../generated/ProtectedItemTests.java | 43 + .../generated/RecoveryPMockTests.java | 42 + .../generated/RecoveryPointTests.java | 21 + .../generated/ResourceListTests.java | 17 + .../generated/RestoreFileSpTests.java | 32 + .../generated/RestoreRequesTests.java | 22 + .../generated/SQLDataDirectTests.java | 22 + .../generated/TargetAFSRestTests.java | 27 + .../generated/TargetRestoreTests.java | 36 + .../tsp-location.yaml | 4 + .../ci.yml | 46 + .../pom.xml | 15 + 284 files changed, 30734 insertions(+) create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/CHANGELOG.md create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/README.md create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/SAMPLE.md create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/pom.xml create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/RecoveryServicesBackupCrrManager.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/AadPropertiesOperationsClient.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupCrrJobDetailsClient.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupCrrJobsClient.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupProtectedItemsCrrsClient.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupResourceStorageConfigsClient.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupUsageSummariesCRRsClient.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrossRegionRestoresClient.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrrOperationResultsClient.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrrOperationStatusClient.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryPointsClient.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryPointsCrrsClient.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryServicesBackupCrrManagementClient.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/AADPropertiesResourceInner.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/BackupManagementUsageListInner.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/BackupResourceConfigResourceInner.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/CrrAccessTokenResourceInner.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/JobResourceInner.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/JobResourceListInner.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/OperationStatusInner.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/ProtectedItemResourceListInner.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/RecoveryPointResourceInner.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/package-info.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/package-info.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AADPropertiesResourceImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AadPropertiesOperationsClientImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AadPropertiesOperationsImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobDetailsClientImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobDetailsImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobsClientImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobsImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupManagementUsageListImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupProtectedItemsCrrsClientImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupProtectedItemsCrrsImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceConfigResourceImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceStorageConfigsClientImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceStorageConfigsImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupUsageSummariesCRRsClientImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupUsageSummariesCRRsImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrossRegionRestoresClientImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrossRegionRestoresImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrAccessTokenResourceImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationResultsClientImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationResultsImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationStatusClientImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationStatusImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/JobResourceImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/JobResourceListImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/OperationStatusImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/ProtectedItemResourceListImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointResourceImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsClientImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsCrrsClientImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsCrrsImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryServicesBackupCrrManagementClientBuilder.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryServicesBackupCrrManagementClientImpl.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/ResourceManagerUtils.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/models/RecoveryPointResourceList.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/package-info.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AADProperties.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AADPropertiesResource.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AadPropertiesOperations.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ArmResource.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileShareRecoveryPoint.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileShareRestoreRequest.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileshareProtectedItem.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileshareProtectedItemExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSClassicComputeVMProtectedItem.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSComputeVMProtectedItem.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMErrorInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMHealthDetails.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJob.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJobExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJobTaskDetails.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMProtectedItem.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMProtectedItemExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureSqlProtectedItem.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureSqlProtectedItemExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageErrorInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJob.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJobExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJobTaskDetails.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadProtectedItem.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadProtectedItemExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSAPAseDatabaseProtectedItem.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSQLDatabaseProtectedItem.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadErrorInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJob.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJobExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJobTaskDetails.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadPointInTimeRecoveryPoint.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadPointInTimeRestoreRequest.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadRecoveryPoint.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadRestoreRequest.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaPointInTimeRestoreRequest.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaRecoveryPoint.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaRestoreRequest.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLPointInTimeRecoveryPoint.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLPointInTimeRestoreRequest.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRecoveryPoint.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRecoveryPointExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRestoreRequest.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BEKDetails.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupCrrJobDetails.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupCrrJobs.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementType.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementUsage.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementUsageList.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupProtectedItemsCrrs.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceConfig.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceConfigResource.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceStorageConfigs.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupUsageSummariesCRRs.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ClientScriptForConnect.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CopyOptions.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CreateMode.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrossRegionRestoreRequest.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrossRegionRestores.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrAccessToken.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrAccessTokenResource.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrJobRequest.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrOperationResults.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrOperationStatus.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DPMProtectedItem.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DPMProtectedItemExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DataSourceType.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DiskExclusionProperties.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DiskInformation.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmErrorInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJob.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJobExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJobTaskDetails.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/EncryptionDetails.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ErrorDetail.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ExtendedProperties.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/GenericProtectedItem.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/GenericRecoveryPoint.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/HealthStatus.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IaasVMRecoveryPoint.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IaasVMRestoreRequest.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IdentityBasedRestoreDetails.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IdentityInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/InstantItemRecoveryTarget.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/Job.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobResource.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobResourceList.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobSupportedAction.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KEKDetails.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KPIResourceHealthDetails.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KeyAndSecretDetails.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/LastBackupStatus.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabErrorInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabFileFolderProtectedItem.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabFileFolderProtectedItemExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJob.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJobExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJobTaskDetails.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabServerType.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/NameInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatus.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusError.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusJobExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusJobsExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusProvisionILRExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusRecoveryPointExtendedInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusValues.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OverwriteOptions.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/PointInTimeRange.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItem.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemHealthStatus.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemResource.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemResourceList.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemState.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectionState.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryMode.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPoint.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointDiskConfiguration.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointMoveReadinessInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointProperties.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointResource.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierInformation.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierStatus.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierType.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPoints.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointsCrrs.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryType.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceHealthDetails.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceHealthStatus.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceList.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreFileSpecs.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestorePointType.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreRequest.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreRequestType.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectory.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectoryMapping.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectoryType.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/StorageType.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/StorageTypeState.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/TargetAFSRestoreInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/TargetRestoreInfo.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/UsagesUnit.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/WorkloadCrrAccessToken.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/WorkloadType.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/package-info.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/package-info.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/module-info.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/META-INF/azure-resourcemanager-recoveryservicesbackupcrossregionrestore_metadata.json create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/META-INF/native-image/com.azure.resourcemanager/recoveryservicesbackupcrossregionrestore/proxy-config.json create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/META-INF/native-image/com.azure.resourcemanager/recoveryservicesbackupcrossregionrestore/reflect-config.json create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/azure-resourcemanager-recoveryservicesbackupcrossregionrestore.properties create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AadPropeSamples.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupCrSamples.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupPrSamples.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupReSamples.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupUsSamples.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrossRegSamples.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrrOperaSamples.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RecoverySamples.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AADPropertiesTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AadProperMockTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ArmResourceTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureFileSharTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureFilesharTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureIaaSVMJoTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureIaaSVMPrTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureSqlProteTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureStorageJTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureVmWorkloTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureWorkloadTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupCrrMockTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupManagemTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupProMockTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupResMockTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupResourcTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupUsaMockTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ClientScriptFTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrrJobRequestTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrrOperatMockTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DPMProtectedITests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DiskExclusionTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DiskInformatiTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmErrorInfoTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmJobExtendeTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmJobTaskDetTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmJobTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ExtendedPropeTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/GenericProtecTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/GenericRecoveTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/IdentityBasedTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/IdentityInfoTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/InstantItemReTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/JobResourceInTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/JobResourceLiTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/JobTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabErrorInfoTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabFileFolderTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabJobExtendeTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabJobTaskDetTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabJobTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/NameInfoTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/OperationStatTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/PointInTimeRaTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ProtectedItemTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RecoveryPMockTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RecoveryPointTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ResourceListTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RestoreFileSpTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RestoreRequesTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/SQLDataDirectTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/TargetAFSRestTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/TargetRestoreTests.java create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/tsp-location.yaml create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/ci.yml create mode 100644 sdk/recoveryservicesbackupcrossregionrestore/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 48647dcf3338..bfc25e534fd6 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -538,6 +538,7 @@ com.azure.resourcemanager:azure-resourcemanager-commvaultcontentstore;1.0.0-beta com.azure.resourcemanager:azure-resourcemanager-billing-trust;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-containerservicepreparedimgspec;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-enclave;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-recoveryservicesbackupcrossregionrestore;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.2;2.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 19f9517ddf8d..55351f858b95 100644 --- a/pom.xml +++ b/pom.xml @@ -223,6 +223,7 @@ sdk/quota sdk/recoveryservices sdk/recoveryservicesbackup + sdk/recoveryservicesbackupcrossregionrestore sdk/recoveryservicesdatareplication sdk/recoveryservicessiterecovery sdk/redhatopenshift diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/CHANGELOG.md b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/CHANGELOG.md new file mode 100644 index 000000000000..d85b771c7cde --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2026-07-22) + +- Azure Resource Manager Recovery Services Backup Crr client library for Java. This package contains Microsoft Azure SDK for Recovery Services Backup Crr Management SDK. Open API 2.0 Specs for Azure Recovery Services Backup CRR (Cross Region Restore) service. Package api-version 2026-07-15. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-recoveryservicesbackupcrossregionrestore Java SDK. diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/README.md b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/README.md new file mode 100644 index 000000000000..3df4917700d5 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Recovery Services Backup Crr client library for Java + +Azure Resource Manager Recovery Services Backup Crr client library for Java. + +This package contains Microsoft Azure SDK for Recovery Services Backup Crr Management SDK. Open API 2.0 Specs for Azure Recovery Services Backup CRR (Cross Region Restore) service. Package api-version 2026-07-15. 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 + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-recoveryservicesbackupcrossregionrestore;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-recoveryservicesbackupcrossregionrestore + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +RecoveryServicesBackupCrrManager manager = RecoveryServicesBackupCrrManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[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 +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/SAMPLE.md b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/SAMPLE.md new file mode 100644 index 000000000000..c31e0d8120cc --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/SAMPLE.md @@ -0,0 +1,372 @@ +# Code snippets and samples + + +## AadPropertiesOperation + +- [Get](#aadpropertiesoperation_get) + +## BackupCrrJobDetails + +- [Get](#backupcrrjobdetails_get) + +## BackupCrrJobs + +- [List](#backupcrrjobs_list) + +## BackupProtectedItemsCrr + +- [List](#backupprotecteditemscrr_list) + +## BackupResourceStorageConfigs + +- [Get](#backupresourcestorageconfigs_get) +- [Patch](#backupresourcestorageconfigs_patch) +- [Update](#backupresourcestorageconfigs_update) + +## BackupUsageSummariesCRR + +- [List](#backupusagesummariescrr_list) + +## CrossRegionRestore + +- [Trigger](#crossregionrestore_trigger) + +## CrrOperationResults + +- [Get](#crroperationresults_get) + +## CrrOperationStatus + +- [Get](#crroperationstatus_get) + +## RecoveryPoints + +- [GetAccessToken](#recoverypoints_getaccesstoken) + +## RecoveryPointsCrr + +- [Get](#recoverypointscrr_get) +- [List](#recoverypointscrr_list) +### AadPropertiesOperation_Get + +```java +/** + * Samples for AadPropertiesOperation Get. + */ +public final class AadPropeSamples { + /* + * x-ms-original-file: 2026-07-15/AzureIaasVm/BackupAadProperties_Get.json + */ + /** + * Sample code: Get AAD Properties for authentication in the third region. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void getAADPropertiesForAuthenticationInTheThirdRegion( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.aadPropertiesOperations().getWithResponse("southeastasia", null, com.azure.core.util.Context.NONE); + } +} +``` + +### BackupCrrJobDetails_Get + +```java +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrJobRequest; + +/** + * Samples for BackupCrrJobDetails Get. + */ +public final class BackupCrSamples { + /* + * x-ms-original-file: 2026-07-15/AzureIaasVm/GetCrrJob_Post.json + */ + /** + * Sample code: Get Cross Region Restore Job Details in the secondary region. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void getCrossRegionRestoreJobDetailsInTheSecondaryRegion( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.backupCrrJobDetails() + .getWithResponse("southeastasia", new CrrJobRequest().withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Compute/VirtualMachines/testVm") + .withJobName("02585cc9-d7f4-4b46-860c-14c048cce178"), com.azure.core.util.Context.NONE); + } +} +``` + +### BackupCrrJobs_List + +```java +/** + * Samples for BackupProtectedItemsCrr List. + */ +public final class BackupPrSamples { + /* + * x-ms-original-file: 2026-07-15/AzureIaasVm/BackupProtectedItems_List.json + */ + /** + * Sample code: List protected items with backupManagementType filter as AzureIaasVm. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void listProtectedItemsWithBackupManagementTypeFilterAsAzureIaasVm( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.backupProtectedItemsCrrs() + .listWithResponse("SwaggerTestRg", "NetSDKTestRsVault", + "backupManagementType eq 'AzureIaasVM' and itemType eq 'VM'", null, com.azure.core.util.Context.NONE); + } +} +``` + +### BackupProtectedItemsCrr_List + +```java +/** + * Samples for BackupResourceStorageConfigs Get. + */ +public final class BackupReSamples { + /* + * x-ms-original-file: 2026-07-15/Common/BackupStorageConfig_Get.json + */ + /** + * Sample code: Get Vault Storage Configuration. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void getVaultStorageConfiguration( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.backupResourceStorageConfigs() + .getWithResponse("PythonSDKBackupTestRg", "PySDKBackupTestRsVault", com.azure.core.util.Context.NONE); + } +} +``` + +### BackupResourceStorageConfigs_Get + +```java +/** + * Samples for BackupUsageSummariesCRR List. + */ +public final class BackupUsSamples { + /* + * x-ms-original-file: 2026-07-15/Common/BackupProtectedItem_UsageSummary_Get.json + */ + /** + * Sample code: Get Protected Items Usages Summary. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void getProtectedItemsUsagesSummary( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.backupUsageSummariesCRRs() + .listWithResponse("testRG", "testVault", "type eq 'BackupProtectedItemCountSummary'", null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-15/Common/BackupProtectionContainers_UsageSummary_Get.json + */ + /** + * Sample code: Get Protected Containers Usages Summary. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void getProtectedContainersUsagesSummary( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.backupUsageSummariesCRRs() + .listWithResponse("testRG", "testVault", "type eq 'BackupProtectionContainerCountSummary'", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### BackupResourceStorageConfigs_Patch + +```java +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrossRegionRestoreRequest; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.EncryptionDetails; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.IaasVMRestoreRequest; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.IdentityBasedRestoreDetails; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.IdentityInfo; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.WorkloadCrrAccessToken; +import java.util.Arrays; + +/** + * Samples for CrossRegionRestore Trigger. + */ +public final class CrossRegSamples { + /* + * x-ms-original-file: 2026-07-15/AzureIaasVm/TriggerCrossRegionRestore_Post.json + */ + /** + * Sample code: Trigger Cross Region Restore. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void triggerCrossRegionRestore( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.crossRegionRestores() + .triggerWithResponse("southeastasia", new CrossRegionRestoreRequest() + .withCrossRegionRestoreAccessDetails( + new WorkloadCrrAccessToken().withAccessTokenString("fakeTokenPlaceholder") + .withSubscriptionId("f2edfd5d-5496-4683-b94f-b3588c579009") + .withResourceGroupName("srinivasccyrg") + .withResourceName("sriniccyvault") + .withResourceId("1330837906418138160") + .withRecoveryPointId("87178355392716") + .withRecoveryPointTime("10/9/2019 6:05:54 PM") + .withContainerName("iaasvmcontainerv2;srinivasccyrg;sriniccylinux") + .withContainerType("IaasVMContainer") + .withBackupManagementType("AzureIaasVM") + .withDatasourceType("VM") + .withDatasourceName("sriniccylinux") + .withDatasourceId("1142937031") + .withDatasourceContainerName("iaasvmcontainerv2;srinivasccyrg;sriniccylinux") + .withCoordinatorServiceStampUri("https://pod01-coord1.ccy.backup.windowsazure.com") + .withProtectionServiceStampId("90d98224-2ac6-4bda-9f35-33fb22841f2a") + .withProtectionServiceStampUri("https://pod01-prot1-int.ccy.backup.windowsazure.com") + .withTokenExtendedInformation("fakeTokenPlaceholder")) + .withRestoreRequest(new IaasVMRestoreRequest().withRecoveryPointId("87178355392716") + .withRecoveryType(RecoveryType.ALTERNATE_LOCATION) + .withSourceResourceId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/srinivasccyrg/providers/Microsoft.Compute/virtualMachines/sriniccylinux") + .withTargetVirtualMachineId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAckl/providers/Microsoft.Compute/virtualMachines/gaallaVM") + .withTargetResourceGroupId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAckl") + .withStorageAccountId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00prjaiTestRg1/providers/Microsoft.Storage/storageAccounts/00prjaitestrg1disks993") + .withVirtualNetworkId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAcklVaultCCY/providers/Microsoft.Network/virtualNetworks/00networkAcklVaultCCY-vnet") + .withSubnetId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAcklVaultCCY/providers/Microsoft.Network/virtualNetworks/00networkAcklVaultCCY-vnet/subnets/default") + .withRegion("eastus2euap") + .withAffinityGroup("") + .withCreateNewCloudService(false) + .withOriginalStorageAccountOption(false) + .withEncryptionDetails(new EncryptionDetails().withEncryptionEnabled(false)) + .withZones(Arrays.asList("2")) + .withIdentityInfo(new IdentityInfo().withIsSystemAssignedIdentity(false) + .withManagedIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-15/AzureIaasVm/TriggerCrossRegionRestore_IdentityBasedRestoreDetails_Post.json + */ + /** + * Sample code: Trigger Cross Region Restore with identityBasedRestoreDetails. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void triggerCrossRegionRestoreWithIdentityBasedRestoreDetails( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.crossRegionRestores() + .triggerWithResponse("southeastasia", new CrossRegionRestoreRequest() + .withCrossRegionRestoreAccessDetails( + new WorkloadCrrAccessToken().withAccessTokenString("fakeTokenPlaceholder") + .withSubscriptionId("f2edfd5d-5496-4683-b94f-b3588c579009") + .withResourceGroupName("srinivasccyrg") + .withResourceName("sriniccyvault") + .withResourceId("1330837906418138160") + .withRecoveryPointId("87178355392716") + .withRecoveryPointTime("10/9/2019 6:05:54 PM") + .withContainerName("iaasvmcontainerv2;srinivasccyrg;sriniccylinux") + .withContainerType("IaasVMContainer") + .withBackupManagementType("AzureIaasVM") + .withDatasourceType("VM") + .withDatasourceName("sriniccylinux") + .withDatasourceId("1142937031") + .withDatasourceContainerName("iaasvmcontainerv2;srinivasccyrg;sriniccylinux") + .withCoordinatorServiceStampUri("https://pod01-coord1.ccy.backup.windowsazure.com") + .withProtectionServiceStampId("90d98224-2ac6-4bda-9f35-33fb22841f2a") + .withProtectionServiceStampUri("https://pod01-prot1-int.ccy.backup.windowsazure.com") + .withTokenExtendedInformation("fakeTokenPlaceholder")) + .withRestoreRequest(new IaasVMRestoreRequest().withRecoveryPointId("87178355392716") + .withRecoveryType(RecoveryType.ALTERNATE_LOCATION) + .withSourceResourceId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/srinivasccyrg/providers/Microsoft.Compute/virtualMachines/sriniccylinux") + .withTargetVirtualMachineId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAckl/providers/Microsoft.Compute/virtualMachines/gaallaVM") + .withTargetResourceGroupId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAckl") + .withVirtualNetworkId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAcklVaultCCY/providers/Microsoft.Network/virtualNetworks/00networkAcklVaultCCY-vnet") + .withSubnetId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAcklVaultCCY/providers/Microsoft.Network/virtualNetworks/00networkAcklVaultCCY-vnet/subnets/default") + .withRegion("eastus2euap") + .withAffinityGroup("") + .withCreateNewCloudService(false) + .withOriginalStorageAccountOption(false) + .withEncryptionDetails(new EncryptionDetails().withEncryptionEnabled(false)) + .withZones(Arrays.asList("2")) + .withIdentityInfo(new IdentityInfo().withIsSystemAssignedIdentity(false) + .withManagedIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi")) + .withIdentityBasedRestoreDetails(new IdentityBasedRestoreDetails().withTargetStorageAccountId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00prjaiTestRg1/providers/Microsoft.Storage/storageAccounts/00prjaitestrg1disks993"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### BackupResourceStorageConfigs_Update + +```java +/** + * Samples for CrrOperationResults Get. + */ +public final class CrrOperaSamples { + /* + * x-ms-original-file: 2026-07-15/AzureIaasVm/GetCrrOperationResults_Get.json + */ + /** + * Sample code: Get Operation Results for Cross Region Restore. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void getOperationResultsForCrossRegionRestore( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.crrOperationResults() + .getWithResponse("southeastasia", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} +``` + +### BackupUsageSummariesCRR_List + +```java +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.AADPropertiesResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AADProperties; + +/** + * Samples for RecoveryPoints GetAccessToken. + */ +public final class RecoverySamples { + /* + * x-ms-original-file: 2026-07-15/AzureIaasVm/GetAccessToken_Get.json + */ + /** + * Sample code: Get Access Token for Crr. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void getAccessTokenForCrr( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.recoveryPoints() + .getAccessTokenWithResponse("rshhtestmdvmrg", "rshvault", "Azure", + "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", + "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", "26083826328862", + new AADPropertiesResourceInner() + .withProperties(new AADProperties().withTenantId("33e01921-4d64-4f8c-a055-5bdaffd5e33d") + .withAudience("https://RecoveryServices/IaasCoord/aadmgmt/ase") + .withServicePrincipalObjectId("5ecd8123-cf74-4037-83e9-9246b227b351")), + com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/pom.xml b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/pom.xml new file mode 100644 index 000000000000..f0a16c5807fd --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-recoveryservicesbackupcrossregionrestore + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Recovery Services Backup Crr Management + This package contains Microsoft Azure SDK for Recovery Services Backup Crr 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 Recovery Services Backup CRR (Cross Region Restore) service. Package api-version 2026-07-15. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.58.1 + + + com.azure + azure-core-management + 1.19.5 + + + com.azure + azure-core-test + 1.27.0-beta.16 + test + + + com.azure + azure-identity + 1.18.4 + test + + + diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/RecoveryServicesBackupCrrManager.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/RecoveryServicesBackupCrrManager.java new file mode 100644 index 000000000000..de70fc8726e2 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/RecoveryServicesBackupCrrManager.java @@ -0,0 +1,448 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +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.BearerTokenAuthenticationPolicy; +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; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryServicesBackupCrrManagementClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.AadPropertiesOperationsImpl; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.BackupCrrJobDetailsImpl; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.BackupCrrJobsImpl; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.BackupProtectedItemsCrrsImpl; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.BackupResourceStorageConfigsImpl; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.BackupUsageSummariesCRRsImpl; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.CrossRegionRestoresImpl; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.CrrOperationResultsImpl; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.CrrOperationStatusImpl; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.RecoveryPointsCrrsImpl; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.RecoveryPointsImpl; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.RecoveryServicesBackupCrrManagementClientBuilder; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AadPropertiesOperations; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupCrrJobDetails; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupCrrJobs; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupProtectedItemsCrrs; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupResourceStorageConfigs; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupUsageSummariesCRRs; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrossRegionRestores; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrOperationResults; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrOperationStatus; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPoints; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPointsCrrs; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to RecoveryServicesBackupCrrManager. + * Open API 2.0 Specs for Azure Recovery Services Backup CRR (Cross Region Restore) service. + */ +public final class RecoveryServicesBackupCrrManager { + private BackupResourceStorageConfigs backupResourceStorageConfigs; + + private RecoveryPointsCrrs recoveryPointsCrrs; + + private RecoveryPoints recoveryPoints; + + private BackupUsageSummariesCRRs backupUsageSummariesCRRs; + + private AadPropertiesOperations aadPropertiesOperations; + + private CrossRegionRestores crossRegionRestores; + + private BackupCrrJobDetails backupCrrJobDetails; + + private BackupCrrJobs backupCrrJobs; + + private CrrOperationResults crrOperationResults; + + private CrrOperationStatus crrOperationStatus; + + private BackupProtectedItemsCrrs backupProtectedItemsCrrs; + + private final RecoveryServicesBackupCrrManagementClient clientObject; + + private RecoveryServicesBackupCrrManager(HttpPipeline httpPipeline, AzureProfile profile, + Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new RecoveryServicesBackupCrrManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Recovery Services Backup Crr service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Recovery Services Backup Crr service API instance. + */ + public static RecoveryServicesBackupCrrManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Recovery Services Backup Crr service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Recovery Services Backup Crr service API instance. + */ + public static RecoveryServicesBackupCrrManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new RecoveryServicesBackupCrrManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create RecoveryServicesBackupCrrManager with optional + * configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new RecoveryServicesBackupCrrManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-recoveryservicesbackupcrossregionrestore.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Recovery Services Backup Crr service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Recovery Services Backup Crr service API instance. + */ + public RecoveryServicesBackupCrrManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new RecoveryServicesBackupCrrManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of BackupResourceStorageConfigs. + * + * @return Resource collection API of BackupResourceStorageConfigs. + */ + public BackupResourceStorageConfigs backupResourceStorageConfigs() { + if (this.backupResourceStorageConfigs == null) { + this.backupResourceStorageConfigs + = new BackupResourceStorageConfigsImpl(clientObject.getBackupResourceStorageConfigs(), this); + } + return backupResourceStorageConfigs; + } + + /** + * Gets the resource collection API of RecoveryPointsCrrs. + * + * @return Resource collection API of RecoveryPointsCrrs. + */ + public RecoveryPointsCrrs recoveryPointsCrrs() { + if (this.recoveryPointsCrrs == null) { + this.recoveryPointsCrrs = new RecoveryPointsCrrsImpl(clientObject.getRecoveryPointsCrrs(), this); + } + return recoveryPointsCrrs; + } + + /** + * Gets the resource collection API of RecoveryPoints. + * + * @return Resource collection API of RecoveryPoints. + */ + public RecoveryPoints recoveryPoints() { + if (this.recoveryPoints == null) { + this.recoveryPoints = new RecoveryPointsImpl(clientObject.getRecoveryPoints(), this); + } + return recoveryPoints; + } + + /** + * Gets the resource collection API of BackupUsageSummariesCRRs. + * + * @return Resource collection API of BackupUsageSummariesCRRs. + */ + public BackupUsageSummariesCRRs backupUsageSummariesCRRs() { + if (this.backupUsageSummariesCRRs == null) { + this.backupUsageSummariesCRRs + = new BackupUsageSummariesCRRsImpl(clientObject.getBackupUsageSummariesCRRs(), this); + } + return backupUsageSummariesCRRs; + } + + /** + * Gets the resource collection API of AadPropertiesOperations. + * + * @return Resource collection API of AadPropertiesOperations. + */ + public AadPropertiesOperations aadPropertiesOperations() { + if (this.aadPropertiesOperations == null) { + this.aadPropertiesOperations + = new AadPropertiesOperationsImpl(clientObject.getAadPropertiesOperations(), this); + } + return aadPropertiesOperations; + } + + /** + * Gets the resource collection API of CrossRegionRestores. + * + * @return Resource collection API of CrossRegionRestores. + */ + public CrossRegionRestores crossRegionRestores() { + if (this.crossRegionRestores == null) { + this.crossRegionRestores = new CrossRegionRestoresImpl(clientObject.getCrossRegionRestores(), this); + } + return crossRegionRestores; + } + + /** + * Gets the resource collection API of BackupCrrJobDetails. + * + * @return Resource collection API of BackupCrrJobDetails. + */ + public BackupCrrJobDetails backupCrrJobDetails() { + if (this.backupCrrJobDetails == null) { + this.backupCrrJobDetails = new BackupCrrJobDetailsImpl(clientObject.getBackupCrrJobDetails(), this); + } + return backupCrrJobDetails; + } + + /** + * Gets the resource collection API of BackupCrrJobs. + * + * @return Resource collection API of BackupCrrJobs. + */ + public BackupCrrJobs backupCrrJobs() { + if (this.backupCrrJobs == null) { + this.backupCrrJobs = new BackupCrrJobsImpl(clientObject.getBackupCrrJobs(), this); + } + return backupCrrJobs; + } + + /** + * Gets the resource collection API of CrrOperationResults. + * + * @return Resource collection API of CrrOperationResults. + */ + public CrrOperationResults crrOperationResults() { + if (this.crrOperationResults == null) { + this.crrOperationResults = new CrrOperationResultsImpl(clientObject.getCrrOperationResults(), this); + } + return crrOperationResults; + } + + /** + * Gets the resource collection API of CrrOperationStatus. + * + * @return Resource collection API of CrrOperationStatus. + */ + public CrrOperationStatus crrOperationStatus() { + if (this.crrOperationStatus == null) { + this.crrOperationStatus = new CrrOperationStatusImpl(clientObject.getCrrOperationStatus(), this); + } + return crrOperationStatus; + } + + /** + * Gets the resource collection API of BackupProtectedItemsCrrs. + * + * @return Resource collection API of BackupProtectedItemsCrrs. + */ + public BackupProtectedItemsCrrs backupProtectedItemsCrrs() { + if (this.backupProtectedItemsCrrs == null) { + this.backupProtectedItemsCrrs + = new BackupProtectedItemsCrrsImpl(clientObject.getBackupProtectedItemsCrrs(), this); + } + return backupProtectedItemsCrrs; + } + + /** + * Gets wrapped service client RecoveryServicesBackupCrrManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client RecoveryServicesBackupCrrManagementClient. + */ + public RecoveryServicesBackupCrrManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/AadPropertiesOperationsClient.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/AadPropertiesOperationsClient.java new file mode 100644 index 000000000000..4d4ba76aa384 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/AadPropertiesOperationsClient.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.AADPropertiesResourceInner; + +/** + * An instance of this class provides access to all the operations defined in AadPropertiesOperationsClient. + */ +public interface AadPropertiesOperationsClient { + /** + * Fetches the AAD properties from target region BCM stamp. + * + * Gets the Azure Active Directory properties from the target-region Backup Management stamp, used to authorize a + * cross-region restore operation. + * + * @param azureRegion Azure region to hit Api. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String azureRegion, String filter, Context context); + + /** + * Fetches the AAD properties from target region BCM stamp. + * + * Gets the Azure Active Directory properties from the target-region Backup Management stamp, used to authorize a + * cross-region restore operation. + * + * @param azureRegion Azure region to hit Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AADPropertiesResourceInner get(String azureRegion); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupCrrJobDetailsClient.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupCrrJobDetailsClient.java new file mode 100644 index 000000000000..eced9d3ffff7 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupCrrJobDetailsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrJobRequest; + +/** + * An instance of this class provides access to all the operations defined in BackupCrrJobDetailsClient. + */ +public interface BackupCrrJobDetailsClient { + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @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 cRR job details from target region along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String azureRegion, CrrJobRequest parameters, Context context); + + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cRR job details from target region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobResourceInner get(String azureRegion, CrrJobRequest parameters); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupCrrJobsClient.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupCrrJobsClient.java new file mode 100644 index 000000000000..c8d0880dd482 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupCrrJobsClient.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceListInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrJobRequest; + +/** + * An instance of this class provides access to all the operations defined in BackupCrrJobsClient. + */ +public interface BackupCrrJobsClient { + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String azureRegion, CrrJobRequest parameters, String filter, + String skipToken, Context context); + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobResourceListInner list(String azureRegion, CrrJobRequest parameters); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupProtectedItemsCrrsClient.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupProtectedItemsCrrsClient.java new file mode 100644 index 000000000000..587e4383cbbf --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupProtectedItemsCrrsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.ProtectedItemResourceListInner; + +/** + * An instance of this class provides access to all the operations defined in BackupProtectedItemsCrrsClient. + */ +public interface BackupProtectedItemsCrrsClient { + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @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 list of ProtectedItem resources along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String vaultName, String filter, + String skipToken, Context context); + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectedItemResourceListInner list(String resourceGroupName, String vaultName); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupResourceStorageConfigsClient.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupResourceStorageConfigsClient.java new file mode 100644 index 000000000000..9178edb719ad --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupResourceStorageConfigsClient.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupResourceConfigResourceInner; + +/** + * An instance of this class provides access to all the operations defined in BackupResourceStorageConfigsClient. + */ +public interface BackupResourceStorageConfigsClient { + /** + * Fetches resource storage config. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String vaultName, + Context context); + + /** + * Fetches resource storage config. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupResourceConfigResourceInner get(String resourceGroupName, String vaultName); + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters, Context context); + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupResourceConfigResourceInner update(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters); + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response patchWithResponse(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters, Context context); + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void patch(String resourceGroupName, String vaultName, BackupResourceConfigResourceInner parameters); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupUsageSummariesCRRsClient.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupUsageSummariesCRRsClient.java new file mode 100644 index 000000000000..f618e82a73df --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupUsageSummariesCRRsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupManagementUsageListInner; + +/** + * An instance of this class provides access to all the operations defined in BackupUsageSummariesCRRsClient. + */ +public interface BackupUsageSummariesCRRsClient { + /** + * Fetches the backup management usage summaries of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @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 backup management usage for vault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String vaultName, String filter, + String skipToken, Context context); + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 backup management usage for vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupManagementUsageListInner list(String resourceGroupName, String vaultName); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrossRegionRestoresClient.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrossRegionRestoresClient.java new file mode 100644 index 000000000000..0b4be42f9187 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrossRegionRestoresClient.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrossRegionRestoreRequest; + +/** + * An instance of this class provides access to all the operations defined in CrossRegionRestoresClient. + */ +public interface CrossRegionRestoresClient { + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response triggerWithResponse(String azureRegion, CrossRegionRestoreRequest parameters, Context context); + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void trigger(String azureRegion, CrossRegionRestoreRequest parameters); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrrOperationResultsClient.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrrOperationResultsClient.java new file mode 100644 index 000000000000..bf59804dddbf --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrrOperationResultsClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * An instance of this class provides access to all the operations defined in CrrOperationResultsClient. + */ +public interface CrrOperationResultsClient { + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String azureRegion, String operationId, Context context); + + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void get(String azureRegion, String operationId); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrrOperationStatusClient.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrrOperationStatusClient.java new file mode 100644 index 000000000000..314ab103f877 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrrOperationStatusClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.OperationStatusInner; + +/** + * An instance of this class provides access to all the operations defined in CrrOperationStatusClient. + */ +public interface CrrOperationStatusClient { + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String azureRegion, String operationId, Context context); + + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String azureRegion, String operationId); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryPointsClient.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryPointsClient.java new file mode 100644 index 000000000000..b9b7ab9b3683 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryPointsClient.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.AADPropertiesResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.CrrAccessTokenResourceInner; + +/** + * An instance of this class provides access to all the operations defined in RecoveryPointsClient. + */ +public interface RecoveryPointsClient { + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAccessTokenWithResponse(String resourceGroupName, String vaultName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId, + AADPropertiesResourceInner parameters, Context context); + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CrrAccessTokenResourceInner getAccessToken(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName, String recoveryPointId, AADPropertiesResourceInner parameters); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryPointsCrrsClient.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryPointsCrrsClient.java new file mode 100644 index 000000000000..4e7f21da8144 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryPointsCrrsClient.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.RecoveryPointResourceInner; + +/** + * An instance of this class provides access to all the operations defined in RecoveryPointsCrrsClient. + */ +public interface RecoveryPointsCrrsClient { + /** + * Provides the information of the backed up data identified using 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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName, String recoveryPointId, Context context); + + /** + * Provides the information of the backed up data identified using 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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPointResourceInner get(String resourceGroupName, String vaultName, String fabricName, String containerName, + String protectedItemName, String recoveryPointId); + + /** + * Lists the backup copies for the backed up item. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 list of RecoveryPoint resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName); + + /** + * Lists the backup copies for the backed up item. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param filter OData filter options. + * @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 list of RecoveryPoint resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName, String filter, Context context); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryServicesBackupCrrManagementClient.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryServicesBackupCrrManagementClient.java new file mode 100644 index 000000000000..d9390ede045a --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryServicesBackupCrrManagementClient.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for RecoveryServicesBackupCrrManagementClient class. + */ +public interface RecoveryServicesBackupCrrManagementClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the BackupResourceStorageConfigsClient object to access its operations. + * + * @return the BackupResourceStorageConfigsClient object. + */ + BackupResourceStorageConfigsClient getBackupResourceStorageConfigs(); + + /** + * Gets the RecoveryPointsCrrsClient object to access its operations. + * + * @return the RecoveryPointsCrrsClient object. + */ + RecoveryPointsCrrsClient getRecoveryPointsCrrs(); + + /** + * Gets the RecoveryPointsClient object to access its operations. + * + * @return the RecoveryPointsClient object. + */ + RecoveryPointsClient getRecoveryPoints(); + + /** + * Gets the BackupUsageSummariesCRRsClient object to access its operations. + * + * @return the BackupUsageSummariesCRRsClient object. + */ + BackupUsageSummariesCRRsClient getBackupUsageSummariesCRRs(); + + /** + * Gets the AadPropertiesOperationsClient object to access its operations. + * + * @return the AadPropertiesOperationsClient object. + */ + AadPropertiesOperationsClient getAadPropertiesOperations(); + + /** + * Gets the CrossRegionRestoresClient object to access its operations. + * + * @return the CrossRegionRestoresClient object. + */ + CrossRegionRestoresClient getCrossRegionRestores(); + + /** + * Gets the BackupCrrJobDetailsClient object to access its operations. + * + * @return the BackupCrrJobDetailsClient object. + */ + BackupCrrJobDetailsClient getBackupCrrJobDetails(); + + /** + * Gets the BackupCrrJobsClient object to access its operations. + * + * @return the BackupCrrJobsClient object. + */ + BackupCrrJobsClient getBackupCrrJobs(); + + /** + * Gets the CrrOperationResultsClient object to access its operations. + * + * @return the CrrOperationResultsClient object. + */ + CrrOperationResultsClient getCrrOperationResults(); + + /** + * Gets the CrrOperationStatusClient object to access its operations. + * + * @return the CrrOperationStatusClient object. + */ + CrrOperationStatusClient getCrrOperationStatus(); + + /** + * Gets the BackupProtectedItemsCrrsClient object to access its operations. + * + * @return the BackupProtectedItemsCrrsClient object. + */ + BackupProtectedItemsCrrsClient getBackupProtectedItemsCrrs(); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/AADPropertiesResourceInner.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/AADPropertiesResourceInner.java new file mode 100644 index 000000000000..1cee6f8f8f3e --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/AADPropertiesResourceInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AADProperties; +import java.io.IOException; +import java.util.Map; + +/** + * The AADPropertiesResource model. + */ +@Fluent +public final class AADPropertiesResourceInner extends Resource { + /* + * AADPropertiesResource properties + */ + private AADProperties properties; + + /* + * Optional 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 AADPropertiesResourceInner class. + */ + public AADPropertiesResourceInner() { + } + + /** + * Get the properties property: AADPropertiesResource properties. + * + * @return the properties value. + */ + public AADProperties properties() { + return this.properties; + } + + /** + * Set the properties property: AADPropertiesResource properties. + * + * @param properties the properties value to set. + * @return the AADPropertiesResourceInner object itself. + */ + public AADPropertiesResourceInner withProperties(AADProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the eTag property: Optional ETag. + * + * @return the eTag value. + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the eTag property: Optional ETag. + * + * @param eTag the eTag value to set. + * @return the AADPropertiesResourceInner object itself. + */ + public AADPropertiesResourceInner withETag(String eTag) { + this.eTag = 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} + */ + @Override + public AADPropertiesResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AADPropertiesResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@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 AADPropertiesResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AADPropertiesResourceInner 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 AADPropertiesResourceInner. + */ + public static AADPropertiesResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AADPropertiesResourceInner deserializedAADPropertiesResourceInner = new AADPropertiesResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAADPropertiesResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAADPropertiesResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAADPropertiesResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAADPropertiesResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAADPropertiesResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAADPropertiesResourceInner.properties = AADProperties.fromJson(reader); + } else if ("eTag".equals(fieldName)) { + deserializedAADPropertiesResourceInner.eTag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAADPropertiesResourceInner; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/BackupManagementUsageListInner.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/BackupManagementUsageListInner.java new file mode 100644 index 000000000000..c2d8d442a46d --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/BackupManagementUsageListInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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.recoveryservicesbackupcrossregionrestore.models.BackupManagementUsage; +import java.io.IOException; +import java.util.List; + +/** + * Backup management usage for vault. + */ +@Immutable +public final class BackupManagementUsageListInner implements JsonSerializable { + /* + * The list of backup management usages for the given vault. + */ + private List value; + + /** + * Creates an instance of BackupManagementUsageListInner class. + */ + private BackupManagementUsageListInner() { + } + + /** + * Get the value property: The list of backup management usages for the given vault. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupManagementUsageListInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupManagementUsageListInner 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 BackupManagementUsageListInner. + */ + public static BackupManagementUsageListInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupManagementUsageListInner deserializedBackupManagementUsageListInner + = new BackupManagementUsageListInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BackupManagementUsage.fromJson(reader1)); + deserializedBackupManagementUsageListInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedBackupManagementUsageListInner; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/BackupResourceConfigResourceInner.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/BackupResourceConfigResourceInner.java new file mode 100644 index 000000000000..358a396fa239 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/BackupResourceConfigResourceInner.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupResourceConfig; +import java.io.IOException; +import java.util.Map; + +/** + * The resource storage details. + */ +@Fluent +public final class BackupResourceConfigResourceInner extends ProxyResource { + /* + * BackupResourceConfigResource properties + */ + private BackupResourceConfig properties; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Optional ETag. + */ + private String eTag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of BackupResourceConfigResourceInner class. + */ + public BackupResourceConfigResourceInner() { + } + + /** + * Get the properties property: BackupResourceConfigResource properties. + * + * @return the properties value. + */ + public BackupResourceConfig properties() { + return this.properties; + } + + /** + * Set the properties property: BackupResourceConfigResource properties. + * + * @param properties the properties value to set. + * @return the BackupResourceConfigResourceInner object itself. + */ + public BackupResourceConfigResourceInner withProperties(BackupResourceConfig properties) { + this.properties = properties; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the BackupResourceConfigResourceInner object itself. + */ + public BackupResourceConfigResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the BackupResourceConfigResourceInner object itself. + */ + public BackupResourceConfigResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the eTag property: Optional ETag. + * + * @return the eTag value. + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the eTag property: Optional ETag. + * + * @param eTag the eTag value to set. + * @return the BackupResourceConfigResourceInner object itself. + */ + public BackupResourceConfigResourceInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + 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 ("properties".equals(fieldName)) { + deserializedBackupResourceConfigResourceInner.properties = BackupResourceConfig.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBackupResourceConfigResourceInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedBackupResourceConfigResourceInner.location = reader.getString(); + } else if ("eTag".equals(fieldName)) { + deserializedBackupResourceConfigResourceInner.eTag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedBackupResourceConfigResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupResourceConfigResourceInner; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/CrrAccessTokenResourceInner.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/CrrAccessTokenResourceInner.java new file mode 100644 index 000000000000..c08591032875 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/CrrAccessTokenResourceInner.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models; + +import com.azure.core.annotation.Immutable; +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.recoveryservicesbackupcrossregionrestore.models.CrrAccessToken; +import java.io.IOException; +import java.util.Map; + +/** + * The CrrAccessTokenResource model. + */ +@Immutable +public final class CrrAccessTokenResourceInner extends Resource { + /* + * CrrAccessTokenResource properties + */ + private CrrAccessToken properties; + + /* + * Optional 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 CrrAccessTokenResourceInner class. + */ + private CrrAccessTokenResourceInner() { + } + + /** + * Get the properties property: CrrAccessTokenResource properties. + * + * @return the properties value. + */ + public CrrAccessToken properties() { + return this.properties; + } + + /** + * Get the eTag property: Optional ETag. + * + * @return the eTag value. + */ + public String eTag() { + return this.eTag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public 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 CrrAccessTokenResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CrrAccessTokenResourceInner 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 CrrAccessTokenResourceInner. + */ + public static CrrAccessTokenResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CrrAccessTokenResourceInner deserializedCrrAccessTokenResourceInner = new CrrAccessTokenResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCrrAccessTokenResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCrrAccessTokenResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCrrAccessTokenResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCrrAccessTokenResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCrrAccessTokenResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedCrrAccessTokenResourceInner.properties = CrrAccessToken.fromJson(reader); + } else if ("eTag".equals(fieldName)) { + deserializedCrrAccessTokenResourceInner.eTag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCrrAccessTokenResourceInner; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/JobResourceInner.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/JobResourceInner.java new file mode 100644 index 000000000000..4dd757bad340 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/JobResourceInner.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models; + +import com.azure.core.annotation.Immutable; +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.recoveryservicesbackupcrossregionrestore.models.Job; +import java.io.IOException; +import java.util.Map; + +/** + * Defines workload agnostic properties for a job. + */ +@Immutable +public final class JobResourceInner extends Resource { + /* + * JobResource properties + */ + private Job properties; + + /* + * Optional 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. + */ + private JobResourceInner() { + } + + /** + * Get the properties property: JobResource properties. + * + * @return the properties value. + */ + public Job properties() { + return this.properties; + } + + /** + * Get the eTag property: Optional ETag. + * + * @return the eTag value. + */ + public String eTag() { + return this.eTag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public 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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/JobResourceListInner.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/JobResourceListInner.java new file mode 100644 index 000000000000..a50cfd049f0b --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/JobResourceListInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ResourceList; +import java.io.IOException; +import java.util.List; + +/** + * List of Job resources. + */ +@Immutable +public final class JobResourceListInner extends ResourceList { + /* + * List of resources. + */ + private List value; + + /* + * The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of JobResourceListInner class. + */ + private JobResourceListInner() { + } + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The uri to fetch the next page of resources. Call ListNext() fetches next page of + * resources. + * + * @return the nextLink value. + */ + @Override + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", nextLink()); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobResourceListInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobResourceListInner 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 JobResourceListInner. + */ + public static JobResourceListInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobResourceListInner deserializedJobResourceListInner = new JobResourceListInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedJobResourceListInner.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> JobResourceInner.fromJson(reader1)); + deserializedJobResourceListInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedJobResourceListInner; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/OperationStatusInner.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/OperationStatusInner.java new file mode 100644 index 000000000000..e01ca69701f4 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/OperationStatusInner.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatusError; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatusExtendedInfo; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatusValues; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Operation status. + */ +@Immutable +public final class OperationStatusInner implements JsonSerializable { + /* + * ID of the operation. + */ + private String id; + + /* + * Name of the operation. + */ + private String name; + + /* + * Operation status. + */ + private OperationStatusValues status; + + /* + * Operation start time. Format: ISO-8601. + */ + private OffsetDateTime startTime; + + /* + * Operation end time. Format: ISO-8601. + */ + private OffsetDateTime endTime; + + /* + * Error information related to this operation. + */ + private OperationStatusError error; + + /* + * Additional information associated with this operation. + */ + private OperationStatusExtendedInfo properties; + + /** + * Creates an instance of OperationStatusInner class. + */ + private OperationStatusInner() { + } + + /** + * Get the id property: ID of the operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public OperationStatusValues status() { + return this.status; + } + + /** + * Get the startTime property: Operation start time. Format: ISO-8601. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: Operation end time. Format: ISO-8601. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the error property: Error information related to this operation. + * + * @return the error value. + */ + public OperationStatusError error() { + return this.error; + } + + /** + * Get the properties property: Additional information associated with this operation. + * + * @return the properties value. + */ + public OperationStatusExtendedInfo properties() { + return this.properties; + } + + /** + * {@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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/ProtectedItemResourceListInner.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/ProtectedItemResourceListInner.java new file mode 100644 index 000000000000..a5db241c98a5 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/ProtectedItemResourceListInner.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ProtectedItemResource; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ResourceList; +import java.io.IOException; +import java.util.List; + +/** + * List of ProtectedItem resources. + */ +@Immutable +public final class ProtectedItemResourceListInner extends ResourceList { + /* + * List of resources. + */ + private List value; + + /* + * The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of ProtectedItemResourceListInner class. + */ + private ProtectedItemResourceListInner() { + } + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The uri to fetch the next page of resources. Call ListNext() fetches next page of + * resources. + * + * @return the nextLink value. + */ + @Override + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", nextLink()); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProtectedItemResourceListInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProtectedItemResourceListInner 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 ProtectedItemResourceListInner. + */ + public static ProtectedItemResourceListInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProtectedItemResourceListInner deserializedProtectedItemResourceListInner + = new ProtectedItemResourceListInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedProtectedItemResourceListInner.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ProtectedItemResource.fromJson(reader1)); + deserializedProtectedItemResourceListInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedProtectedItemResourceListInner; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/RecoveryPointResourceInner.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/RecoveryPointResourceInner.java new file mode 100644 index 000000000000..693a8b95f202 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/RecoveryPointResourceInner.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPoint; +import java.io.IOException; +import java.util.Map; + +/** + * Base class for backup copies. Workload-specific backup copies are derived from this class. + */ +@Immutable +public final class RecoveryPointResourceInner extends ProxyResource { + /* + * RecoveryPointResource properties + */ + private RecoveryPoint properties; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Optional ETag. + */ + private String eTag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RecoveryPointResourceInner class. + */ + private RecoveryPointResourceInner() { + } + + /** + * Get the properties property: RecoveryPointResource properties. + * + * @return the properties value. + */ + public RecoveryPoint properties() { + return this.properties; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the eTag property: Optional ETag. + * + * @return the eTag value. + */ + public String eTag() { + return this.eTag; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + 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 ("properties".equals(fieldName)) { + deserializedRecoveryPointResourceInner.properties = RecoveryPoint.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRecoveryPointResourceInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedRecoveryPointResourceInner.location = reader.getString(); + } else if ("eTag".equals(fieldName)) { + deserializedRecoveryPointResourceInner.eTag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedRecoveryPointResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPointResourceInner; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/package-info.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/package-info.java new file mode 100644 index 000000000000..5d2b198d02e1 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the inner data models for RecoveryServicesBackupCrr. + * Open API 2.0 Specs for Azure Recovery Services Backup CRR (Cross Region Restore) service. + */ +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models; diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/package-info.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/package-info.java new file mode 100644 index 000000000000..b416de6085df --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the service clients for RecoveryServicesBackupCrr. + * Open API 2.0 Specs for Azure Recovery Services Backup CRR (Cross Region Restore) service. + */ +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent; diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AADPropertiesResourceImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AADPropertiesResourceImpl.java new file mode 100644 index 000000000000..28a5e4e6c337 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AADPropertiesResourceImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.AADPropertiesResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AADProperties; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AADPropertiesResource; +import java.util.Collections; +import java.util.Map; + +public final class AADPropertiesResourceImpl implements AADPropertiesResource { + private AADPropertiesResourceInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + AADPropertiesResourceImpl(AADPropertiesResourceInner innerObject, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public AADProperties properties() { + return this.innerModel().properties(); + } + + public String eTag() { + return this.innerModel().eTag(); + } + + public AADPropertiesResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AadPropertiesOperationsClientImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AadPropertiesOperationsClientImpl.java new file mode 100644 index 000000000000..79bec99f4a4f --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AadPropertiesOperationsClientImpl.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.AadPropertiesOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.AADPropertiesResourceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AadPropertiesOperationsClient. + */ +public final class AadPropertiesOperationsClientImpl implements AadPropertiesOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AadPropertiesOperationsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupCrrManagementClientImpl client; + + /** + * Initializes an instance of AadPropertiesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AadPropertiesOperationsClientImpl(RecoveryServicesBackupCrrManagementClientImpl client) { + this.service = RestProxy.create(AadPropertiesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupCrrManagementClientAadPropertiesOperations to + * be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupCrrManagementClientAadPropertiesOperations") + public interface AadPropertiesOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupAadProperties") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("azureRegion") String azureRegion, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupAadProperties") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("azureRegion") String azureRegion, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Fetches the AAD properties from target region BCM stamp. + * + * Gets the Azure Active Directory properties from the target-region Backup Management stamp, used to authorize a + * cross-region restore operation. + * + * @param azureRegion Azure region to hit Api. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String azureRegion, String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), azureRegion, filter, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Fetches the AAD properties from target region BCM stamp. + * + * Gets the Azure Active Directory properties from the target-region Backup Management stamp, used to authorize a + * cross-region restore operation. + * + * @param azureRegion Azure region to hit Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String azureRegion) { + final String filter = null; + return getWithResponseAsync(azureRegion, filter).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Fetches the AAD properties from target region BCM stamp. + * + * Gets the Azure Active Directory properties from the target-region Backup Management stamp, used to authorize a + * cross-region restore operation. + * + * @param azureRegion Azure region to hit Api. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String azureRegion, String filter, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + azureRegion, filter, accept, context); + } + + /** + * Fetches the AAD properties from target region BCM stamp. + * + * Gets the Azure Active Directory properties from the target-region Backup Management stamp, used to authorize a + * cross-region restore operation. + * + * @param azureRegion Azure region to hit Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AADPropertiesResourceInner get(String azureRegion) { + final String filter = null; + return getWithResponse(azureRegion, filter, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AadPropertiesOperationsImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AadPropertiesOperationsImpl.java new file mode 100644 index 000000000000..d30ba5935ea6 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AadPropertiesOperationsImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.AadPropertiesOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.AADPropertiesResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AADPropertiesResource; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AadPropertiesOperations; + +public final class AadPropertiesOperationsImpl implements AadPropertiesOperations { + private static final ClientLogger LOGGER = new ClientLogger(AadPropertiesOperationsImpl.class); + + private final AadPropertiesOperationsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + public AadPropertiesOperationsImpl(AadPropertiesOperationsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String azureRegion, String filter, Context context) { + Response inner = this.serviceClient().getWithResponse(azureRegion, filter, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AADPropertiesResourceImpl(inner.getValue(), this.manager())); + } + + public AADPropertiesResource get(String azureRegion) { + AADPropertiesResourceInner inner = this.serviceClient().get(azureRegion); + if (inner != null) { + return new AADPropertiesResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private AadPropertiesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobDetailsClientImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobDetailsClientImpl.java new file mode 100644 index 000000000000..8242c0316b8a --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobDetailsClientImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupCrrJobDetailsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrJobRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BackupCrrJobDetailsClient. + */ +public final class BackupCrrJobDetailsClientImpl implements BackupCrrJobDetailsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BackupCrrJobDetailsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupCrrManagementClientImpl client; + + /** + * Initializes an instance of BackupCrrJobDetailsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupCrrJobDetailsClientImpl(RecoveryServicesBackupCrrManagementClientImpl client) { + this.service = RestProxy.create(BackupCrrJobDetailsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupCrrManagementClientBackupCrrJobDetails to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupCrrManagementClientBackupCrrJobDetails") + public interface BackupCrrJobDetailsService { + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CrrJobRequest parameters, + Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CrrJobRequest parameters, + Context context); + } + + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cRR job details from target region along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String azureRegion, CrrJobRequest parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), azureRegion, + this.client.getSubscriptionId(), contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cRR job details from target region on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String azureRegion, CrrJobRequest parameters) { + return getWithResponseAsync(azureRegion, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @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 cRR job details from target region along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String azureRegion, CrrJobRequest parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), azureRegion, + this.client.getSubscriptionId(), contentType, accept, parameters, context); + } + + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cRR job details from target region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobResourceInner get(String azureRegion, CrrJobRequest parameters) { + return getWithResponse(azureRegion, parameters, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobDetailsImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobDetailsImpl.java new file mode 100644 index 000000000000..ce8c09f6a42f --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobDetailsImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupCrrJobDetailsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupCrrJobDetails; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrJobRequest; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.JobResource; + +public final class BackupCrrJobDetailsImpl implements BackupCrrJobDetails { + private static final ClientLogger LOGGER = new ClientLogger(BackupCrrJobDetailsImpl.class); + + private final BackupCrrJobDetailsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + public BackupCrrJobDetailsImpl(BackupCrrJobDetailsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String azureRegion, CrrJobRequest parameters, Context context) { + Response inner = this.serviceClient().getWithResponse(azureRegion, parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new JobResourceImpl(inner.getValue(), this.manager())); + } + + public JobResource get(String azureRegion, CrrJobRequest parameters) { + JobResourceInner inner = this.serviceClient().get(azureRegion, parameters); + if (inner != null) { + return new JobResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private BackupCrrJobDetailsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobsClientImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobsClientImpl.java new file mode 100644 index 000000000000..b61a9c03c6f3 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobsClientImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupCrrJobsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceListInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrJobRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BackupCrrJobsClient. + */ +public final class BackupCrrJobsClientImpl implements BackupCrrJobsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BackupCrrJobsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupCrrManagementClientImpl client; + + /** + * Initializes an instance of BackupCrrJobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupCrrJobsClientImpl(RecoveryServicesBackupCrrManagementClientImpl client) { + this.service + = RestProxy.create(BackupCrrJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupCrrManagementClientBackupCrrJobs to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupCrrManagementClientBackupCrrJobs") + public interface BackupCrrJobsService { + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CrrJobRequest parameters, + Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CrrJobRequest parameters, + Context context); + } + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String azureRegion, CrrJobRequest parameters, + String filter, String skipToken) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), azureRegion, + this.client.getSubscriptionId(), filter, skipToken, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String azureRegion, CrrJobRequest parameters) { + final String filter = null; + final String skipToken = null; + return listWithResponseAsync(azureRegion, parameters, filter, skipToken) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String azureRegion, CrrJobRequest parameters, String filter, + String skipToken, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), azureRegion, + this.client.getSubscriptionId(), filter, skipToken, contentType, accept, parameters, context); + } + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobResourceListInner list(String azureRegion, CrrJobRequest parameters) { + final String filter = null; + final String skipToken = null; + return listWithResponse(azureRegion, parameters, filter, skipToken, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobsImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobsImpl.java new file mode 100644 index 000000000000..1a01095477fd --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobsImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupCrrJobsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceListInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupCrrJobs; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrJobRequest; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.JobResourceList; + +public final class BackupCrrJobsImpl implements BackupCrrJobs { + private static final ClientLogger LOGGER = new ClientLogger(BackupCrrJobsImpl.class); + + private final BackupCrrJobsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + public BackupCrrJobsImpl(BackupCrrJobsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(String azureRegion, CrrJobRequest parameters, String filter, + String skipToken, Context context) { + Response inner + = this.serviceClient().listWithResponse(azureRegion, parameters, filter, skipToken, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new JobResourceListImpl(inner.getValue(), this.manager())); + } + + public JobResourceList list(String azureRegion, CrrJobRequest parameters) { + JobResourceListInner inner = this.serviceClient().list(azureRegion, parameters); + if (inner != null) { + return new JobResourceListImpl(inner, this.manager()); + } else { + return null; + } + } + + private BackupCrrJobsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupManagementUsageListImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupManagementUsageListImpl.java new file mode 100644 index 000000000000..c8e7ec6c8e3b --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupManagementUsageListImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupManagementUsageListInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementUsage; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementUsageList; +import java.util.Collections; +import java.util.List; + +public final class BackupManagementUsageListImpl implements BackupManagementUsageList { + private BackupManagementUsageListInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + BackupManagementUsageListImpl(BackupManagementUsageListInner innerObject, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public BackupManagementUsageListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupProtectedItemsCrrsClientImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupProtectedItemsCrrsClientImpl.java new file mode 100644 index 000000000000..185ac8667884 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupProtectedItemsCrrsClientImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupProtectedItemsCrrsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.ProtectedItemResourceListInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BackupProtectedItemsCrrsClient. + */ +public final class BackupProtectedItemsCrrsClientImpl implements BackupProtectedItemsCrrsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BackupProtectedItemsCrrsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupCrrManagementClientImpl client; + + /** + * Initializes an instance of BackupProtectedItemsCrrsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupProtectedItemsCrrsClientImpl(RecoveryServicesBackupCrrManagementClientImpl client) { + this.service = RestProxy.create(BackupProtectedItemsCrrsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupCrrManagementClientBackupProtectedItemsCrrs to + * be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupCrrManagementClientBackupProtectedItemsCrrs") + public interface BackupProtectedItemsCrrsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems/") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems/") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String vaultName, String filter, String skipToken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, filter, skipToken, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String vaultName) { + final String filter = null; + final String skipToken = null; + return listWithResponseAsync(resourceGroupName, vaultName, filter, skipToken) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @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 list of ProtectedItem resources along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String vaultName, + String filter, String skipToken, Context context) { + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, filter, skipToken, accept, context); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectedItemResourceListInner list(String resourceGroupName, String vaultName) { + final String filter = null; + final String skipToken = null; + return listWithResponse(resourceGroupName, vaultName, filter, skipToken, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupProtectedItemsCrrsImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupProtectedItemsCrrsImpl.java new file mode 100644 index 000000000000..91251c5844a2 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupProtectedItemsCrrsImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupProtectedItemsCrrsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.ProtectedItemResourceListInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupProtectedItemsCrrs; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ProtectedItemResourceList; + +public final class BackupProtectedItemsCrrsImpl implements BackupProtectedItemsCrrs { + private static final ClientLogger LOGGER = new ClientLogger(BackupProtectedItemsCrrsImpl.class); + + private final BackupProtectedItemsCrrsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + public BackupProtectedItemsCrrsImpl(BackupProtectedItemsCrrsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(String resourceGroupName, String vaultName, + String filter, String skipToken, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, vaultName, filter, skipToken, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProtectedItemResourceListImpl(inner.getValue(), this.manager())); + } + + public ProtectedItemResourceList list(String resourceGroupName, String vaultName) { + ProtectedItemResourceListInner inner = this.serviceClient().list(resourceGroupName, vaultName); + if (inner != null) { + return new ProtectedItemResourceListImpl(inner, this.manager()); + } else { + return null; + } + } + + private BackupProtectedItemsCrrsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceConfigResourceImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceConfigResourceImpl.java new file mode 100644 index 000000000000..22543295b394 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceConfigResourceImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupResourceConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupResourceConfig; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupResourceConfigResource; +import java.util.Collections; +import java.util.Map; + +public final class BackupResourceConfigResourceImpl implements BackupResourceConfigResource { + private BackupResourceConfigResourceInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + BackupResourceConfigResourceImpl(BackupResourceConfigResourceInner innerObject, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public BackupResourceConfig properties() { + return this.innerModel().properties(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String location() { + return this.innerModel().location(); + } + + public String eTag() { + return this.innerModel().eTag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public BackupResourceConfigResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceStorageConfigsClientImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceStorageConfigsClientImpl.java new file mode 100644 index 000000000000..5af1bd37bbe1 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceStorageConfigsClientImpl.java @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupResourceStorageConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupResourceConfigResourceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BackupResourceStorageConfigsClient. + */ +public final class BackupResourceStorageConfigsClientImpl implements BackupResourceStorageConfigsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BackupResourceStorageConfigsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupCrrManagementClientImpl client; + + /** + * Initializes an instance of BackupResourceStorageConfigsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupResourceStorageConfigsClientImpl(RecoveryServicesBackupCrrManagementClientImpl client) { + this.service = RestProxy.create(BackupResourceStorageConfigsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupCrrManagementClientBackupResourceStorageConfigs + * to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupCrrManagementClientBackupResourceStorageConfigs") + public interface BackupResourceStorageConfigsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BackupResourceConfigResourceInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BackupResourceConfigResourceInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> patch(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BackupResourceConfigResourceInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response patchSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BackupResourceConfigResourceInner parameters, Context context); + } + + /** + * Fetches resource storage config. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String vaultName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Fetches resource storage config. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName) { + return getWithResponseAsync(resourceGroupName, vaultName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Fetches resource storage config. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String vaultName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, accept, context); + } + + /** + * Fetches resource storage config. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupResourceConfigResourceInner get(String resourceGroupName, String vaultName) { + return getWithResponse(resourceGroupName, vaultName, Context.NONE).getValue(); + } + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String vaultName, BackupResourceConfigResourceInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters) { + return updateWithResponseAsync(resourceGroupName, vaultName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, accept, parameters, context); + } + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupResourceConfigResourceInner update(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters) { + return updateWithResponse(resourceGroupName, vaultName, parameters, Context.NONE).getValue(); + } + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.patch(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters) { + return patchWithResponseAsync(resourceGroupName, vaultName, parameters).flatMap(ignored -> Mono.empty()); + } + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response patchWithResponse(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters, Context context) { + final String contentType = "application/json"; + return service.patchSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, parameters, context); + } + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void patch(String resourceGroupName, String vaultName, BackupResourceConfigResourceInner parameters) { + patchWithResponse(resourceGroupName, vaultName, parameters, Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceStorageConfigsImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceStorageConfigsImpl.java new file mode 100644 index 000000000000..351cae186fc2 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceStorageConfigsImpl.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupResourceStorageConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupResourceConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupResourceConfigResource; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupResourceStorageConfigs; + +public final class BackupResourceStorageConfigsImpl implements BackupResourceStorageConfigs { + private static final ClientLogger LOGGER = new ClientLogger(BackupResourceStorageConfigsImpl.class); + + private final BackupResourceStorageConfigsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + public BackupResourceStorageConfigsImpl(BackupResourceStorageConfigsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String vaultName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, vaultName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BackupResourceConfigResourceImpl(inner.getValue(), this.manager())); + } + + public BackupResourceConfigResource get(String resourceGroupName, String vaultName) { + BackupResourceConfigResourceInner inner = this.serviceClient().get(resourceGroupName, vaultName); + if (inner != null) { + return new BackupResourceConfigResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters, Context context) { + Response inner + = this.serviceClient().updateWithResponse(resourceGroupName, vaultName, parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BackupResourceConfigResourceImpl(inner.getValue(), this.manager())); + } + + public BackupResourceConfigResource update(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters) { + BackupResourceConfigResourceInner inner = this.serviceClient().update(resourceGroupName, vaultName, parameters); + if (inner != null) { + return new BackupResourceConfigResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response patchWithResponse(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters, Context context) { + return this.serviceClient().patchWithResponse(resourceGroupName, vaultName, parameters, context); + } + + public void patch(String resourceGroupName, String vaultName, BackupResourceConfigResourceInner parameters) { + this.serviceClient().patch(resourceGroupName, vaultName, parameters); + } + + private BackupResourceStorageConfigsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupUsageSummariesCRRsClientImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupUsageSummariesCRRsClientImpl.java new file mode 100644 index 000000000000..7a643949cf49 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupUsageSummariesCRRsClientImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupUsageSummariesCRRsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupManagementUsageListInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BackupUsageSummariesCRRsClient. + */ +public final class BackupUsageSummariesCRRsClientImpl implements BackupUsageSummariesCRRsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BackupUsageSummariesCRRsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupCrrManagementClientImpl client; + + /** + * Initializes an instance of BackupUsageSummariesCRRsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupUsageSummariesCRRsClientImpl(RecoveryServicesBackupCrrManagementClientImpl client) { + this.service = RestProxy.create(BackupUsageSummariesCRRsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupCrrManagementClientBackupUsageSummariesCRRs to + * be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupCrrManagementClientBackupUsageSummariesCRRs") + public interface BackupUsageSummariesCRRsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupUsageSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupUsageSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup management usage for vault along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String vaultName, String filter, String skipToken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, filter, skipToken, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup management usage for vault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String vaultName) { + final String filter = null; + final String skipToken = null; + return listWithResponseAsync(resourceGroupName, vaultName, filter, skipToken) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @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 backup management usage for vault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String vaultName, + String filter, String skipToken, Context context) { + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, filter, skipToken, accept, context); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup management usage for vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupManagementUsageListInner list(String resourceGroupName, String vaultName) { + final String filter = null; + final String skipToken = null; + return listWithResponse(resourceGroupName, vaultName, filter, skipToken, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupUsageSummariesCRRsImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupUsageSummariesCRRsImpl.java new file mode 100644 index 000000000000..14488c2600c2 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupUsageSummariesCRRsImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupUsageSummariesCRRsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupManagementUsageListInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementUsageList; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupUsageSummariesCRRs; + +public final class BackupUsageSummariesCRRsImpl implements BackupUsageSummariesCRRs { + private static final ClientLogger LOGGER = new ClientLogger(BackupUsageSummariesCRRsImpl.class); + + private final BackupUsageSummariesCRRsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + public BackupUsageSummariesCRRsImpl(BackupUsageSummariesCRRsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(String resourceGroupName, String vaultName, + String filter, String skipToken, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, vaultName, filter, skipToken, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BackupManagementUsageListImpl(inner.getValue(), this.manager())); + } + + public BackupManagementUsageList list(String resourceGroupName, String vaultName) { + BackupManagementUsageListInner inner = this.serviceClient().list(resourceGroupName, vaultName); + if (inner != null) { + return new BackupManagementUsageListImpl(inner, this.manager()); + } else { + return null; + } + } + + private BackupUsageSummariesCRRsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrossRegionRestoresClientImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrossRegionRestoresClientImpl.java new file mode 100644 index 000000000000..9c0d8d926e19 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrossRegionRestoresClientImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrossRegionRestoresClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrossRegionRestoreRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CrossRegionRestoresClient. + */ +public final class CrossRegionRestoresClientImpl implements CrossRegionRestoresClient { + /** + * The proxy service used to perform REST calls. + */ + private final CrossRegionRestoresService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupCrrManagementClientImpl client; + + /** + * Initializes an instance of CrossRegionRestoresClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrossRegionRestoresClientImpl(RecoveryServicesBackupCrrManagementClientImpl client) { + this.service = RestProxy.create(CrossRegionRestoresService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupCrrManagementClientCrossRegionRestores to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupCrrManagementClientCrossRegionRestores") + public interface CrossRegionRestoresService { + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> trigger(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") CrossRegionRestoreRequest parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response triggerSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("azureRegion") String azureRegion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") CrossRegionRestoreRequest parameters, Context context); + } + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> triggerWithResponseAsync(String azureRegion, CrossRegionRestoreRequest parameters) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.trigger(this.client.getEndpoint(), this.client.getApiVersion(), azureRegion, + this.client.getSubscriptionId(), contentType, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerAsync(String azureRegion, CrossRegionRestoreRequest parameters) { + return triggerWithResponseAsync(azureRegion, parameters).flatMap(ignored -> Mono.empty()); + } + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response triggerWithResponse(String azureRegion, CrossRegionRestoreRequest parameters, + Context context) { + final String contentType = "application/json"; + return service.triggerSync(this.client.getEndpoint(), this.client.getApiVersion(), azureRegion, + this.client.getSubscriptionId(), contentType, parameters, context); + } + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void trigger(String azureRegion, CrossRegionRestoreRequest parameters) { + triggerWithResponse(azureRegion, parameters, Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrossRegionRestoresImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrossRegionRestoresImpl.java new file mode 100644 index 000000000000..25603fc3673f --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrossRegionRestoresImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrossRegionRestoresClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrossRegionRestoreRequest; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrossRegionRestores; + +public final class CrossRegionRestoresImpl implements CrossRegionRestores { + private static final ClientLogger LOGGER = new ClientLogger(CrossRegionRestoresImpl.class); + + private final CrossRegionRestoresClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + public CrossRegionRestoresImpl(CrossRegionRestoresClient innerClient, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response triggerWithResponse(String azureRegion, CrossRegionRestoreRequest parameters, + Context context) { + return this.serviceClient().triggerWithResponse(azureRegion, parameters, context); + } + + public void trigger(String azureRegion, CrossRegionRestoreRequest parameters) { + this.serviceClient().trigger(azureRegion, parameters); + } + + private CrossRegionRestoresClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrAccessTokenResourceImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrAccessTokenResourceImpl.java new file mode 100644 index 000000000000..388e6df98f3d --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrAccessTokenResourceImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.CrrAccessTokenResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrAccessToken; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrAccessTokenResource; +import java.util.Collections; +import java.util.Map; + +public final class CrrAccessTokenResourceImpl implements CrrAccessTokenResource { + private CrrAccessTokenResourceInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + CrrAccessTokenResourceImpl(CrrAccessTokenResourceInner innerObject, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public CrrAccessToken properties() { + return this.innerModel().properties(); + } + + public String eTag() { + return this.innerModel().eTag(); + } + + public CrrAccessTokenResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationResultsClientImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationResultsClientImpl.java new file mode 100644 index 000000000000..9a87e87d681c --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationResultsClientImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrrOperationResultsClient; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CrrOperationResultsClient. + */ +public final class CrrOperationResultsClientImpl implements CrrOperationResultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CrrOperationResultsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupCrrManagementClientImpl client; + + /** + * Initializes an instance of CrrOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrrOperationResultsClientImpl(RecoveryServicesBackupCrrManagementClientImpl client) { + this.service = RestProxy.create(CrrOperationResultsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupCrrManagementClientCrrOperationResults to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupCrrManagementClientCrrOperationResults") + public interface CrrOperationResultsService { + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationResults/{operationId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("azureRegion") String azureRegion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("operationId") String operationId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationResults/{operationId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("azureRegion") String azureRegion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("operationId") String operationId, Context context); + } + + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String azureRegion, String operationId) { + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), azureRegion, + this.client.getSubscriptionId(), operationId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String azureRegion, String operationId) { + return getWithResponseAsync(azureRegion, operationId).flatMap(ignored -> Mono.empty()); + } + + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String azureRegion, String operationId, Context context) { + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), azureRegion, + this.client.getSubscriptionId(), operationId, context); + } + + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void get(String azureRegion, String operationId) { + getWithResponse(azureRegion, operationId, Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationResultsImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationResultsImpl.java new file mode 100644 index 000000000000..78c38f115dda --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationResultsImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrrOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrOperationResults; + +public final class CrrOperationResultsImpl implements CrrOperationResults { + private static final ClientLogger LOGGER = new ClientLogger(CrrOperationResultsImpl.class); + + private final CrrOperationResultsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + public CrrOperationResultsImpl(CrrOperationResultsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String azureRegion, String operationId, Context context) { + return this.serviceClient().getWithResponse(azureRegion, operationId, context); + } + + public void get(String azureRegion, String operationId) { + this.serviceClient().get(azureRegion, operationId); + } + + private CrrOperationResultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationStatusClientImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationStatusClientImpl.java new file mode 100644 index 000000000000..d6fe168cf38d --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationStatusClientImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrrOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CrrOperationStatusClient. + */ +public final class CrrOperationStatusClientImpl implements CrrOperationStatusClient { + /** + * The proxy service used to perform REST calls. + */ + private final CrrOperationStatusService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupCrrManagementClientImpl client; + + /** + * Initializes an instance of CrrOperationStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrrOperationStatusClientImpl(RecoveryServicesBackupCrrManagementClientImpl client) { + this.service = RestProxy.create(CrrOperationStatusService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupCrrManagementClientCrrOperationStatus to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupCrrManagementClientCrrOperationStatus") + public interface CrrOperationStatusService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationsStatus/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationsStatus/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String azureRegion, String operationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), azureRegion, + this.client.getSubscriptionId(), operationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String azureRegion, String operationId) { + return getWithResponseAsync(azureRegion, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String azureRegion, String operationId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), azureRegion, + this.client.getSubscriptionId(), operationId, accept, context); + } + + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get(String azureRegion, String operationId) { + return getWithResponse(azureRegion, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationStatusImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationStatusImpl.java new file mode 100644 index 000000000000..9262443b8cbb --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationStatusImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrrOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrOperationStatus; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatus; + +public final class CrrOperationStatusImpl implements CrrOperationStatus { + private static final ClientLogger LOGGER = new ClientLogger(CrrOperationStatusImpl.class); + + private final CrrOperationStatusClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + public CrrOperationStatusImpl(CrrOperationStatusClient innerClient, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String azureRegion, String operationId, Context context) { + Response inner = this.serviceClient().getWithResponse(azureRegion, operationId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } + + public OperationStatus get(String azureRegion, String operationId) { + OperationStatusInner inner = this.serviceClient().get(azureRegion, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private CrrOperationStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/JobResourceImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/JobResourceImpl.java new file mode 100644 index 000000000000..506ef3340ed9 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/JobResourceImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.Job; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.JobResource; +import java.util.Collections; +import java.util.Map; + +public final class JobResourceImpl implements JobResource { + private JobResourceInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + JobResourceImpl(JobResourceInner innerObject, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Job properties() { + return this.innerModel().properties(); + } + + public String eTag() { + return this.innerModel().eTag(); + } + + public JobResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/JobResourceListImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/JobResourceListImpl.java new file mode 100644 index 000000000000..6041df08c1cd --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/JobResourceListImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceListInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.JobResource; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.JobResourceList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class JobResourceListImpl implements JobResourceList { + private JobResourceListInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + JobResourceListImpl(JobResourceListInner innerObject, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList( + inner.stream().map(inner1 -> new JobResourceImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public JobResourceListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/OperationStatusImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/OperationStatusImpl.java new file mode 100644 index 000000000000..adee36eccb4b --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/OperationStatusImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatus; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatusError; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatusExtendedInfo; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatusValues; +import java.time.OffsetDateTime; + +public final class OperationStatusImpl implements OperationStatus { + private OperationStatusInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + OperationStatusImpl(OperationStatusInner innerObject, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public OperationStatusValues status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public OperationStatusError error() { + return this.innerModel().error(); + } + + public OperationStatusExtendedInfo properties() { + return this.innerModel().properties(); + } + + public OperationStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/ProtectedItemResourceListImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/ProtectedItemResourceListImpl.java new file mode 100644 index 000000000000..0280c96050d8 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/ProtectedItemResourceListImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.ProtectedItemResourceListInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ProtectedItemResource; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ProtectedItemResourceList; +import java.util.Collections; +import java.util.List; + +public final class ProtectedItemResourceListImpl implements ProtectedItemResourceList { + private ProtectedItemResourceListInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + ProtectedItemResourceListImpl(ProtectedItemResourceListInner innerObject, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProtectedItemResourceListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointResourceImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointResourceImpl.java new file mode 100644 index 000000000000..d9e4cc033f2b --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointResourceImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPoint; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPointResource; +import java.util.Collections; +import java.util.Map; + +public final class RecoveryPointResourceImpl implements RecoveryPointResource { + private RecoveryPointResourceInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + RecoveryPointResourceImpl(RecoveryPointResourceInner innerObject, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public RecoveryPoint properties() { + return this.innerModel().properties(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String location() { + return this.innerModel().location(); + } + + public String eTag() { + return this.innerModel().eTag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public RecoveryPointResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsClientImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsClientImpl.java new file mode 100644 index 000000000000..893118fbf8f2 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsClientImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.AADPropertiesResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.CrrAccessTokenResourceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RecoveryPointsClient. + */ +public final class RecoveryPointsClientImpl implements RecoveryPointsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RecoveryPointsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupCrrManagementClientImpl client; + + /** + * Initializes an instance of RecoveryPointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecoveryPointsClientImpl(RecoveryServicesBackupCrrManagementClientImpl client) { + this.service + = RestProxy.create(RecoveryPointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupCrrManagementClientRecoveryPoints to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupCrrManagementClientRecoveryPoints") + public interface RecoveryPointsService { + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 400 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAccessToken(@HostParam("endpoint") 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, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AADPropertiesResourceInner parameters, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 400 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getAccessTokenSync(@HostParam("endpoint") 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, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AADPropertiesResourceInner parameters, + Context context); + } + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAccessTokenWithResponseAsync(String resourceGroupName, + String vaultName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, + AADPropertiesResourceInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getAccessToken(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, + protectedItemName, recoveryPointId, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAccessTokenAsync(String resourceGroupName, String vaultName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId, + AADPropertiesResourceInner parameters) { + return getAccessTokenWithResponseAsync(resourceGroupName, vaultName, fabricName, containerName, + protectedItemName, recoveryPointId, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @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 ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAccessTokenWithResponse(String resourceGroupName, String vaultName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId, + AADPropertiesResourceInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.getAccessTokenSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, protectedItemName, + recoveryPointId, contentType, accept, parameters, context); + } + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CrrAccessTokenResourceInner getAccessToken(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName, String recoveryPointId, AADPropertiesResourceInner parameters) { + return getAccessTokenWithResponse(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, + recoveryPointId, parameters, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsCrrsClientImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsCrrsClientImpl.java new file mode 100644 index 000000000000..d31e0161f0d4 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsCrrsClientImpl.java @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryPointsCrrsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.models.RecoveryPointResourceList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RecoveryPointsCrrsClient. + */ +public final class RecoveryPointsCrrsClientImpl implements RecoveryPointsCrrsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RecoveryPointsCrrsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupCrrManagementClientImpl client; + + /** + * Initializes an instance of RecoveryPointsCrrsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecoveryPointsCrrsClientImpl(RecoveryServicesBackupCrrManagementClientImpl client) { + this.service = RestProxy.create(RecoveryPointsCrrsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupCrrManagementClientRecoveryPointsCrrs to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupCrrManagementClientRecoveryPointsCrrs") + public interface RecoveryPointsCrrsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") 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, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") 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, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Provides the information of the backed up data identified using 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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> getWithResponseAsync(String resourceGroupName, String vaultName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, + protectedItemName, recoveryPointId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Provides the information of the backed up data identified using 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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getAsync(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName, String recoveryPointId) { + return getWithResponseAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, + recoveryPointId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Provides the information of the backed up data identified using 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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @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 getWithResponse(String resourceGroupName, String vaultName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, accept, + context); + } + + /** + * Provides the information of the backed up data identified using 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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 get(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName, String recoveryPointId) { + return getWithResponse(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, + recoveryPointId, Context.NONE).getValue(); + } + + /** + * Lists the backup copies for the backed up item. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String vaultName, String fabricName, String containerName, String protectedItemName, String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, + protectedItemName, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the backup copies for the backed up item. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, + String fabricName, String containerName, String protectedItemName, String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, vaultName, fabricName, containerName, + protectedItemName, filter)); + } + + /** + * Lists the backup copies for the backed up item. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, + String fabricName, String containerName, String protectedItemName) { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, vaultName, fabricName, containerName, + protectedItemName, filter)); + } + + /** + * Lists the backup copies for the backed up item. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String vaultName, + String fabricName, String containerName, String protectedItemName, String filter) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, + containerName, protectedItemName, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); + } + + /** + * Lists the backup copies for the backed up item. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param filter OData filter options. + * @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 list of RecoveryPoint resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String vaultName, + String fabricName, String containerName, String protectedItemName, String filter, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, fabricName, containerName, protectedItemName, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); + } + + /** + * Lists the backup copies for the backed up item. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName) { + final String filter = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, filter)); + } + + /** + * Lists the backup copies for the backed up item. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param filter OData filter options. + * @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 list of RecoveryPoint resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName, String filter, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, vaultName, fabricName, containerName, + protectedItemName, filter, context)); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsCrrsImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsCrrsImpl.java new file mode 100644 index 000000000000..644d0e25732e --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsCrrsImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryPointsCrrsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPointResource; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPointsCrrs; + +public final class RecoveryPointsCrrsImpl implements RecoveryPointsCrrs { + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPointsCrrsImpl.class); + + private final RecoveryPointsCrrsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + public RecoveryPointsCrrsImpl(RecoveryPointsCrrsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String vaultName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, + recoveryPointId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RecoveryPointResourceImpl(inner.getValue(), this.manager())); + } + + public RecoveryPointResource get(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName, String recoveryPointId) { + RecoveryPointResourceInner inner = this.serviceClient() + .get(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId); + if (inner != null) { + return new RecoveryPointResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, vaultName, fabricName, containerName, protectedItemName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName, String filter, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); + } + + private RecoveryPointsCrrsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsImpl.java new file mode 100644 index 000000000000..8305cad881a6 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.AADPropertiesResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.CrrAccessTokenResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrAccessTokenResource; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPoints; + +public final class RecoveryPointsImpl implements RecoveryPoints { + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPointsImpl.class); + + private final RecoveryPointsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager; + + public RecoveryPointsImpl(RecoveryPointsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getAccessTokenWithResponse(String resourceGroupName, String vaultName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId, + AADPropertiesResourceInner parameters, Context context) { + Response inner = this.serviceClient() + .getAccessTokenWithResponse(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, + recoveryPointId, parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CrrAccessTokenResourceImpl(inner.getValue(), this.manager())); + } + + public CrrAccessTokenResource getAccessToken(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName, String recoveryPointId, AADPropertiesResourceInner parameters) { + CrrAccessTokenResourceInner inner = this.serviceClient() + .getAccessToken(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, + parameters); + if (inner != null) { + return new CrrAccessTokenResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private RecoveryPointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager + manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryServicesBackupCrrManagementClientBuilder.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryServicesBackupCrrManagementClientBuilder.java new file mode 100644 index 000000000000..6adcb419d714 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryServicesBackupCrrManagementClientBuilder.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the RecoveryServicesBackupCrrManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { RecoveryServicesBackupCrrManagementClientImpl.class }) +public final class RecoveryServicesBackupCrrManagementClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the RecoveryServicesBackupCrrManagementClientBuilder. + */ + public RecoveryServicesBackupCrrManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the RecoveryServicesBackupCrrManagementClientBuilder. + */ + public RecoveryServicesBackupCrrManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the RecoveryServicesBackupCrrManagementClientBuilder. + */ + public RecoveryServicesBackupCrrManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the RecoveryServicesBackupCrrManagementClientBuilder. + */ + public RecoveryServicesBackupCrrManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the RecoveryServicesBackupCrrManagementClientBuilder. + */ + public RecoveryServicesBackupCrrManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the RecoveryServicesBackupCrrManagementClientBuilder. + */ + public RecoveryServicesBackupCrrManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of RecoveryServicesBackupCrrManagementClientImpl with the provided parameters. + * + * @return an instance of RecoveryServicesBackupCrrManagementClientImpl. + */ + public RecoveryServicesBackupCrrManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + RecoveryServicesBackupCrrManagementClientImpl client + = new RecoveryServicesBackupCrrManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryServicesBackupCrrManagementClientImpl.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryServicesBackupCrrManagementClientImpl.java new file mode 100644 index 000000000000..a9ba76c52550 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryServicesBackupCrrManagementClientImpl.java @@ -0,0 +1,468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +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.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.AadPropertiesOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupCrrJobDetailsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupCrrJobsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupProtectedItemsCrrsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupResourceStorageConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupUsageSummariesCRRsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrossRegionRestoresClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrrOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrrOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryPointsCrrsClient; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryServicesBackupCrrManagementClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the RecoveryServicesBackupCrrManagementClientImpl type. + */ +@ServiceClient(builder = RecoveryServicesBackupCrrManagementClientBuilder.class) +public final class RecoveryServicesBackupCrrManagementClientImpl implements RecoveryServicesBackupCrrManagementClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The BackupResourceStorageConfigsClient object to access its operations. + */ + private final BackupResourceStorageConfigsClient backupResourceStorageConfigs; + + /** + * Gets the BackupResourceStorageConfigsClient object to access its operations. + * + * @return the BackupResourceStorageConfigsClient object. + */ + public BackupResourceStorageConfigsClient getBackupResourceStorageConfigs() { + return this.backupResourceStorageConfigs; + } + + /** + * The RecoveryPointsCrrsClient object to access its operations. + */ + private final RecoveryPointsCrrsClient recoveryPointsCrrs; + + /** + * Gets the RecoveryPointsCrrsClient object to access its operations. + * + * @return the RecoveryPointsCrrsClient object. + */ + public RecoveryPointsCrrsClient getRecoveryPointsCrrs() { + return this.recoveryPointsCrrs; + } + + /** + * The RecoveryPointsClient object to access its operations. + */ + private final RecoveryPointsClient recoveryPoints; + + /** + * Gets the RecoveryPointsClient object to access its operations. + * + * @return the RecoveryPointsClient object. + */ + public RecoveryPointsClient getRecoveryPoints() { + return this.recoveryPoints; + } + + /** + * The BackupUsageSummariesCRRsClient object to access its operations. + */ + private final BackupUsageSummariesCRRsClient backupUsageSummariesCRRs; + + /** + * Gets the BackupUsageSummariesCRRsClient object to access its operations. + * + * @return the BackupUsageSummariesCRRsClient object. + */ + public BackupUsageSummariesCRRsClient getBackupUsageSummariesCRRs() { + return this.backupUsageSummariesCRRs; + } + + /** + * The AadPropertiesOperationsClient object to access its operations. + */ + private final AadPropertiesOperationsClient aadPropertiesOperations; + + /** + * Gets the AadPropertiesOperationsClient object to access its operations. + * + * @return the AadPropertiesOperationsClient object. + */ + public AadPropertiesOperationsClient getAadPropertiesOperations() { + return this.aadPropertiesOperations; + } + + /** + * The CrossRegionRestoresClient object to access its operations. + */ + private final CrossRegionRestoresClient crossRegionRestores; + + /** + * Gets the CrossRegionRestoresClient object to access its operations. + * + * @return the CrossRegionRestoresClient object. + */ + public CrossRegionRestoresClient getCrossRegionRestores() { + return this.crossRegionRestores; + } + + /** + * The BackupCrrJobDetailsClient object to access its operations. + */ + private final BackupCrrJobDetailsClient backupCrrJobDetails; + + /** + * Gets the BackupCrrJobDetailsClient object to access its operations. + * + * @return the BackupCrrJobDetailsClient object. + */ + public BackupCrrJobDetailsClient getBackupCrrJobDetails() { + return this.backupCrrJobDetails; + } + + /** + * The BackupCrrJobsClient object to access its operations. + */ + private final BackupCrrJobsClient backupCrrJobs; + + /** + * Gets the BackupCrrJobsClient object to access its operations. + * + * @return the BackupCrrJobsClient object. + */ + public BackupCrrJobsClient getBackupCrrJobs() { + return this.backupCrrJobs; + } + + /** + * The CrrOperationResultsClient object to access its operations. + */ + private final CrrOperationResultsClient crrOperationResults; + + /** + * Gets the CrrOperationResultsClient object to access its operations. + * + * @return the CrrOperationResultsClient object. + */ + public CrrOperationResultsClient getCrrOperationResults() { + return this.crrOperationResults; + } + + /** + * The CrrOperationStatusClient object to access its operations. + */ + private final CrrOperationStatusClient crrOperationStatus; + + /** + * Gets the CrrOperationStatusClient object to access its operations. + * + * @return the CrrOperationStatusClient object. + */ + public CrrOperationStatusClient getCrrOperationStatus() { + return this.crrOperationStatus; + } + + /** + * The BackupProtectedItemsCrrsClient object to access its operations. + */ + private final BackupProtectedItemsCrrsClient backupProtectedItemsCrrs; + + /** + * Gets the BackupProtectedItemsCrrsClient object to access its operations. + * + * @return the BackupProtectedItemsCrrsClient object. + */ + public BackupProtectedItemsCrrsClient getBackupProtectedItemsCrrs() { + return this.backupProtectedItemsCrrs; + } + + /** + * Initializes an instance of RecoveryServicesBackupCrrManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + */ + RecoveryServicesBackupCrrManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-07-15"; + this.backupResourceStorageConfigs = new BackupResourceStorageConfigsClientImpl(this); + this.recoveryPointsCrrs = new RecoveryPointsCrrsClientImpl(this); + this.recoveryPoints = new RecoveryPointsClientImpl(this); + this.backupUsageSummariesCRRs = new BackupUsageSummariesCRRsClientImpl(this); + this.aadPropertiesOperations = new AadPropertiesOperationsClientImpl(this); + this.crossRegionRestores = new CrossRegionRestoresClientImpl(this); + this.backupCrrJobDetails = new BackupCrrJobDetailsClientImpl(this); + this.backupCrrJobs = new BackupCrrJobsClientImpl(this); + this.crrOperationResults = new CrrOperationResultsClientImpl(this); + this.crrOperationStatus = new CrrOperationStatusClientImpl(this); + this.backupProtectedItemsCrrs = new BackupProtectedItemsCrrsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryServicesBackupCrrManagementClientImpl.class); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/ResourceManagerUtils.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..3d09d9ab676d --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/models/RecoveryPointResourceList.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/models/RecoveryPointResourceList.java new file mode 100644 index 000000000000..4f9c735104db --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/models/RecoveryPointResourceList.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ResourceList; +import java.io.IOException; +import java.util.List; + +/** + * List of RecoveryPoint resources. + */ +@Immutable +public final class RecoveryPointResourceList extends ResourceList { + /* + * List of resources. + */ + private List value; + + /* + * The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of RecoveryPointResourceList class. + */ + private RecoveryPointResourceList() { + } + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The uri to fetch the next page of resources. Call ListNext() fetches next page of + * resources. + * + * @return the nextLink value. + */ + @Override + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", nextLink()); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryPointResourceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryPointResourceList 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 RecoveryPointResourceList. + */ + public static RecoveryPointResourceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryPointResourceList deserializedRecoveryPointResourceList = new RecoveryPointResourceList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedRecoveryPointResourceList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> RecoveryPointResourceInner.fromJson(reader1)); + deserializedRecoveryPointResourceList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPointResourceList; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/package-info.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/package-info.java new file mode 100644 index 000000000000..6d27049cac5c --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for RecoveryServicesBackupCrr. + * Open API 2.0 Specs for Azure Recovery Services Backup CRR (Cross Region Restore) service. + */ +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation; diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AADProperties.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AADProperties.java new file mode 100644 index 000000000000..e2f9a583ceeb --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AADProperties.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The AADProperties model. + */ +@Fluent +public final class AADProperties implements JsonSerializable { + /* + * The servicePrincipalClientId property. + */ + private String servicePrincipalClientId; + + /* + * The tenantId property. + */ + private String tenantId; + + /* + * The authority property. + */ + private String authority; + + /* + * The audience property. + */ + private String audience; + + /* + * The servicePrincipalObjectId property. + */ + private String servicePrincipalObjectId; + + /** + * Creates an instance of AADProperties class. + */ + public AADProperties() { + } + + /** + * Get the servicePrincipalClientId property: The servicePrincipalClientId property. + * + * @return the servicePrincipalClientId value. + */ + public String servicePrincipalClientId() { + return this.servicePrincipalClientId; + } + + /** + * Set the servicePrincipalClientId property: The servicePrincipalClientId property. + * + * @param servicePrincipalClientId the servicePrincipalClientId value to set. + * @return the AADProperties object itself. + */ + public AADProperties withServicePrincipalClientId(String servicePrincipalClientId) { + this.servicePrincipalClientId = servicePrincipalClientId; + return this; + } + + /** + * Get the tenantId property: The tenantId property. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenantId property. + * + * @param tenantId the tenantId value to set. + * @return the AADProperties object itself. + */ + public AADProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the authority property: The authority property. + * + * @return the authority value. + */ + public String authority() { + return this.authority; + } + + /** + * Set the authority property: The authority property. + * + * @param authority the authority value to set. + * @return the AADProperties object itself. + */ + public AADProperties withAuthority(String authority) { + this.authority = authority; + return this; + } + + /** + * Get the audience property: The audience property. + * + * @return the audience value. + */ + public String audience() { + return this.audience; + } + + /** + * Set the audience property: The audience property. + * + * @param audience the audience value to set. + * @return the AADProperties object itself. + */ + public AADProperties withAudience(String audience) { + this.audience = audience; + return this; + } + + /** + * Get the servicePrincipalObjectId property: The servicePrincipalObjectId property. + * + * @return the servicePrincipalObjectId value. + */ + public String servicePrincipalObjectId() { + return this.servicePrincipalObjectId; + } + + /** + * Set the servicePrincipalObjectId property: The servicePrincipalObjectId property. + * + * @param servicePrincipalObjectId the servicePrincipalObjectId value to set. + * @return the AADProperties object itself. + */ + public AADProperties withServicePrincipalObjectId(String servicePrincipalObjectId) { + this.servicePrincipalObjectId = servicePrincipalObjectId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("servicePrincipalClientId", this.servicePrincipalClientId); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("authority", this.authority); + jsonWriter.writeStringField("audience", this.audience); + jsonWriter.writeStringField("servicePrincipalObjectId", this.servicePrincipalObjectId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AADProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AADProperties 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 AADProperties. + */ + public static AADProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AADProperties deserializedAADProperties = new AADProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("servicePrincipalClientId".equals(fieldName)) { + deserializedAADProperties.servicePrincipalClientId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedAADProperties.tenantId = reader.getString(); + } else if ("authority".equals(fieldName)) { + deserializedAADProperties.authority = reader.getString(); + } else if ("audience".equals(fieldName)) { + deserializedAADProperties.audience = reader.getString(); + } else if ("servicePrincipalObjectId".equals(fieldName)) { + deserializedAADProperties.servicePrincipalObjectId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAADProperties; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AADPropertiesResource.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AADPropertiesResource.java new file mode 100644 index 000000000000..7aa2e36f3ffd --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AADPropertiesResource.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.AADPropertiesResourceInner; +import java.util.Map; + +/** + * An immutable client-side representation of AADPropertiesResource. + */ +public interface AADPropertiesResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: AADPropertiesResource properties. + * + * @return the properties value. + */ + AADProperties properties(); + + /** + * Gets the eTag property: Optional ETag. + * + * @return the eTag value. + */ + String eTag(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.AADPropertiesResourceInner + * object. + * + * @return the inner object. + */ + AADPropertiesResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AadPropertiesOperations.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AadPropertiesOperations.java new file mode 100644 index 000000000000..42d925c0abef --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AadPropertiesOperations.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AadPropertiesOperations. + */ +public interface AadPropertiesOperations { + /** + * Fetches the AAD properties from target region BCM stamp. + * + * Gets the Azure Active Directory properties from the target-region Backup Management stamp, used to authorize a + * cross-region restore operation. + * + * @param azureRegion Azure region to hit Api. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response getWithResponse(String azureRegion, String filter, Context context); + + /** + * Fetches the AAD properties from target region BCM stamp. + * + * Gets the Azure Active Directory properties from the target-region Backup Management stamp, used to authorize a + * cross-region restore operation. + * + * @param azureRegion Azure region to hit Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + AADPropertiesResource get(String azureRegion); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ArmResource.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ArmResource.java new file mode 100644 index 000000000000..f25c5c5e93fd --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ArmResource.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Resource + * + * Common fields that are returned in the response for all Azure Resource Manager resources. + */ +@Immutable +public class ArmResource implements JsonSerializable { + /* + * Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{ + * resourceType}/{resourceName} + */ + private String id; + + /* + * The name of the resource + */ + private String name; + + /* + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + */ + private String type; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /** + * Creates an instance of ArmResource class. + */ + public ArmResource() { + } + + /** + * Get the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @param id the id value to set. + * @return the ArmResource object itself. + */ + ArmResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource. + * + * @param name the name value to set. + * @return the ArmResource object itself. + */ + ArmResource withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts". + * + * @param type the type value to set. + * @return the ArmResource object itself. + */ + ArmResource withType(String type) { + this.type = type; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the ArmResource object itself. + */ + ArmResource withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArmResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArmResource 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 ArmResource. + */ + public static ArmResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArmResource deserializedArmResource = new ArmResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedArmResource.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedArmResource.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedArmResource.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedArmResource.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedArmResource; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileShareRecoveryPoint.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileShareRecoveryPoint.java new file mode 100644 index 000000000000..24976b6c1ffa --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileShareRecoveryPoint.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Azure File Share workload specific backup copy. + */ +@Immutable +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. + */ + private String objectType = "AzureFileShareRecoveryPoint"; + + /* + * Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. + */ + private String recoveryPointType; + + /* + * Time at which this backup copy was created. + */ + private OffsetDateTime recoveryPointTime; + + /* + * Contains Url to the snapshot of fileshare, if applicable + */ + private String fileShareSnapshotUri; + + /* + * Contains recovery point size + */ + private Integer recoveryPointSizeInGB; + + /* + * Properties of Recovery Point + */ + private RecoveryPointProperties recoveryPointProperties; + + /** + * Creates an instance of AzureFileShareRecoveryPoint class. + */ + private AzureFileShareRecoveryPoint() { + } + + /** + * 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 recoveryPointType property: Type of the backup copy. Specifies whether it is a crash consistent backup or + * app consistent. + * + * @return the recoveryPointType value. + */ + public String recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Get the recoveryPointTime property: Time at which this backup copy was created. + * + * @return the recoveryPointTime value. + */ + public OffsetDateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Get the fileShareSnapshotUri property: Contains Url to the snapshot of fileshare, if applicable. + * + * @return the fileShareSnapshotUri value. + */ + public String fileShareSnapshotUri() { + return this.fileShareSnapshotUri; + } + + /** + * Get the recoveryPointSizeInGB property: Contains recovery point size. + * + * @return the recoveryPointSizeInGB value. + */ + public Integer recoveryPointSizeInGB() { + return this.recoveryPointSizeInGB; + } + + /** + * Get the recoveryPointProperties property: Properties of Recovery Point. + * + * @return the recoveryPointProperties value. + */ + public RecoveryPointProperties recoveryPointProperties() { + return this.recoveryPointProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + 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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileShareRestoreRequest.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileShareRestoreRequest.java new file mode 100644 index 000000000000..b40d8c1dcefd --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileShareRestoreRequest.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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; + +/** + * AzureFileShare Restore Request. + */ +@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. + */ + private String objectType = "AzureFileShareRestoreRequest"; + + /* + * Type of this recovery. + */ + private RecoveryType recoveryType; + + /* + * Source storage account ARM Id + */ + private String sourceResourceId; + + /* + * Options to resolve copy conflicts. + */ + private CopyOptions copyOptions; + + /* + * Restore Type (FullShareRestore or ItemLevelRestore) + */ + private RestoreRequestType restoreRequestType; + + /* + * List of Source Files/Folders(which need to recover) and TargetFolderPath details + */ + private List restoreFileSpecs; + + /* + * Target File Share Details + */ + private TargetAFSRestoreInfo targetDetails; + + /** + * Creates an instance of AzureFileShareRestoreRequest class. + */ + public AzureFileShareRestoreRequest() { + } + + /** + * 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 recoveryType property: Type of this recovery. + * + * @return the recoveryType value. + */ + public RecoveryType recoveryType() { + return this.recoveryType; + } + + /** + * Set the recoveryType property: Type of this recovery. + * + * @param recoveryType the recoveryType value to set. + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withRecoveryType(RecoveryType recoveryType) { + this.recoveryType = recoveryType; + return this; + } + + /** + * Get the sourceResourceId property: Source storage account ARM Id. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: Source storage account ARM Id. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the copyOptions property: Options to resolve copy conflicts. + * + * @return the copyOptions value. + */ + public CopyOptions copyOptions() { + return this.copyOptions; + } + + /** + * Set the copyOptions property: Options to resolve copy conflicts. + * + * @param copyOptions the copyOptions value to set. + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withCopyOptions(CopyOptions copyOptions) { + this.copyOptions = copyOptions; + return this; + } + + /** + * Get the restoreRequestType property: Restore Type (FullShareRestore or ItemLevelRestore). + * + * @return the restoreRequestType value. + */ + public RestoreRequestType restoreRequestType() { + return this.restoreRequestType; + } + + /** + * Set the restoreRequestType property: Restore Type (FullShareRestore or ItemLevelRestore). + * + * @param restoreRequestType the restoreRequestType value to set. + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withRestoreRequestType(RestoreRequestType restoreRequestType) { + this.restoreRequestType = restoreRequestType; + return this; + } + + /** + * Get the restoreFileSpecs property: List of Source Files/Folders(which need to recover) and TargetFolderPath + * details. + * + * @return the restoreFileSpecs value. + */ + public List restoreFileSpecs() { + return this.restoreFileSpecs; + } + + /** + * Set the restoreFileSpecs property: List of Source Files/Folders(which need to recover) and TargetFolderPath + * details. + * + * @param restoreFileSpecs the restoreFileSpecs value to set. + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withRestoreFileSpecs(List restoreFileSpecs) { + this.restoreFileSpecs = restoreFileSpecs; + return this; + } + + /** + * Get the targetDetails property: Target File Share Details. + * + * @return the targetDetails value. + */ + public TargetAFSRestoreInfo targetDetails() { + return this.targetDetails; + } + + /** + * Set the targetDetails property: Target File Share Details. + * + * @param targetDetails the targetDetails value to set. + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withTargetDetails(TargetAFSRestoreInfo targetDetails) { + this.targetDetails = targetDetails; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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 ("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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileshareProtectedItem.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileshareProtectedItem.java new file mode 100644 index 000000000000..7e0e3f2fc7ab --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileshareProtectedItem.java @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * Azure File Share workload-specific backup item. + */ +@Immutable +public final class AzureFileshareProtectedItem extends ProtectedItem { + /* + * backup item type. + */ + private String protectedItemType = "AzureFileShareProtectedItem"; + + /* + * Friendly name of the fileshare represented by this backup item. + */ + private String friendlyName; + + /* + * Backup status of this backup item. + */ + private String protectionStatus; + + /* + * Backup state of this backup item. + */ + private ProtectionState protectionState; + + /* + * backups running status for this backup item. + */ + private HealthStatus healthStatus; + + /* + * Last backup operation status. Possible values: Healthy, Unhealthy. + */ + private String lastBackupStatus; + + /* + * Timestamp of the last backup operation on this backup item. + */ + private OffsetDateTime lastBackupTime; + + /* + * Health details of different KPIs + */ + private Map kpisHealths; + + /* + * Additional information with this backup item. + */ + private AzureFileshareProtectedItemExtendedInfo extendedInfo; + + /** + * Creates an instance of AzureFileshareProtectedItem class. + */ + private AzureFileshareProtectedItem() { + } + + /** + * Get the protectedItemType property: backup item type. + * + * @return the protectedItemType value. + */ + @Override + public String protectedItemType() { + return this.protectedItemType; + } + + /** + * Get the friendlyName property: Friendly name of the fileshare represented by this backup item. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Get the protectionStatus property: Backup status of this backup item. + * + * @return the protectionStatus value. + */ + public String protectionStatus() { + return this.protectionStatus; + } + + /** + * Get the protectionState property: Backup state of this backup item. + * + * @return the protectionState value. + */ + public ProtectionState protectionState() { + return this.protectionState; + } + + /** + * Get the healthStatus property: backups running status for this backup item. + * + * @return the healthStatus value. + */ + public HealthStatus healthStatus() { + return this.healthStatus; + } + + /** + * Get the lastBackupStatus property: Last backup operation status. Possible values: Healthy, Unhealthy. + * + * @return the lastBackupStatus value. + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item. + * + * @return the lastBackupTime value. + */ + public OffsetDateTime lastBackupTime() { + return this.lastBackupTime; + } + + /** + * Get the kpisHealths property: Health details of different KPIs. + * + * @return the kpisHealths value. + */ + public Map kpisHealths() { + return this.kpisHealths; + } + + /** + * Get the extendedInfo property: Additional information with this backup item. + * + * @return the extendedInfo value. + */ + public AzureFileshareProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupManagementType", + backupManagementType() == null ? null : backupManagementType().toString()); + jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString()); + 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.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("healthStatus", this.healthStatus == null ? null : this.healthStatus.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 + .withBackupManagementType(BackupManagementType.fromString(reader.getString())); + } else if ("workloadType".equals(fieldName)) { + deserializedAzureFileshareProtectedItem + .withWorkloadType(DataSourceType.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 ("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 ("healthStatus".equals(fieldName)) { + deserializedAzureFileshareProtectedItem.healthStatus = HealthStatus.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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileshareProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileshareProtectedItemExtendedInfo.java new file mode 100644 index 000000000000..8870f76c29b1 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileshareProtectedItemExtendedInfo.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Additional information about Azure File Share backup item. + */ +@Immutable +public final class AzureFileshareProtectedItemExtendedInfo + implements JsonSerializable { + /* + * The oldest backup copy available for this item in the service. + */ + private OffsetDateTime oldestRecoveryPoint; + + /* + * Number of available backup copies associated with this backup item. + */ + private Integer recoveryPointCount; + + /* + * Indicates consistency of policy object and policy applied to this backup item. + */ + private String policyState; + + /* + * Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, + * Deleted} + */ + private String resourceState; + + /* + * The resource state sync time for this backup item. + */ + private OffsetDateTime resourceStateSyncTime; + + /** + * Creates an instance of AzureFileshareProtectedItemExtendedInfo class. + */ + private AzureFileshareProtectedItemExtendedInfo() { + } + + /** + * Get the oldestRecoveryPoint property: The oldest backup copy available for this item in the service. + * + * @return the oldestRecoveryPoint value. + */ + public OffsetDateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Get the recoveryPointCount property: Number of available backup copies associated with this backup item. + * + * @return the recoveryPointCount value. + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Get the policyState property: Indicates consistency of policy object and policy applied to this backup item. + * + * @return the policyState value. + */ + public String policyState() { + return this.policyState; + } + + /** + * Get the resourceState property: Indicates the state of this resource. Possible values are from enum ResourceState + * {Invalid, Active, SoftDeleted, Deleted}. + * + * @return the resourceState value. + */ + public String resourceState() { + return this.resourceState; + } + + /** + * Get the resourceStateSyncTime property: The resource state sync time for this backup item. + * + * @return the resourceStateSyncTime value. + */ + public OffsetDateTime resourceStateSyncTime() { + return this.resourceStateSyncTime; + } + + /** + * {@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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSClassicComputeVMProtectedItem.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSClassicComputeVMProtectedItem.java new file mode 100644 index 000000000000..ad7eea676115 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSClassicComputeVMProtectedItem.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * IaaS VM workload-specific backup item representing the Classic Compute VM. + */ +@Immutable +public final class AzureIaaSClassicComputeVMProtectedItem extends AzureIaaSVMProtectedItem { + /* + * backup item type. + */ + private String protectedItemType = "Microsoft.ClassicCompute/virtualMachines"; + + /** + * Creates an instance of AzureIaaSClassicComputeVMProtectedItem class. + */ + private AzureIaaSClassicComputeVMProtectedItem() { + } + + /** + * Get the protectedItemType property: backup item type. + * + * @return the protectedItemType value. + */ + @Override + public String protectedItemType() { + return this.protectedItemType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupManagementType", + backupManagementType() == null ? null : backupManagementType().toString()); + jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString()); + 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.writeStringField("friendlyName", friendlyName()); + jsonWriter.writeStringField("virtualMachineId", virtualMachineId()); + jsonWriter.writeStringField("protectionStatus", protectionStatus()); + jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); + jsonWriter.writeStringField("healthStatus", healthStatus() == null ? null : healthStatus().toString()); + jsonWriter.writeArrayField("healthDetails", healthDetails(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("lastBackupStatus", lastBackupStatus()); + jsonWriter.writeStringField("lastBackupTime", + lastBackupTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastBackupTime())); + jsonWriter.writeStringField("protectedItemDataId", protectedItemDataId()); + 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 + .withBackupManagementType(BackupManagementType.fromString(reader.getString())); + } else if ("workloadType".equals(fieldName)) { + deserializedAzureIaaSClassicComputeVMProtectedItem + .withWorkloadType(DataSourceType.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 ("friendlyName".equals(fieldName)) { + deserializedAzureIaaSClassicComputeVMProtectedItem.withFriendlyName(reader.getString()); + } else if ("virtualMachineId".equals(fieldName)) { + deserializedAzureIaaSClassicComputeVMProtectedItem.withVirtualMachineId(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 + .withHealthStatus(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.withLastBackupTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("protectedItemDataId".equals(fieldName)) { + deserializedAzureIaaSClassicComputeVMProtectedItem.withProtectedItemDataId(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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSComputeVMProtectedItem.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSComputeVMProtectedItem.java new file mode 100644 index 000000000000..f35e78cd7560 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSComputeVMProtectedItem.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + */ +@Immutable +public final class AzureIaaSComputeVMProtectedItem extends AzureIaaSVMProtectedItem { + /* + * backup item type. + */ + private String protectedItemType = "Microsoft.Compute/virtualMachines"; + + /** + * Creates an instance of AzureIaaSComputeVMProtectedItem class. + */ + private AzureIaaSComputeVMProtectedItem() { + } + + /** + * Get the protectedItemType property: backup item type. + * + * @return the protectedItemType value. + */ + @Override + public String protectedItemType() { + return this.protectedItemType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupManagementType", + backupManagementType() == null ? null : backupManagementType().toString()); + jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString()); + 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.writeStringField("friendlyName", friendlyName()); + jsonWriter.writeStringField("virtualMachineId", virtualMachineId()); + jsonWriter.writeStringField("protectionStatus", protectionStatus()); + jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); + jsonWriter.writeStringField("healthStatus", healthStatus() == null ? null : healthStatus().toString()); + jsonWriter.writeArrayField("healthDetails", healthDetails(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("lastBackupStatus", lastBackupStatus()); + jsonWriter.writeStringField("lastBackupTime", + lastBackupTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastBackupTime())); + jsonWriter.writeStringField("protectedItemDataId", protectedItemDataId()); + 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 + .withBackupManagementType(BackupManagementType.fromString(reader.getString())); + } else if ("workloadType".equals(fieldName)) { + deserializedAzureIaaSComputeVMProtectedItem + .withWorkloadType(DataSourceType.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 ("friendlyName".equals(fieldName)) { + deserializedAzureIaaSComputeVMProtectedItem.withFriendlyName(reader.getString()); + } else if ("virtualMachineId".equals(fieldName)) { + deserializedAzureIaaSComputeVMProtectedItem.withVirtualMachineId(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 + .withHealthStatus(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.withLastBackupTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("protectedItemDataId".equals(fieldName)) { + deserializedAzureIaaSComputeVMProtectedItem.withProtectedItemDataId(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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMErrorInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMErrorInfo.java new file mode 100644 index 000000000000..2ba92caa9586 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMErrorInfo.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Azure IaaS VM workload-specific error information. + */ +@Immutable +public final class AzureIaaSVMErrorInfo implements JsonSerializable { + /* + * Error code. + */ + private Integer errorCode; + + /* + * Title: Typically, the entity that the error pertains to. + */ + private String errorTitle; + + /* + * Localized error string. + */ + private String errorString; + + /* + * List of localized recommendations for above error code. + */ + private List recommendations; + + /** + * Creates an instance of AzureIaaSVMErrorInfo class. + */ + private AzureIaaSVMErrorInfo() { + } + + /** + * Get the errorCode property: Error code. + * + * @return the errorCode value. + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Get the errorTitle property: Title: Typically, the entity that the error pertains to. + * + * @return the errorTitle value. + */ + public String errorTitle() { + return this.errorTitle; + } + + /** + * Get the errorString property: Localized error string. + * + * @return the errorString value. + */ + public String errorString() { + return this.errorString; + } + + /** + * Get the recommendations property: List of localized recommendations for above error code. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * {@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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMHealthDetails.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMHealthDetails.java new file mode 100644 index 000000000000..5f179b7c2e11 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMHealthDetails.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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. + */ + private 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; + } + + /** + * {@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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJob.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJob.java new file mode 100644 index 000000000000..7abc0eb555e7 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJob.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Azure IaaS VM workload-specific job object. + */ +@Immutable +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. + */ + private String jobType = "AzureIaaSVMJob"; + + /* + * Time elapsed during the execution of this job. + */ + private Duration duration; + + /* + * Gets or sets the state/actions applicable on this job like cancel/retry. + */ + private List actionsInfo; + + /* + * Error details on execution of this job. + */ + private List errorDetails; + + /* + * Specifies whether the backup item is a Classic or an Azure Resource Manager VM. + */ + private String virtualMachineVersion; + + /* + * Additional information for this job. + */ + private AzureIaaSVMJobExtendedInfo extendedInfo; + + /** + * Creates an instance of AzureIaaSVMJob class. + */ + private AzureIaaSVMJob() { + } + + /** + * Get the jobType property: This property will be used as the discriminator for deciding the specific types in the + * polymorphic chain of types. + * + * @return the jobType value. + */ + @Override + public String jobType() { + return this.jobType; + } + + /** + * Get the duration property: Time elapsed during the execution of this job. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Get the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. + * + * @return the actionsInfo value. + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Get the errorDetails property: Error details on execution of this job. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Get the virtualMachineVersion property: Specifies whether the backup item is a Classic or an Azure Resource + * Manager VM. + * + * @return the virtualMachineVersion value. + */ + public String virtualMachineVersion() { + return this.virtualMachineVersion; + } + + /** + * Get the extendedInfo property: Additional information for this job. + * + * @return the extendedInfo value. + */ + public AzureIaaSVMJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * {@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); + 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 { + reader.skipChildren(); + } + } + + return deserializedAzureIaaSVMJob; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJobExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJobExtendedInfo.java new file mode 100644 index 000000000000..45f984fa0136 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJobExtendedInfo.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Azure IaaS VM workload-specific additional information for job. + */ +@Immutable +public final class AzureIaaSVMJobExtendedInfo implements JsonSerializable { + /* + * List of tasks associated with this job. + */ + private List tasksList; + + /* + * Job properties. + */ + private Map propertyBag; + + /* + * Job internal properties. + */ + private Map internalPropertyBag; + + /* + * Indicates progress of the job. Null if it has not started or completed. + */ + private Double progressPercentage; + + /* + * Time remaining for execution of this job. + */ + private String estimatedRemainingDuration; + + /* + * Non localized error message on job execution. + */ + private String dynamicErrorMessage; + + /** + * Creates an instance of AzureIaaSVMJobExtendedInfo class. + */ + private AzureIaaSVMJobExtendedInfo() { + } + + /** + * Get the tasksList property: List of tasks associated with this job. + * + * @return the tasksList value. + */ + public List tasksList() { + return this.tasksList; + } + + /** + * Get the propertyBag property: Job properties. + * + * @return the propertyBag value. + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Get the internalPropertyBag property: Job internal properties. + * + * @return the internalPropertyBag value. + */ + public Map internalPropertyBag() { + return this.internalPropertyBag; + } + + /** + * Get the progressPercentage property: Indicates progress of the job. Null if it has not started or completed. + * + * @return the progressPercentage value. + */ + public Double progressPercentage() { + return this.progressPercentage; + } + + /** + * Get the estimatedRemainingDuration property: Time remaining for execution of this job. + * + * @return the estimatedRemainingDuration value. + */ + public String estimatedRemainingDuration() { + return this.estimatedRemainingDuration; + } + + /** + * Get the dynamicErrorMessage property: Non localized error message on job execution. + * + * @return the dynamicErrorMessage value. + */ + public String dynamicErrorMessage() { + return this.dynamicErrorMessage; + } + + /** + * {@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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJobTaskDetails.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJobTaskDetails.java new file mode 100644 index 000000000000..fd21613b3deb --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJobTaskDetails.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Azure IaaS VM workload-specific job task details. + */ +@Immutable +public final class AzureIaaSVMJobTaskDetails implements JsonSerializable { + /* + * The task display name. + */ + private String taskId; + + /* + * The start time. + */ + private OffsetDateTime startTime; + + /* + * The end time. + */ + private OffsetDateTime endTime; + + /* + * The instanceId. + */ + private String instanceId; + + /* + * Time elapsed for task. + */ + private Duration duration; + + /* + * The status. + */ + private String status; + + /* + * Progress of the task. + */ + private Double progressPercentage; + + /* + * + * Details about execution of the task. + * eg: number of bytes transferred etc + */ + private String taskExecutionDetails; + + /** + * Creates an instance of AzureIaaSVMJobTaskDetails class. + */ + private AzureIaaSVMJobTaskDetails() { + } + + /** + * Get the taskId property: The task display name. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Get the startTime property: The start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the instanceId property: The instanceId. + * + * @return the instanceId value. + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Get the duration property: Time elapsed for task. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Get the status property: The status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the progressPercentage property: Progress of the task. + * + * @return the progressPercentage value. + */ + public Double progressPercentage() { + return this.progressPercentage; + } + + /** + * Get the taskExecutionDetails property: + * Details about execution of the task. + * eg: number of bytes transferred etc. + * + * @return the taskExecutionDetails value. + */ + public String taskExecutionDetails() { + return this.taskExecutionDetails; + } + + /** + * {@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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMProtectedItem.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMProtectedItem.java new file mode 100644 index 000000000000..93e77612a506 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMProtectedItem.java @@ -0,0 +1,507 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * IaaS VM workload-specific backup item. + */ +@Immutable +public class AzureIaaSVMProtectedItem extends ProtectedItem { + /* + * backup item type. + */ + private String protectedItemType = "AzureIaaSVMProtectedItem"; + + /* + * Friendly name of the VM represented by this backup item. + */ + private String friendlyName; + + /* + * Fully qualified ARM ID of the virtual machine represented by this item. + */ + private String virtualMachineId; + + /* + * Backup status of this backup item. + */ + private String protectionStatus; + + /* + * Backup state of this backup item. + */ + private ProtectionState protectionState; + + /* + * Health status of protected item. + */ + private HealthStatus healthStatus; + + /* + * Health details on this backup item. + */ + private List healthDetails; + + /* + * Health details of different KPIs + */ + private Map kpisHealths; + + /* + * Last backup operation status. + */ + private String lastBackupStatus; + + /* + * Timestamp of the last backup operation on this backup item. + */ + private OffsetDateTime lastBackupTime; + + /* + * Data ID of the protected item. + */ + private String protectedItemDataId; + + /* + * Additional information for this backup item. + */ + private AzureIaaSVMProtectedItemExtendedInfo extendedInfo; + + /* + * The extendedProperties property. + */ + private ExtendedProperties extendedProperties; + + /** + * Creates an instance of AzureIaaSVMProtectedItem class. + */ + protected AzureIaaSVMProtectedItem() { + } + + /** + * Get the protectedItemType property: backup item type. + * + * @return the protectedItemType value. + */ + @Override + public String protectedItemType() { + return this.protectedItemType; + } + + /** + * Get the friendlyName property: Friendly name of the VM represented by this backup item. + * + * @return the friendlyName value. + */ + 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. + * + * @return the virtualMachineId value. + */ + 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. + * + * @return the protectionStatus value. + */ + 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 AzureIaaSVMProtectedItem object itself. + */ + AzureIaaSVMProtectedItem withProtectionStatus(String protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + + /** + * Get the protectionState property: Backup state of this backup item. + * + * @return the protectionState value. + */ + public ProtectionState protectionState() { + return this.protectionState; + } + + /** + * Set the protectionState property: Backup state of this backup item. + * + * @param protectionState the protectionState value to set. + * @return the AzureIaaSVMProtectedItem object itself. + */ + AzureIaaSVMProtectedItem withProtectionState(ProtectionState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get the healthStatus property: Health status of protected item. + * + * @return the healthStatus value. + */ + 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. + * + * @return the healthDetails value. + */ + public List healthDetails() { + return this.healthDetails; + } + + /** + * Set the healthDetails property: Health details on this backup item. + * + * @param healthDetails the healthDetails value to set. + * @return the AzureIaaSVMProtectedItem object itself. + */ + AzureIaaSVMProtectedItem withHealthDetails(List healthDetails) { + this.healthDetails = healthDetails; + return this; + } + + /** + * Get the kpisHealths property: Health details of different KPIs. + * + * @return the kpisHealths value. + */ + public Map kpisHealths() { + return this.kpisHealths; + } + + /** + * Set the kpisHealths property: Health details of different KPIs. + * + * @param kpisHealths the kpisHealths value to set. + * @return the AzureIaaSVMProtectedItem object itself. + */ + AzureIaaSVMProtectedItem withKpisHealths(Map kpisHealths) { + this.kpisHealths = kpisHealths; + return this; + } + + /** + * Get the lastBackupStatus property: Last backup operation status. + * + * @return the lastBackupStatus value. + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set the lastBackupStatus property: Last backup operation status. + * + * @param lastBackupStatus the lastBackupStatus value to set. + * @return the AzureIaaSVMProtectedItem object itself. + */ + AzureIaaSVMProtectedItem withLastBackupStatus(String lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item. + * + * @return the lastBackupTime value. + */ + 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. + * + * @return the protectedItemDataId value. + */ + 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. + * + * @return the extendedInfo value. + */ + public AzureIaaSVMProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information for this backup item. + * + * @param extendedInfo the extendedInfo value to set. + * @return the AzureIaaSVMProtectedItem object itself. + */ + AzureIaaSVMProtectedItem withExtendedInfo(AzureIaaSVMProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** + * Get the extendedProperties property: The extendedProperties property. + * + * @return the extendedProperties value. + */ + public ExtendedProperties extendedProperties() { + return this.extendedProperties; + } + + /** + * Set the extendedProperties property: The extendedProperties property. + * + * @param extendedProperties the extendedProperties value to set. + * @return the AzureIaaSVMProtectedItem object itself. + */ + AzureIaaSVMProtectedItem withExtendedProperties(ExtendedProperties extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupManagementType", + backupManagementType() == null ? null : backupManagementType().toString()); + jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString()); + 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.writeStringField("protectedItemType", this.protectedItemType); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("virtualMachineId", this.virtualMachineId); + jsonWriter.writeStringField("protectionStatus", this.protectionStatus); + jsonWriter.writeStringField("protectionState", + this.protectionState == null ? null : this.protectionState.toString()); + jsonWriter.writeStringField("healthStatus", this.healthStatus == null ? null : this.healthStatus.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.writeStringField("lastBackupTime", + this.lastBackupTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastBackupTime)); + jsonWriter.writeStringField("protectedItemDataId", this.protectedItemDataId); + 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.Compute/virtualMachines".equals(discriminatorValue)) { + return AzureIaaSComputeVMProtectedItem.fromJson(readerToUse.reset()); + } else if ("Microsoft.ClassicCompute/virtualMachines".equals(discriminatorValue)) { + return AzureIaaSClassicComputeVMProtectedItem.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 + .withBackupManagementType(BackupManagementType.fromString(reader.getString())); + } else if ("workloadType".equals(fieldName)) { + deserializedAzureIaaSVMProtectedItem + .withWorkloadType(DataSourceType.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 ("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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMProtectedItemExtendedInfo.java new file mode 100644 index 000000000000..73bfe91f1481 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMProtectedItemExtendedInfo.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Additional information on Azure IaaS VM specific backup item. + */ +@Immutable +public final class AzureIaaSVMProtectedItemExtendedInfo + implements JsonSerializable { + /* + * The oldest backup copy available for this backup item. + */ + private OffsetDateTime oldestRecoveryPoint; + + /* + * Number of backup copies available for this backup item. + */ + private Integer recoveryPointCount; + + /* + * Specifies if backup policy associated with the backup item is inconsistent. + */ + private Boolean policyInconsistent; + + /** + * Creates an instance of AzureIaaSVMProtectedItemExtendedInfo class. + */ + private AzureIaaSVMProtectedItemExtendedInfo() { + } + + /** + * Get the oldestRecoveryPoint property: The oldest backup copy available for this backup item. + * + * @return the oldestRecoveryPoint value. + */ + public OffsetDateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Get the recoveryPointCount property: Number of backup copies available for this backup item. + * + * @return the recoveryPointCount value. + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Get the policyInconsistent property: Specifies if backup policy associated with the backup item is inconsistent. + * + * @return the policyInconsistent value. + */ + public Boolean policyInconsistent() { + return this.policyInconsistent; + } + + /** + * {@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.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 ("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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureSqlProtectedItem.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureSqlProtectedItem.java new file mode 100644 index 000000000000..fc18c25c27df --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureSqlProtectedItem.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Azure SQL workload-specific backup item. + */ +@Immutable +public final class AzureSqlProtectedItem extends ProtectedItem { + /* + * backup item type. + */ + private String protectedItemType = "Microsoft.Sql/servers/databases"; + + /* + * Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. + */ + private String protectedItemDataId; + + /* + * Backup state of the backed up item. + */ + private ProtectedItemState protectionState; + + /* + * Additional information for this backup item. + */ + private AzureSqlProtectedItemExtendedInfo extendedInfo; + + /** + * Creates an instance of AzureSqlProtectedItem class. + */ + private AzureSqlProtectedItem() { + } + + /** + * Get the protectedItemType property: backup item type. + * + * @return the protectedItemType value. + */ + @Override + public String protectedItemType() { + return this.protectedItemType; + } + + /** + * Get the protectedItemDataId property: Internal ID of a backup item. Used by Azure SQL Backup engine to contact + * Recovery Services. + * + * @return the protectedItemDataId value. + */ + public String protectedItemDataId() { + return this.protectedItemDataId; + } + + /** + * Get the protectionState property: Backup state of the backed up item. + * + * @return the protectionState value. + */ + public ProtectedItemState protectionState() { + return this.protectionState; + } + + /** + * Get the extendedInfo property: Additional information for this backup item. + * + * @return the extendedInfo value. + */ + public AzureSqlProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupManagementType", + backupManagementType() == null ? null : backupManagementType().toString()); + jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString()); + 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.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 + .withBackupManagementType(BackupManagementType.fromString(reader.getString())); + } else if ("workloadType".equals(fieldName)) { + deserializedAzureSqlProtectedItem.withWorkloadType(DataSourceType.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 ("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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureSqlProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureSqlProtectedItemExtendedInfo.java new file mode 100644 index 000000000000..e68b5a08453a --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureSqlProtectedItemExtendedInfo.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Additional information on Azure Sql specific protected item. + */ +@Immutable +public final class AzureSqlProtectedItemExtendedInfo implements JsonSerializable { + /* + * The oldest backup copy available for this item in the service. + */ + private OffsetDateTime oldestRecoveryPoint; + + /* + * Number of available backup copies associated with this backup item. + */ + private Integer recoveryPointCount; + + /* + * State of the backup policy associated with this backup item. + */ + private String policyState; + + /** + * Creates an instance of AzureSqlProtectedItemExtendedInfo class. + */ + private AzureSqlProtectedItemExtendedInfo() { + } + + /** + * Get the oldestRecoveryPoint property: The oldest backup copy available for this item in the service. + * + * @return the oldestRecoveryPoint value. + */ + public OffsetDateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Get the recoveryPointCount property: Number of available backup copies associated with this backup item. + * + * @return the recoveryPointCount value. + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Get the policyState property: State of the backup policy associated with this backup item. + * + * @return the policyState value. + */ + public String policyState() { + return this.policyState; + } + + /** + * {@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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageErrorInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageErrorInfo.java new file mode 100644 index 000000000000..ae024484f997 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageErrorInfo.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Azure storage specific error information. + */ +@Immutable +public final class AzureStorageErrorInfo implements JsonSerializable { + /* + * Error code. + */ + private Integer errorCode; + + /* + * Localized error string. + */ + private String errorString; + + /* + * List of localized recommendations for above error code. + */ + private List recommendations; + + /** + * Creates an instance of AzureStorageErrorInfo class. + */ + private AzureStorageErrorInfo() { + } + + /** + * Get the errorCode property: Error code. + * + * @return the errorCode value. + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Get the errorString property: Localized error string. + * + * @return the errorString value. + */ + public String errorString() { + return this.errorString; + } + + /** + * Get the recommendations property: List of localized recommendations for above error code. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * {@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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJob.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJob.java new file mode 100644 index 000000000000..db1d41c5fa5a --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJob.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Azure storage specific job. + */ +@Immutable +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. + */ + private String jobType = "AzureStorageJob"; + + /* + * Time elapsed during the execution of this job. + */ + private Duration duration; + + /* + * Gets or sets the state/actions applicable on this job like cancel/retry. + */ + private List actionsInfo; + + /* + * Error details on execution of this job. + */ + private List errorDetails; + + /* + * Specifies friendly name of the storage account. + */ + private String storageAccountName; + + /* + * Specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account. + */ + private String storageAccountVersion; + + /* + * Additional information about the job. + */ + private AzureStorageJobExtendedInfo extendedInfo; + + /** + * Creates an instance of AzureStorageJob class. + */ + private AzureStorageJob() { + } + + /** + * Get the jobType property: This property will be used as the discriminator for deciding the specific types in the + * polymorphic chain of types. + * + * @return the jobType value. + */ + @Override + public String jobType() { + return this.jobType; + } + + /** + * Get the duration property: Time elapsed during the execution of this job. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Get the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. + * + * @return the actionsInfo value. + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Get the errorDetails property: Error details on execution of this job. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Get the storageAccountName property: Specifies friendly name of the storage account. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Get the storageAccountVersion property: Specifies whether the Storage account is a Classic or an Azure Resource + * Manager Storage account. + * + * @return the storageAccountVersion value. + */ + public String storageAccountVersion() { + return this.storageAccountVersion; + } + + /** + * Get the extendedInfo property: Additional information about the job. + * + * @return the extendedInfo value. + */ + public AzureStorageJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * {@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); + 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 { + reader.skipChildren(); + } + } + + return deserializedAzureStorageJob; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJobExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJobExtendedInfo.java new file mode 100644 index 000000000000..42634ea52324 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJobExtendedInfo.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Azure Storage workload-specific additional information for job. + */ +@Immutable +public final class AzureStorageJobExtendedInfo implements JsonSerializable { + /* + * List of tasks for this job + */ + private List tasksList; + + /* + * Job properties. + */ + private Map propertyBag; + + /* + * Non localized error message on job execution. + */ + private String dynamicErrorMessage; + + /** + * Creates an instance of AzureStorageJobExtendedInfo class. + */ + private AzureStorageJobExtendedInfo() { + } + + /** + * Get the tasksList property: List of tasks for this job. + * + * @return the tasksList value. + */ + public List tasksList() { + return this.tasksList; + } + + /** + * Get the propertyBag property: Job properties. + * + * @return the propertyBag value. + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Get the dynamicErrorMessage property: Non localized error message on job execution. + * + * @return the dynamicErrorMessage value. + */ + public String dynamicErrorMessage() { + return this.dynamicErrorMessage; + } + + /** + * {@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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJobTaskDetails.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJobTaskDetails.java new file mode 100644 index 000000000000..2faa8ce13a9f --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJobTaskDetails.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure storage workload specific job task details. + */ +@Immutable +public final class AzureStorageJobTaskDetails implements JsonSerializable { + /* + * The task display name. + */ + private String taskId; + + /* + * The status. + */ + private String status; + + /** + * Creates an instance of AzureStorageJobTaskDetails class. + */ + private AzureStorageJobTaskDetails() { + } + + /** + * Get the taskId property: The task display name. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Get the status property: The status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * {@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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadProtectedItem.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadProtectedItem.java new file mode 100644 index 000000000000..91e2ece2bb33 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadProtectedItem.java @@ -0,0 +1,542 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * Azure VM workload-specific protected item. + */ +@Immutable +public class AzureVmWorkloadProtectedItem extends ProtectedItem { + /* + * backup item type. + */ + private String protectedItemType = "AzureVmWorkloadProtectedItem"; + + /* + * Friendly name of the DB represented by this backup item. + */ + private String friendlyName; + + /* + * Host/Cluster Name for instance or AG + */ + private String serverName; + + /* + * Parent name of the DB such as Instance or Availability Group. + */ + private String parentName; + + /* + * Parent type of protected item, example: for a DB, standalone server or distributed + */ + private String parentType; + + /* + * Backup status of this backup item. + */ + private String protectionStatus; + + /* + * Backup state of this backup item. + */ + private ProtectionState protectionState; + + /* + * Last backup operation status. Possible values: Healthy, Unhealthy. + */ + private LastBackupStatus lastBackupStatus; + + /* + * Timestamp of the last backup operation on this backup item. + */ + private OffsetDateTime lastBackupTime; + + /* + * Error details in last backup + */ + private ErrorDetail lastBackupErrorDetail; + + /* + * Data ID of the protected item. + */ + private String protectedItemDataSourceId; + + /* + * Health status of the backup item, evaluated based on last heartbeat received + */ + private ProtectedItemHealthStatus protectedItemHealthStatus; + + /* + * Additional information for this backup item. + */ + private AzureVmWorkloadProtectedItemExtendedInfo extendedInfo; + + /* + * Health details of different KPIs + */ + private Map kpisHealths; + + /** + * Creates an instance of AzureVmWorkloadProtectedItem class. + */ + protected AzureVmWorkloadProtectedItem() { + } + + /** + * Get the protectedItemType property: backup item type. + * + * @return the protectedItemType value. + */ + @Override + public String protectedItemType() { + return this.protectedItemType; + } + + /** + * Get the friendlyName property: Friendly name of the DB represented by this backup item. + * + * @return the friendlyName value. + */ + 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. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: Host/Cluster Name for instance or AG. + * + * @param serverName the serverName value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + AzureVmWorkloadProtectedItem withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the parentName property: Parent name of the DB such as Instance or Availability Group. + * + * @return the parentName value. + */ + public String parentName() { + return this.parentName; + } + + /** + * Set the parentName property: Parent name of the DB such as Instance or Availability Group. + * + * @param parentName the parentName value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + AzureVmWorkloadProtectedItem withParentName(String parentName) { + this.parentName = parentName; + return this; + } + + /** + * Get the parentType property: Parent type of protected item, example: for a DB, standalone server or distributed. + * + * @return the parentType value. + */ + public String parentType() { + return this.parentType; + } + + /** + * Set the parentType property: Parent type of protected item, example: for a DB, standalone server or distributed. + * + * @param parentType the parentType value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + AzureVmWorkloadProtectedItem withParentType(String parentType) { + this.parentType = parentType; + return this; + } + + /** + * Get the protectionStatus property: Backup status of this backup item. + * + * @return the protectionStatus value. + */ + 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. + * + * @return the protectionState value. + */ + public ProtectionState protectionState() { + return this.protectionState; + } + + /** + * Set the protectionState property: Backup state of this backup item. + * + * @param protectionState the protectionState value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + AzureVmWorkloadProtectedItem withProtectionState(ProtectionState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get the lastBackupStatus property: Last backup operation status. Possible values: Healthy, Unhealthy. + * + * @return the lastBackupStatus value. + */ + public LastBackupStatus lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set the lastBackupStatus property: Last backup operation status. Possible values: Healthy, Unhealthy. + * + * @param lastBackupStatus the lastBackupStatus value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + AzureVmWorkloadProtectedItem withLastBackupStatus(LastBackupStatus lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item. + * + * @return the lastBackupTime value. + */ + 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 AzureVmWorkloadProtectedItem object itself. + */ + AzureVmWorkloadProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { + this.lastBackupTime = lastBackupTime; + return this; + } + + /** + * Get the lastBackupErrorDetail property: Error details in last backup. + * + * @return the lastBackupErrorDetail value. + */ + public ErrorDetail lastBackupErrorDetail() { + return this.lastBackupErrorDetail; + } + + /** + * Set the lastBackupErrorDetail property: Error details in last backup. + * + * @param lastBackupErrorDetail the lastBackupErrorDetail value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + AzureVmWorkloadProtectedItem withLastBackupErrorDetail(ErrorDetail lastBackupErrorDetail) { + this.lastBackupErrorDetail = lastBackupErrorDetail; + return this; + } + + /** + * Get the protectedItemDataSourceId property: Data ID of the protected item. + * + * @return the protectedItemDataSourceId value. + */ + public String protectedItemDataSourceId() { + return this.protectedItemDataSourceId; + } + + /** + * Set the protectedItemDataSourceId property: Data ID of the protected item. + * + * @param protectedItemDataSourceId the protectedItemDataSourceId value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + AzureVmWorkloadProtectedItem withProtectedItemDataSourceId(String protectedItemDataSourceId) { + this.protectedItemDataSourceId = protectedItemDataSourceId; + return this; + } + + /** + * Get the protectedItemHealthStatus property: Health status of the backup item, evaluated based on last heartbeat + * received. + * + * @return the protectedItemHealthStatus value. + */ + public ProtectedItemHealthStatus protectedItemHealthStatus() { + return this.protectedItemHealthStatus; + } + + /** + * Set the protectedItemHealthStatus property: Health status of the backup item, evaluated based on last heartbeat + * received. + * + * @param protectedItemHealthStatus the protectedItemHealthStatus value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + AzureVmWorkloadProtectedItem withProtectedItemHealthStatus(ProtectedItemHealthStatus protectedItemHealthStatus) { + this.protectedItemHealthStatus = protectedItemHealthStatus; + return this; + } + + /** + * Get the extendedInfo property: Additional information for this backup item. + * + * @return the extendedInfo value. + */ + public AzureVmWorkloadProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information for this backup item. + * + * @param extendedInfo the extendedInfo value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + AzureVmWorkloadProtectedItem withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** + * Get the kpisHealths property: Health details of different KPIs. + * + * @return the kpisHealths value. + */ + public Map kpisHealths() { + return this.kpisHealths; + } + + /** + * Set the kpisHealths property: Health details of different KPIs. + * + * @param kpisHealths the kpisHealths value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + AzureVmWorkloadProtectedItem withKpisHealths(Map kpisHealths) { + this.kpisHealths = kpisHealths; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupManagementType", + backupManagementType() == null ? null : backupManagementType().toString()); + jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString()); + 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.writeStringField("protectedItemType", this.protectedItemType); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("serverName", this.serverName); + jsonWriter.writeStringField("parentName", this.parentName); + jsonWriter.writeStringField("parentType", this.parentType); + jsonWriter.writeStringField("protectionStatus", this.protectionStatus); + 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)); + 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 ("AzureVmWorkloadSAPHanaDatabase".equals(discriminatorValue)) { + return AzureVmWorkloadSAPHanaDatabaseProtectedItem.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 + .withBackupManagementType(BackupManagementType.fromString(reader.getString())); + } else if ("workloadType".equals(fieldName)) { + deserializedAzureVmWorkloadProtectedItem + .withWorkloadType(DataSourceType.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 ("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 { + reader.skipChildren(); + } + } + + return deserializedAzureVmWorkloadProtectedItem; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadProtectedItemExtendedInfo.java new file mode 100644 index 000000000000..ac260aa7098a --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadProtectedItemExtendedInfo.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Additional information on Azure Workload for SQL specific backup item. + */ +@Immutable +public final class AzureVmWorkloadProtectedItemExtendedInfo + implements JsonSerializable { + /* + * The oldest backup copy available for this backup item. + */ + private OffsetDateTime oldestRecoveryPoint; + + /* + * Number of backup copies available for this backup item. + */ + private Integer recoveryPointCount; + + /* + * Indicates consistency of policy object and policy applied to this backup item. + */ + private String policyState; + + /** + * Creates an instance of AzureVmWorkloadProtectedItemExtendedInfo class. + */ + private AzureVmWorkloadProtectedItemExtendedInfo() { + } + + /** + * Get the oldestRecoveryPoint property: The oldest backup copy available for this backup item. + * + * @return the oldestRecoveryPoint value. + */ + public OffsetDateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Get the recoveryPointCount property: Number of backup copies available for this backup item. + * + * @return the recoveryPointCount value. + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Get the policyState property: Indicates consistency of policy object and policy applied to this backup item. + * + * @return the policyState value. + */ + public String policyState() { + return this.policyState; + } + + /** + * {@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 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 ("recoveryPointCount".equals(fieldName)) { + deserializedAzureVmWorkloadProtectedItemExtendedInfo.recoveryPointCount + = reader.getNullable(JsonReader::getInt); + } else if ("policyState".equals(fieldName)) { + deserializedAzureVmWorkloadProtectedItemExtendedInfo.policyState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureVmWorkloadProtectedItemExtendedInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSAPAseDatabaseProtectedItem.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSAPAseDatabaseProtectedItem.java new file mode 100644 index 000000000000..1f66c94ca501 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSAPAseDatabaseProtectedItem.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * Azure VM workload-specific protected item representing SAP ASE Database. + */ +@Immutable +public final class AzureVmWorkloadSAPAseDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { + /* + * backup item type. + */ + private String protectedItemType = "AzureVmWorkloadSAPAseDatabase"; + + /** + * Creates an instance of AzureVmWorkloadSAPAseDatabaseProtectedItem class. + */ + private AzureVmWorkloadSAPAseDatabaseProtectedItem() { + } + + /** + * Get the protectedItemType property: backup item type. + * + * @return the protectedItemType value. + */ + @Override + public String protectedItemType() { + return this.protectedItemType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupManagementType", + backupManagementType() == null ? null : backupManagementType().toString()); + jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString()); + 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.writeStringField("friendlyName", friendlyName()); + jsonWriter.writeStringField("serverName", serverName()); + jsonWriter.writeStringField("parentName", parentName()); + jsonWriter.writeStringField("parentType", parentType()); + jsonWriter.writeStringField("protectionStatus", protectionStatus()); + 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.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 + .withBackupManagementType(BackupManagementType.fromString(reader.getString())); + } else if ("workloadType".equals(fieldName)) { + deserializedAzureVmWorkloadSAPAseDatabaseProtectedItem + .withWorkloadType(DataSourceType.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 ("friendlyName".equals(fieldName)) { + deserializedAzureVmWorkloadSAPAseDatabaseProtectedItem.withFriendlyName(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.withProtectionStatus(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 ("protectedItemType".equals(fieldName)) { + deserializedAzureVmWorkloadSAPAseDatabaseProtectedItem.protectedItemType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureVmWorkloadSAPAseDatabaseProtectedItem; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.java new file mode 100644 index 000000000000..18e3f174f87f --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * Azure VM workload-specific protected item representing SAP HANA Database. + */ +@Immutable +public final class AzureVmWorkloadSAPHanaDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { + /* + * backup item type. + */ + private String protectedItemType = "AzureVmWorkloadSAPHanaDatabase"; + + /** + * Creates an instance of AzureVmWorkloadSAPHanaDatabaseProtectedItem class. + */ + private AzureVmWorkloadSAPHanaDatabaseProtectedItem() { + } + + /** + * Get the protectedItemType property: backup item type. + * + * @return the protectedItemType value. + */ + @Override + public String protectedItemType() { + return this.protectedItemType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupManagementType", + backupManagementType() == null ? null : backupManagementType().toString()); + jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString()); + 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.writeStringField("friendlyName", friendlyName()); + jsonWriter.writeStringField("serverName", serverName()); + jsonWriter.writeStringField("parentName", parentName()); + jsonWriter.writeStringField("parentType", parentType()); + jsonWriter.writeStringField("protectionStatus", protectionStatus()); + 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.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 + .withBackupManagementType(BackupManagementType.fromString(reader.getString())); + } else if ("workloadType".equals(fieldName)) { + deserializedAzureVmWorkloadSAPHanaDatabaseProtectedItem + .withWorkloadType(DataSourceType.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 ("friendlyName".equals(fieldName)) { + deserializedAzureVmWorkloadSAPHanaDatabaseProtectedItem.withFriendlyName(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.withProtectionStatus(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 ("protectedItemType".equals(fieldName)) { + deserializedAzureVmWorkloadSAPHanaDatabaseProtectedItem.protectedItemType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureVmWorkloadSAPHanaDatabaseProtectedItem; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSQLDatabaseProtectedItem.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSQLDatabaseProtectedItem.java new file mode 100644 index 000000000000..f912e2779bd9 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSQLDatabaseProtectedItem.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * Azure VM workload-specific protected item representing SQL Database. + */ +@Immutable +public final class AzureVmWorkloadSQLDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { + /* + * backup item type. + */ + private String protectedItemType = "AzureVmWorkloadSQLDatabase"; + + /** + * Creates an instance of AzureVmWorkloadSQLDatabaseProtectedItem class. + */ + private AzureVmWorkloadSQLDatabaseProtectedItem() { + } + + /** + * Get the protectedItemType property: backup item type. + * + * @return the protectedItemType value. + */ + @Override + public String protectedItemType() { + return this.protectedItemType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupManagementType", + backupManagementType() == null ? null : backupManagementType().toString()); + jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString()); + 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.writeStringField("friendlyName", friendlyName()); + jsonWriter.writeStringField("serverName", serverName()); + jsonWriter.writeStringField("parentName", parentName()); + jsonWriter.writeStringField("parentType", parentType()); + jsonWriter.writeStringField("protectionStatus", protectionStatus()); + 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.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 + .withBackupManagementType(BackupManagementType.fromString(reader.getString())); + } else if ("workloadType".equals(fieldName)) { + deserializedAzureVmWorkloadSQLDatabaseProtectedItem + .withWorkloadType(DataSourceType.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 ("friendlyName".equals(fieldName)) { + deserializedAzureVmWorkloadSQLDatabaseProtectedItem.withFriendlyName(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.withProtectionStatus(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 ("protectedItemType".equals(fieldName)) { + deserializedAzureVmWorkloadSQLDatabaseProtectedItem.protectedItemType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureVmWorkloadSQLDatabaseProtectedItem; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadErrorInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadErrorInfo.java new file mode 100644 index 000000000000..7df00ecf7bce --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadErrorInfo.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Azure storage specific error information. + */ +@Immutable +public final class AzureWorkloadErrorInfo implements JsonSerializable { + /* + * Error code. + */ + private Integer errorCode; + + /* + * Localized error string. + */ + private String errorString; + + /* + * Title: Typically, the entity that the error pertains to. + */ + private String errorTitle; + + /* + * List of localized recommendations for above error code. + */ + private List recommendations; + + /* + * Additional details for above error code. + */ + private String additionalDetails; + + /** + * Creates an instance of AzureWorkloadErrorInfo class. + */ + private AzureWorkloadErrorInfo() { + } + + /** + * Get the errorCode property: Error code. + * + * @return the errorCode value. + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Get the errorString property: Localized error string. + * + * @return the errorString value. + */ + public String errorString() { + return this.errorString; + } + + /** + * Get the errorTitle property: Title: Typically, the entity that the error pertains to. + * + * @return the errorTitle value. + */ + public String errorTitle() { + return this.errorTitle; + } + + /** + * Get the recommendations property: List of localized recommendations for above error code. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Get the additionalDetails property: Additional details for above error code. + * + * @return the additionalDetails value. + */ + public String additionalDetails() { + return this.additionalDetails; + } + + /** + * {@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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJob.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJob.java new file mode 100644 index 000000000000..08a1c9ed4aa0 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJob.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Azure storage specific job. + */ +@Immutable +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. + */ + private String jobType = "AzureWorkloadJob"; + + /* + * Workload type of the job + */ + private String workloadType; + + /* + * Time elapsed during the execution of this job. + */ + private Duration duration; + + /* + * Gets or sets the state/actions applicable on this job like cancel/retry. + */ + private List actionsInfo; + + /* + * Error details on execution of this job. + */ + private List errorDetails; + + /* + * Additional information about the job. + */ + private AzureWorkloadJobExtendedInfo extendedInfo; + + /** + * Creates an instance of AzureWorkloadJob class. + */ + private AzureWorkloadJob() { + } + + /** + * Get the jobType property: This property will be used as the discriminator for deciding the specific types in the + * polymorphic chain of types. + * + * @return the jobType value. + */ + @Override + public String jobType() { + return this.jobType; + } + + /** + * Get the workloadType property: Workload type of the job. + * + * @return the workloadType value. + */ + public String workloadType() { + return this.workloadType; + } + + /** + * Get the duration property: Time elapsed during the execution of this job. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Get the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. + * + * @return the actionsInfo value. + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Get the errorDetails property: Error details on execution of this job. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Get the extendedInfo property: Additional information about the job. + * + * @return the extendedInfo value. + */ + public AzureWorkloadJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * {@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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJobExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJobExtendedInfo.java new file mode 100644 index 000000000000..5144fcab062c --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJobExtendedInfo.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Azure VM workload-specific additional information for job. + */ +@Immutable +public final class AzureWorkloadJobExtendedInfo implements JsonSerializable { + /* + * List of tasks for this job + */ + private List tasksList; + + /* + * Job properties. + */ + private Map propertyBag; + + /* + * Non localized error message on job execution. + */ + private String dynamicErrorMessage; + + /** + * Creates an instance of AzureWorkloadJobExtendedInfo class. + */ + private AzureWorkloadJobExtendedInfo() { + } + + /** + * Get the tasksList property: List of tasks for this job. + * + * @return the tasksList value. + */ + public List tasksList() { + return this.tasksList; + } + + /** + * Get the propertyBag property: Job properties. + * + * @return the propertyBag value. + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Get the dynamicErrorMessage property: Non localized error message on job execution. + * + * @return the dynamicErrorMessage value. + */ + public String dynamicErrorMessage() { + return this.dynamicErrorMessage; + } + + /** + * {@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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJobTaskDetails.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJobTaskDetails.java new file mode 100644 index 000000000000..6ac10aeab899 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJobTaskDetails.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure VM workload specific job task details. + */ +@Immutable +public final class AzureWorkloadJobTaskDetails implements JsonSerializable { + /* + * The task display name. + */ + private String taskId; + + /* + * The status. + */ + private String status; + + /** + * Creates an instance of AzureWorkloadJobTaskDetails class. + */ + private AzureWorkloadJobTaskDetails() { + } + + /** + * Get the taskId property: The task display name. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Get the status property: The status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * {@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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadPointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadPointInTimeRecoveryPoint.java new file mode 100644 index 000000000000..1fd199fccced --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadPointInTimeRecoveryPoint.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Recovery point specific to PointInTime. + */ +@Immutable +public class AzureWorkloadPointInTimeRecoveryPoint extends AzureWorkloadRecoveryPoint { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "AzureWorkloadPointInTimeRecoveryPoint"; + + /* + * List of log ranges + */ + private List timeRanges; + + /** + * Creates an instance of AzureWorkloadPointInTimeRecoveryPoint class. + */ + protected AzureWorkloadPointInTimeRecoveryPoint() { + } + + /** + * 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 timeRanges property: List of log ranges. + * + * @return the timeRanges value. + */ + public List timeRanges() { + return this.timeRanges; + } + + /** + * Set the timeRanges property: List of log ranges. + * + * @param timeRanges the timeRanges value to set. + * @return the AzureWorkloadPointInTimeRecoveryPoint object itself. + */ + AzureWorkloadPointInTimeRecoveryPoint withTimeRanges(List timeRanges) { + this.timeRanges = timeRanges; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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 { + 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 -> RecoveryPointTierInformation.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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadPointInTimeRestoreRequest.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadPointInTimeRestoreRequest.java new file mode 100644 index 000000000000..18486eef9c49 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadPointInTimeRestoreRequest.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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.Map; + +/** + * AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore. + */ +@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. + */ + private String objectType = "AzureWorkloadPointInTimeRestoreRequest"; + + /* + * PointInTime value + */ + private OffsetDateTime pointInTime; + + /** + * Creates an instance of AzureWorkloadPointInTimeRestoreRequest class. + */ + public AzureWorkloadPointInTimeRestoreRequest() { + } + + /** + * 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 AzureWorkloadPointInTimeRestoreRequest object itself. + */ + public AzureWorkloadPointInTimeRestoreRequest withPointInTime(OffsetDateTime pointInTime) { + this.pointInTime = pointInTime; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadPointInTimeRestoreRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadPointInTimeRestoreRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadPointInTimeRestoreRequest withPropertyBag(Map propertyBag) { + super.withPropertyBag(propertyBag); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadPointInTimeRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { + super.withTargetInfo(targetInfo); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadPointInTimeRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { + super.withRecoveryMode(recoveryMode); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadPointInTimeRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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("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 ("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 ("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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadRecoveryPoint.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadRecoveryPoint.java new file mode 100644 index 000000000000..b74df965852b --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadRecoveryPoint.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Workload specific recovery point, specifically encapsulates full/diff recovery point. + */ +@Immutable +public class AzureWorkloadRecoveryPoint extends RecoveryPoint { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "AzureWorkloadRecoveryPoint"; + + /* + * UTC time at which recovery point was created + */ + private OffsetDateTime recoveryPointTimeInUTC; + + /* + * Type of restore point + */ + private RestorePointType type; + + /* + * Recovery point tier information. + */ + private List recoveryPointTierDetails; + + /* + * Eligibility of RP to be moved to another tier + */ + private Map recoveryPointMoveReadinessInfo; + + /* + * Properties of Recovery Point + */ + private RecoveryPointProperties recoveryPointProperties; + + /** + * Creates an instance of AzureWorkloadRecoveryPoint class. + */ + protected AzureWorkloadRecoveryPoint() { + } + + /** + * 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 recoveryPointTimeInUTC property: UTC time at which recovery point was created. + * + * @return the recoveryPointTimeInUTC value. + */ + public OffsetDateTime recoveryPointTimeInUTC() { + return this.recoveryPointTimeInUTC; + } + + /** + * Set the recoveryPointTimeInUTC property: UTC time at which recovery point was created. + * + * @param recoveryPointTimeInUTC the recoveryPointTimeInUTC value to set. + * @return the AzureWorkloadRecoveryPoint object itself. + */ + AzureWorkloadRecoveryPoint withRecoveryPointTimeInUTC(OffsetDateTime recoveryPointTimeInUTC) { + this.recoveryPointTimeInUTC = recoveryPointTimeInUTC; + return this; + } + + /** + * Get the type property: Type of restore point. + * + * @return the type value. + */ + public RestorePointType type() { + return this.type; + } + + /** + * Set the type property: Type of restore point. + * + * @param type the type value to set. + * @return the AzureWorkloadRecoveryPoint object itself. + */ + AzureWorkloadRecoveryPoint withType(RestorePointType type) { + this.type = type; + return this; + } + + /** + * Get the recoveryPointTierDetails property: Recovery point tier information. + * + * @return the recoveryPointTierDetails value. + */ + public List recoveryPointTierDetails() { + return this.recoveryPointTierDetails; + } + + /** + * Set the recoveryPointTierDetails property: Recovery point tier information. + * + * @param recoveryPointTierDetails the recoveryPointTierDetails value to set. + * @return the AzureWorkloadRecoveryPoint object itself. + */ + AzureWorkloadRecoveryPoint + withRecoveryPointTierDetails(List recoveryPointTierDetails) { + this.recoveryPointTierDetails = recoveryPointTierDetails; + return this; + } + + /** + * Get the recoveryPointMoveReadinessInfo property: Eligibility of RP to be moved to another tier. + * + * @return the recoveryPointMoveReadinessInfo value. + */ + public Map recoveryPointMoveReadinessInfo() { + return this.recoveryPointMoveReadinessInfo; + } + + /** + * Set the recoveryPointMoveReadinessInfo property: Eligibility of RP to be moved to another tier. + * + * @param recoveryPointMoveReadinessInfo the recoveryPointMoveReadinessInfo value to set. + * @return the AzureWorkloadRecoveryPoint object itself. + */ + AzureWorkloadRecoveryPoint + withRecoveryPointMoveReadinessInfo(Map recoveryPointMoveReadinessInfo) { + this.recoveryPointMoveReadinessInfo = recoveryPointMoveReadinessInfo; + return this; + } + + /** + * Get the recoveryPointProperties property: Properties of Recovery Point. + * + * @return the recoveryPointProperties value. + */ + public RecoveryPointProperties recoveryPointProperties() { + return this.recoveryPointProperties; + } + + /** + * Set the recoveryPointProperties property: Properties of Recovery Point. + * + * @param recoveryPointProperties the recoveryPointProperties value to set. + * @return the AzureWorkloadRecoveryPoint object itself. + */ + AzureWorkloadRecoveryPoint withRecoveryPointProperties(RecoveryPointProperties recoveryPointProperties) { + this.recoveryPointProperties = recoveryPointProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + 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 ("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 if ("AzureWorkloadPointInTimeRecoveryPoint".equals(discriminatorValue)) { + return AzureWorkloadPointInTimeRecoveryPoint.fromJsonKnownDiscriminator(readerToUse.reset()); + } else if ("AzureWorkloadSAPHanaPointInTimeRecoveryPoint".equals(discriminatorValue)) { + return AzureWorkloadSAPHanaPointInTimeRecoveryPoint.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 -> RecoveryPointTierInformation.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/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadRestoreRequest.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadRestoreRequest.java new file mode 100644 index 000000000000..b2616828e86a --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadRestoreRequest.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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.Map; + +/** + * AzureWorkload-specific restore. + */ +@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. + */ + private String objectType = "AzureWorkloadRestoreRequest"; + + /* + * Type of this recovery. + */ + private RecoveryType recoveryType; + + /* + * Fully qualified ARM ID of the VM on which workload that was running is being recovered. + */ + private String sourceResourceId; + + /* + * Workload specific property bag. + */ + private Map propertyBag; + + /* + * Details of target database + */ + private TargetRestoreInfo targetInfo; + + /* + * Defines whether the current recovery mode is file restore or database restore + */ + private RecoveryMode recoveryMode; + + /* + * This is the complete ARM Id of the target VM + * For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + */ + private String targetVirtualMachineId; + + /** + * Creates an instance of AzureWorkloadRestoreRequest class. + */ + public AzureWorkloadRestoreRequest() { + } + + /** + * 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 recoveryType property: Type of this recovery. + * + * @return the recoveryType value. + */ + public RecoveryType recoveryType() { + return this.recoveryType; + } + + /** + * Set the recoveryType property: Type of this recovery. + * + * @param recoveryType the recoveryType value to set. + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withRecoveryType(RecoveryType recoveryType) { + this.recoveryType = recoveryType; + return this; + } + + /** + * Get the sourceResourceId property: Fully qualified ARM ID of the VM on which workload that was running is being + * recovered. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: Fully qualified ARM ID of the VM on which workload that was running is being + * recovered. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the propertyBag property: Workload specific property bag. + * + * @return the propertyBag value. + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Set the propertyBag property: Workload specific property bag. + * + * @param propertyBag the propertyBag value to set. + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withPropertyBag(Map propertyBag) { + this.propertyBag = propertyBag; + return this; + } + + /** + * Get the targetInfo property: Details of target database. + * + * @return the targetInfo value. + */ + public TargetRestoreInfo targetInfo() { + return this.targetInfo; + } + + /** + * Set the targetInfo property: Details of target database. + * + * @param targetInfo the targetInfo value to set. + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { + this.targetInfo = targetInfo; + return this; + } + + /** + * Get the recoveryMode property: Defines whether the current recovery mode is file restore or database restore. + * + * @return the recoveryMode value. + */ + public RecoveryMode recoveryMode() { + return this.recoveryMode; + } + + /** + * Set the recoveryMode property: Defines whether the current recovery mode is file restore or database restore. + * + * @param recoveryMode the recoveryMode value to set. + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { + this.recoveryMode = recoveryMode; + return this; + } + + /** + * Get the targetVirtualMachineId property: This is the complete ARM Id of the target VM + * For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + * + * @return the targetVirtualMachineId value. + */ + public String targetVirtualMachineId() { + return this.targetVirtualMachineId; + } + + /** + * Set the targetVirtualMachineId property: This is the complete ARM Id of the target VM + * For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + * + * @param targetVirtualMachineId the targetVirtualMachineId value to set. + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + this.targetVirtualMachineId = targetVirtualMachineId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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("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 ("AzureWorkloadSAPHanaRestoreRequest".equals(discriminatorValue)) { + return AzureWorkloadSAPHanaRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); + } else if ("AzureWorkloadSAPHanaPointInTimeRestoreRequest".equals(discriminatorValue)) { + return AzureWorkloadSAPHanaPointInTimeRestoreRequest.fromJson(readerToUse.reset()); + } else if ("AzureWorkloadSQLRestoreRequest".equals(discriminatorValue)) { + return AzureWorkloadSQLRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); + } else if ("AzureWorkloadSQLPointInTimeRestoreRequest".equals(discriminatorValue)) { + return AzureWorkloadSQLPointInTimeRestoreRequest.fromJson(readerToUse.reset()); + } else if ("AzureWorkloadPointInTimeRestoreRequest".equals(discriminatorValue)) { + return AzureWorkloadPointInTimeRestoreRequest.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 ("objectType".equals(fieldName)) { + deserializedAzureWorkloadRestoreRequest.objectType = reader.getString(); + } else if ("recoveryType".equals(fieldName)) { + deserializedAzureWorkloadRestoreRequest.recoveryType = RecoveryType.fromString(reader.getString()); + } else if ("sourceResourceId".equals(fieldName)) { + deserializedAzureWorkloadRestoreRequest.sourceResourceId = reader.getString(); + } else if ("propertyBag".equals(fieldName)) { + Map propertyBag = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureWorkloadRestoreRequest.propertyBag = propertyBag; + } else if ("targetInfo".equals(fieldName)) { + deserializedAzureWorkloadRestoreRequest.targetInfo = TargetRestoreInfo.fromJson(reader); + } else if ("recoveryMode".equals(fieldName)) { + deserializedAzureWorkloadRestoreRequest.recoveryMode = RecoveryMode.fromString(reader.getString()); + } else if ("targetVirtualMachineId".equals(fieldName)) { + deserializedAzureWorkloadRestoreRequest.targetVirtualMachineId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureWorkloadRestoreRequest; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.java new file mode 100644 index 000000000000..37b387f01003 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Recovery point specific to PointInTime in SAPHana. + */ +@Immutable +public final class AzureWorkloadSAPHanaPointInTimeRecoveryPoint extends AzureWorkloadPointInTimeRecoveryPoint { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint"; + + /** + * Creates an instance of AzureWorkloadSAPHanaPointInTimeRecoveryPoint class. + */ + private AzureWorkloadSAPHanaPointInTimeRecoveryPoint() { + } + + /** + * 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 JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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 AzureWorkloadSAPHanaPointInTimeRecoveryPoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureWorkloadSAPHanaPointInTimeRecoveryPoint 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 AzureWorkloadSAPHanaPointInTimeRecoveryPoint. + */ + public static AzureWorkloadSAPHanaPointInTimeRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureWorkloadSAPHanaPointInTimeRecoveryPoint deserializedAzureWorkloadSAPHanaPointInTimeRecoveryPoint + = new AzureWorkloadSAPHanaPointInTimeRecoveryPoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recoveryPointTimeInUTC".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaPointInTimeRecoveryPoint.withRecoveryPointTimeInUTC(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("type".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaPointInTimeRecoveryPoint + .withType(RestorePointType.fromString(reader.getString())); + } else if ("recoveryPointTierDetails".equals(fieldName)) { + List recoveryPointTierDetails + = reader.readArray(reader1 -> RecoveryPointTierInformation.fromJson(reader1)); + deserializedAzureWorkloadSAPHanaPointInTimeRecoveryPoint + .withRecoveryPointTierDetails(recoveryPointTierDetails); + } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) { + Map recoveryPointMoveReadinessInfo + = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1)); + deserializedAzureWorkloadSAPHanaPointInTimeRecoveryPoint + .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); + } else if ("recoveryPointProperties".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaPointInTimeRecoveryPoint + .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader)); + } else if ("timeRanges".equals(fieldName)) { + List timeRanges = reader.readArray(reader1 -> PointInTimeRange.fromJson(reader1)); + deserializedAzureWorkloadSAPHanaPointInTimeRecoveryPoint.withTimeRanges(timeRanges); + } else if ("objectType".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaPointInTimeRecoveryPoint.objectType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureWorkloadSAPHanaPointInTimeRecoveryPoint; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaPointInTimeRestoreRequest.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaPointInTimeRestoreRequest.java new file mode 100644 index 000000000000..8b0ad27a864c --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaPointInTimeRestoreRequest.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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.Map; + +/** + * AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore. + */ +@Fluent +public final class AzureWorkloadSAPHanaPointInTimeRestoreRequest extends AzureWorkloadSAPHanaRestoreRequest { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "AzureWorkloadSAPHanaPointInTimeRestoreRequest"; + + /* + * PointInTime value + */ + private OffsetDateTime pointInTime; + + /** + * Creates an instance of AzureWorkloadSAPHanaPointInTimeRestoreRequest class. + */ + public AzureWorkloadSAPHanaPointInTimeRestoreRequest() { + } + + /** + * 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 AzureWorkloadSAPHanaPointInTimeRestoreRequest object itself. + */ + public AzureWorkloadSAPHanaPointInTimeRestoreRequest withPointInTime(OffsetDateTime pointInTime) { + this.pointInTime = pointInTime; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSAPHanaPointInTimeRestoreRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSAPHanaPointInTimeRestoreRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSAPHanaPointInTimeRestoreRequest withPropertyBag(Map propertyBag) { + super.withPropertyBag(propertyBag); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSAPHanaPointInTimeRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { + super.withTargetInfo(targetInfo); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSAPHanaPointInTimeRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { + super.withRecoveryMode(recoveryMode); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSAPHanaPointInTimeRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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("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 AzureWorkloadSAPHanaPointInTimeRestoreRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureWorkloadSAPHanaPointInTimeRestoreRequest 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 AzureWorkloadSAPHanaPointInTimeRestoreRequest. + */ + public static AzureWorkloadSAPHanaPointInTimeRestoreRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureWorkloadSAPHanaPointInTimeRestoreRequest deserializedAzureWorkloadSAPHanaPointInTimeRestoreRequest + = new AzureWorkloadSAPHanaPointInTimeRestoreRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recoveryType".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaPointInTimeRestoreRequest + .withRecoveryType(RecoveryType.fromString(reader.getString())); + } else if ("sourceResourceId".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaPointInTimeRestoreRequest.withSourceResourceId(reader.getString()); + } else if ("propertyBag".equals(fieldName)) { + Map propertyBag = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureWorkloadSAPHanaPointInTimeRestoreRequest.withPropertyBag(propertyBag); + } else if ("targetInfo".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaPointInTimeRestoreRequest + .withTargetInfo(TargetRestoreInfo.fromJson(reader)); + } else if ("recoveryMode".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaPointInTimeRestoreRequest + .withRecoveryMode(RecoveryMode.fromString(reader.getString())); + } else if ("targetVirtualMachineId".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaPointInTimeRestoreRequest + .withTargetVirtualMachineId(reader.getString()); + } else if ("objectType".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaPointInTimeRestoreRequest.objectType = reader.getString(); + } else if ("pointInTime".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaPointInTimeRestoreRequest.pointInTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureWorkloadSAPHanaPointInTimeRestoreRequest; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaRecoveryPoint.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaRecoveryPoint.java new file mode 100644 index 000000000000..69a4125497ed --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaRecoveryPoint.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints. + */ +@Immutable +public final class AzureWorkloadSAPHanaRecoveryPoint extends AzureWorkloadRecoveryPoint { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "AzureWorkloadSAPHanaRecoveryPoint"; + + /** + * Creates an instance of AzureWorkloadSAPHanaRecoveryPoint class. + */ + private AzureWorkloadSAPHanaRecoveryPoint() { + } + + /** + * 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 JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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 AzureWorkloadSAPHanaRecoveryPoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureWorkloadSAPHanaRecoveryPoint 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 AzureWorkloadSAPHanaRecoveryPoint. + */ + public static AzureWorkloadSAPHanaRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureWorkloadSAPHanaRecoveryPoint deserializedAzureWorkloadSAPHanaRecoveryPoint + = new AzureWorkloadSAPHanaRecoveryPoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recoveryPointTimeInUTC".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaRecoveryPoint.withRecoveryPointTimeInUTC(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("type".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaRecoveryPoint + .withType(RestorePointType.fromString(reader.getString())); + } else if ("recoveryPointTierDetails".equals(fieldName)) { + List recoveryPointTierDetails + = reader.readArray(reader1 -> RecoveryPointTierInformation.fromJson(reader1)); + deserializedAzureWorkloadSAPHanaRecoveryPoint + .withRecoveryPointTierDetails(recoveryPointTierDetails); + } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) { + Map recoveryPointMoveReadinessInfo + = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1)); + deserializedAzureWorkloadSAPHanaRecoveryPoint + .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); + } else if ("recoveryPointProperties".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaRecoveryPoint + .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader)); + } else if ("objectType".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaRecoveryPoint.objectType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureWorkloadSAPHanaRecoveryPoint; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaRestoreRequest.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaRestoreRequest.java new file mode 100644 index 000000000000..723be4c8c725 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaRestoreRequest.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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.Map; + +/** + * AzureWorkload SAP Hana-specific restore. + */ +@Fluent +public class AzureWorkloadSAPHanaRestoreRequest extends AzureWorkloadRestoreRequest { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "AzureWorkloadSAPHanaRestoreRequest"; + + /** + * Creates an instance of AzureWorkloadSAPHanaRestoreRequest class. + */ + public AzureWorkloadSAPHanaRestoreRequest() { + } + + /** + * 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 AzureWorkloadSAPHanaRestoreRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSAPHanaRestoreRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSAPHanaRestoreRequest withPropertyBag(Map propertyBag) { + super.withPropertyBag(propertyBag); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSAPHanaRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { + super.withTargetInfo(targetInfo); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSAPHanaRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { + super.withRecoveryMode(recoveryMode); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSAPHanaRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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("targetVirtualMachineId", targetVirtualMachineId()); + jsonWriter.writeStringField("objectType", this.objectType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureWorkloadSAPHanaRestoreRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureWorkloadSAPHanaRestoreRequest 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 AzureWorkloadSAPHanaRestoreRequest. + */ + public static AzureWorkloadSAPHanaRestoreRequest 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 ("AzureWorkloadSAPHanaPointInTimeRestoreRequest".equals(discriminatorValue)) { + return AzureWorkloadSAPHanaPointInTimeRestoreRequest.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static AzureWorkloadSAPHanaRestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureWorkloadSAPHanaRestoreRequest deserializedAzureWorkloadSAPHanaRestoreRequest + = new AzureWorkloadSAPHanaRestoreRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recoveryType".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaRestoreRequest + .withRecoveryType(RecoveryType.fromString(reader.getString())); + } else if ("sourceResourceId".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaRestoreRequest.withSourceResourceId(reader.getString()); + } else if ("propertyBag".equals(fieldName)) { + Map propertyBag = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureWorkloadSAPHanaRestoreRequest.withPropertyBag(propertyBag); + } else if ("targetInfo".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaRestoreRequest.withTargetInfo(TargetRestoreInfo.fromJson(reader)); + } else if ("recoveryMode".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaRestoreRequest + .withRecoveryMode(RecoveryMode.fromString(reader.getString())); + } else if ("targetVirtualMachineId".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaRestoreRequest.withTargetVirtualMachineId(reader.getString()); + } else if ("objectType".equals(fieldName)) { + deserializedAzureWorkloadSAPHanaRestoreRequest.objectType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureWorkloadSAPHanaRestoreRequest; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLPointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLPointInTimeRecoveryPoint.java new file mode 100644 index 000000000000..723c2bf262c7 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLPointInTimeRecoveryPoint.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Recovery point specific to PointInTime. + */ +@Immutable +public final class AzureWorkloadSQLPointInTimeRecoveryPoint extends AzureWorkloadSQLRecoveryPoint { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "AzureWorkloadSQLPointInTimeRecoveryPoint"; + + /* + * List of log ranges + */ + private List timeRanges; + + /** + * Creates an instance of AzureWorkloadSQLPointInTimeRecoveryPoint class. + */ + private AzureWorkloadSQLPointInTimeRecoveryPoint() { + } + + /** + * 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 timeRanges property: List of log ranges. + * + * @return the timeRanges value. + */ + public List timeRanges() { + return this.timeRanges; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("recoveryPointTierDetails", recoveryPointTierDetails(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", recoveryPointMoveReadinessInfo(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("recoveryPointProperties", recoveryPointProperties()); + jsonWriter.writeJsonField("extendedInfo", extendedInfo()); + jsonWriter.writeStringField("objectType", this.objectType); + jsonWriter.writeArrayField("timeRanges", this.timeRanges, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureWorkloadSQLPointInTimeRecoveryPoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureWorkloadSQLPointInTimeRecoveryPoint 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 AzureWorkloadSQLPointInTimeRecoveryPoint. + */ + public static AzureWorkloadSQLPointInTimeRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureWorkloadSQLPointInTimeRecoveryPoint deserializedAzureWorkloadSQLPointInTimeRecoveryPoint + = new AzureWorkloadSQLPointInTimeRecoveryPoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recoveryPointTimeInUTC".equals(fieldName)) { + deserializedAzureWorkloadSQLPointInTimeRecoveryPoint.withRecoveryPointTimeInUTC(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("type".equals(fieldName)) { + deserializedAzureWorkloadSQLPointInTimeRecoveryPoint + .withType(RestorePointType.fromString(reader.getString())); + } else if ("recoveryPointTierDetails".equals(fieldName)) { + List recoveryPointTierDetails + = reader.readArray(reader1 -> RecoveryPointTierInformation.fromJson(reader1)); + deserializedAzureWorkloadSQLPointInTimeRecoveryPoint + .withRecoveryPointTierDetails(recoveryPointTierDetails); + } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) { + Map recoveryPointMoveReadinessInfo + = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1)); + deserializedAzureWorkloadSQLPointInTimeRecoveryPoint + .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); + } else if ("recoveryPointProperties".equals(fieldName)) { + deserializedAzureWorkloadSQLPointInTimeRecoveryPoint + .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader)); + } else if ("extendedInfo".equals(fieldName)) { + deserializedAzureWorkloadSQLPointInTimeRecoveryPoint + .withExtendedInfo(AzureWorkloadSQLRecoveryPointExtendedInfo.fromJson(reader)); + } else if ("objectType".equals(fieldName)) { + deserializedAzureWorkloadSQLPointInTimeRecoveryPoint.objectType = reader.getString(); + } else if ("timeRanges".equals(fieldName)) { + List timeRanges = reader.readArray(reader1 -> PointInTimeRange.fromJson(reader1)); + deserializedAzureWorkloadSQLPointInTimeRecoveryPoint.timeRanges = timeRanges; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureWorkloadSQLPointInTimeRecoveryPoint; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLPointInTimeRestoreRequest.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLPointInTimeRestoreRequest.java new file mode 100644 index 000000000000..000c2987de46 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLPointInTimeRestoreRequest.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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 SQL -specific restore. Specifically for PointInTime/Log restore. + */ +@Fluent +public final class AzureWorkloadSQLPointInTimeRestoreRequest extends AzureWorkloadSQLRestoreRequest { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "AzureWorkloadSQLPointInTimeRestoreRequest"; + + /* + * PointInTime value + */ + private OffsetDateTime pointInTime; + + /** + * Creates an instance of AzureWorkloadSQLPointInTimeRestoreRequest class. + */ + public AzureWorkloadSQLPointInTimeRestoreRequest() { + } + + /** + * 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 AzureWorkloadSQLPointInTimeRestoreRequest object itself. + */ + public AzureWorkloadSQLPointInTimeRestoreRequest withPointInTime(OffsetDateTime pointInTime) { + this.pointInTime = pointInTime; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLPointInTimeRestoreRequest + withShouldUseAlternateTargetLocation(Boolean shouldUseAlternateTargetLocation) { + super.withShouldUseAlternateTargetLocation(shouldUseAlternateTargetLocation); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLPointInTimeRestoreRequest withIsNonRecoverable(Boolean isNonRecoverable) { + super.withIsNonRecoverable(isNonRecoverable); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLPointInTimeRestoreRequest + withAlternateDirectoryPaths(List alternateDirectoryPaths) { + super.withAlternateDirectoryPaths(alternateDirectoryPaths); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLPointInTimeRestoreRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLPointInTimeRestoreRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLPointInTimeRestoreRequest withPropertyBag(Map propertyBag) { + super.withPropertyBag(propertyBag); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLPointInTimeRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { + super.withTargetInfo(targetInfo); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLPointInTimeRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { + super.withRecoveryMode(recoveryMode); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLPointInTimeRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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("targetVirtualMachineId", targetVirtualMachineId()); + jsonWriter.writeBooleanField("shouldUseAlternateTargetLocation", shouldUseAlternateTargetLocation()); + jsonWriter.writeBooleanField("isNonRecoverable", isNonRecoverable()); + jsonWriter.writeArrayField("alternateDirectoryPaths", alternateDirectoryPaths(), + (writer, element) -> writer.writeJson(element)); + 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 AzureWorkloadSQLPointInTimeRestoreRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureWorkloadSQLPointInTimeRestoreRequest 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 AzureWorkloadSQLPointInTimeRestoreRequest. + */ + public static AzureWorkloadSQLPointInTimeRestoreRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureWorkloadSQLPointInTimeRestoreRequest deserializedAzureWorkloadSQLPointInTimeRestoreRequest + = new AzureWorkloadSQLPointInTimeRestoreRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recoveryType".equals(fieldName)) { + deserializedAzureWorkloadSQLPointInTimeRestoreRequest + .withRecoveryType(RecoveryType.fromString(reader.getString())); + } else if ("sourceResourceId".equals(fieldName)) { + deserializedAzureWorkloadSQLPointInTimeRestoreRequest.withSourceResourceId(reader.getString()); + } else if ("propertyBag".equals(fieldName)) { + Map propertyBag = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureWorkloadSQLPointInTimeRestoreRequest.withPropertyBag(propertyBag); + } else if ("targetInfo".equals(fieldName)) { + deserializedAzureWorkloadSQLPointInTimeRestoreRequest + .withTargetInfo(TargetRestoreInfo.fromJson(reader)); + } else if ("recoveryMode".equals(fieldName)) { + deserializedAzureWorkloadSQLPointInTimeRestoreRequest + .withRecoveryMode(RecoveryMode.fromString(reader.getString())); + } else if ("targetVirtualMachineId".equals(fieldName)) { + deserializedAzureWorkloadSQLPointInTimeRestoreRequest + .withTargetVirtualMachineId(reader.getString()); + } else if ("shouldUseAlternateTargetLocation".equals(fieldName)) { + deserializedAzureWorkloadSQLPointInTimeRestoreRequest + .withShouldUseAlternateTargetLocation(reader.getNullable(JsonReader::getBoolean)); + } else if ("isNonRecoverable".equals(fieldName)) { + deserializedAzureWorkloadSQLPointInTimeRestoreRequest + .withIsNonRecoverable(reader.getNullable(JsonReader::getBoolean)); + } else if ("alternateDirectoryPaths".equals(fieldName)) { + List alternateDirectoryPaths + = reader.readArray(reader1 -> SQLDataDirectoryMapping.fromJson(reader1)); + deserializedAzureWorkloadSQLPointInTimeRestoreRequest + .withAlternateDirectoryPaths(alternateDirectoryPaths); + } else if ("objectType".equals(fieldName)) { + deserializedAzureWorkloadSQLPointInTimeRestoreRequest.objectType = reader.getString(); + } else if ("pointInTime".equals(fieldName)) { + deserializedAzureWorkloadSQLPointInTimeRestoreRequest.pointInTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureWorkloadSQLPointInTimeRestoreRequest; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRecoveryPoint.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRecoveryPoint.java new file mode 100644 index 000000000000..7477b445e556 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRecoveryPoint.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info. + */ +@Immutable +public class AzureWorkloadSQLRecoveryPoint extends AzureWorkloadRecoveryPoint { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "AzureWorkloadSQLRecoveryPoint"; + + /* + * Extended Info that provides data directory details. Will be populated in two cases: + * When a specific recovery point is accessed using GetRecoveryPoint + * Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter + */ + private AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo; + + /** + * Creates an instance of AzureWorkloadSQLRecoveryPoint class. + */ + protected AzureWorkloadSQLRecoveryPoint() { + } + + /** + * 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 extendedInfo property: Extended Info that provides data directory details. Will be populated in two + * cases: + * When a specific recovery point is accessed using GetRecoveryPoint + * Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter. + * + * @return the extendedInfo value. + */ + public AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Extended Info that provides data directory details. Will be populated in two + * cases: + * When a specific recovery point is accessed using GetRecoveryPoint + * Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter. + * + * @param extendedInfo the extendedInfo value to set. + * @return the AzureWorkloadSQLRecoveryPoint object itself. + */ + AzureWorkloadSQLRecoveryPoint withExtendedInfo(AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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.writeJsonField("extendedInfo", this.extendedInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureWorkloadSQLRecoveryPoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureWorkloadSQLRecoveryPoint 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 AzureWorkloadSQLRecoveryPoint. + */ + public static AzureWorkloadSQLRecoveryPoint 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 ("AzureWorkloadSQLPointInTimeRecoveryPoint".equals(discriminatorValue)) { + return AzureWorkloadSQLPointInTimeRecoveryPoint.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static AzureWorkloadSQLRecoveryPoint fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureWorkloadSQLRecoveryPoint deserializedAzureWorkloadSQLRecoveryPoint + = new AzureWorkloadSQLRecoveryPoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recoveryPointTimeInUTC".equals(fieldName)) { + deserializedAzureWorkloadSQLRecoveryPoint.withRecoveryPointTimeInUTC(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("type".equals(fieldName)) { + deserializedAzureWorkloadSQLRecoveryPoint.withType(RestorePointType.fromString(reader.getString())); + } else if ("recoveryPointTierDetails".equals(fieldName)) { + List recoveryPointTierDetails + = reader.readArray(reader1 -> RecoveryPointTierInformation.fromJson(reader1)); + deserializedAzureWorkloadSQLRecoveryPoint.withRecoveryPointTierDetails(recoveryPointTierDetails); + } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) { + Map recoveryPointMoveReadinessInfo + = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1)); + deserializedAzureWorkloadSQLRecoveryPoint + .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); + } else if ("recoveryPointProperties".equals(fieldName)) { + deserializedAzureWorkloadSQLRecoveryPoint + .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader)); + } else if ("objectType".equals(fieldName)) { + deserializedAzureWorkloadSQLRecoveryPoint.objectType = reader.getString(); + } else if ("extendedInfo".equals(fieldName)) { + deserializedAzureWorkloadSQLRecoveryPoint.extendedInfo + = AzureWorkloadSQLRecoveryPointExtendedInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureWorkloadSQLRecoveryPoint; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRecoveryPointExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRecoveryPointExtendedInfo.java new file mode 100644 index 000000000000..bfb1074871cd --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRecoveryPointExtendedInfo.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Extended info class details. + */ +@Immutable +public final class AzureWorkloadSQLRecoveryPointExtendedInfo + implements JsonSerializable { + /* + * UTC time at which data directory info was captured + */ + private OffsetDateTime dataDirectoryTimeInUTC; + + /* + * List of data directory paths during restore operation. + */ + private List dataDirectoryPaths; + + /** + * Creates an instance of AzureWorkloadSQLRecoveryPointExtendedInfo class. + */ + private AzureWorkloadSQLRecoveryPointExtendedInfo() { + } + + /** + * Get the dataDirectoryTimeInUTC property: UTC time at which data directory info was captured. + * + * @return the dataDirectoryTimeInUTC value. + */ + public OffsetDateTime dataDirectoryTimeInUTC() { + return this.dataDirectoryTimeInUTC; + } + + /** + * Get the dataDirectoryPaths property: List of data directory paths during restore operation. + * + * @return the dataDirectoryPaths value. + */ + public List dataDirectoryPaths() { + return this.dataDirectoryPaths; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureWorkloadSQLRecoveryPointExtendedInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureWorkloadSQLRecoveryPointExtendedInfo 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 AzureWorkloadSQLRecoveryPointExtendedInfo. + */ + public static AzureWorkloadSQLRecoveryPointExtendedInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureWorkloadSQLRecoveryPointExtendedInfo deserializedAzureWorkloadSQLRecoveryPointExtendedInfo + = new AzureWorkloadSQLRecoveryPointExtendedInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataDirectoryTimeInUTC".equals(fieldName)) { + deserializedAzureWorkloadSQLRecoveryPointExtendedInfo.dataDirectoryTimeInUTC = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("dataDirectoryPaths".equals(fieldName)) { + List dataDirectoryPaths + = reader.readArray(reader1 -> SQLDataDirectory.fromJson(reader1)); + deserializedAzureWorkloadSQLRecoveryPointExtendedInfo.dataDirectoryPaths = dataDirectoryPaths; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureWorkloadSQLRecoveryPointExtendedInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRestoreRequest.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRestoreRequest.java new file mode 100644 index 000000000000..d42d4db0abcc --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRestoreRequest.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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 SQL -specific restore. Specifically for full/diff restore. + */ +@Fluent +public class AzureWorkloadSQLRestoreRequest extends AzureWorkloadRestoreRequest { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "AzureWorkloadSQLRestoreRequest"; + + /* + * Default option set to true. If this is set to false, alternate data directory must be provided + */ + private Boolean shouldUseAlternateTargetLocation; + + /* + * SQL specific property where user can chose to set no-recovery when restore operation is tried + */ + private Boolean isNonRecoverable; + + /* + * Data directory details + */ + private List alternateDirectoryPaths; + + /** + * Creates an instance of AzureWorkloadSQLRestoreRequest class. + */ + public AzureWorkloadSQLRestoreRequest() { + } + + /** + * 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 shouldUseAlternateTargetLocation property: Default option set to true. If this is set to false, alternate + * data directory must be provided. + * + * @return the shouldUseAlternateTargetLocation value. + */ + public Boolean shouldUseAlternateTargetLocation() { + return this.shouldUseAlternateTargetLocation; + } + + /** + * Set the shouldUseAlternateTargetLocation property: Default option set to true. If this is set to false, alternate + * data directory must be provided. + * + * @param shouldUseAlternateTargetLocation the shouldUseAlternateTargetLocation value to set. + * @return the AzureWorkloadSQLRestoreRequest object itself. + */ + public AzureWorkloadSQLRestoreRequest + withShouldUseAlternateTargetLocation(Boolean shouldUseAlternateTargetLocation) { + this.shouldUseAlternateTargetLocation = shouldUseAlternateTargetLocation; + return this; + } + + /** + * Get the isNonRecoverable property: SQL specific property where user can chose to set no-recovery when restore + * operation is tried. + * + * @return the isNonRecoverable value. + */ + public Boolean isNonRecoverable() { + return this.isNonRecoverable; + } + + /** + * Set the isNonRecoverable property: SQL specific property where user can chose to set no-recovery when restore + * operation is tried. + * + * @param isNonRecoverable the isNonRecoverable value to set. + * @return the AzureWorkloadSQLRestoreRequest object itself. + */ + public AzureWorkloadSQLRestoreRequest withIsNonRecoverable(Boolean isNonRecoverable) { + this.isNonRecoverable = isNonRecoverable; + return this; + } + + /** + * Get the alternateDirectoryPaths property: Data directory details. + * + * @return the alternateDirectoryPaths value. + */ + public List alternateDirectoryPaths() { + return this.alternateDirectoryPaths; + } + + /** + * Set the alternateDirectoryPaths property: Data directory details. + * + * @param alternateDirectoryPaths the alternateDirectoryPaths value to set. + * @return the AzureWorkloadSQLRestoreRequest object itself. + */ + public AzureWorkloadSQLRestoreRequest + withAlternateDirectoryPaths(List alternateDirectoryPaths) { + this.alternateDirectoryPaths = alternateDirectoryPaths; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLRestoreRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLRestoreRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLRestoreRequest withPropertyBag(Map propertyBag) { + super.withPropertyBag(propertyBag); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { + super.withTargetInfo(targetInfo); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { + super.withRecoveryMode(recoveryMode); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureWorkloadSQLRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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("targetVirtualMachineId", targetVirtualMachineId()); + jsonWriter.writeStringField("objectType", this.objectType); + jsonWriter.writeBooleanField("shouldUseAlternateTargetLocation", this.shouldUseAlternateTargetLocation); + jsonWriter.writeBooleanField("isNonRecoverable", this.isNonRecoverable); + jsonWriter.writeArrayField("alternateDirectoryPaths", this.alternateDirectoryPaths, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureWorkloadSQLRestoreRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureWorkloadSQLRestoreRequest 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 AzureWorkloadSQLRestoreRequest. + */ + public static AzureWorkloadSQLRestoreRequest 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 ("AzureWorkloadSQLPointInTimeRestoreRequest".equals(discriminatorValue)) { + return AzureWorkloadSQLPointInTimeRestoreRequest.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static AzureWorkloadSQLRestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureWorkloadSQLRestoreRequest deserializedAzureWorkloadSQLRestoreRequest + = new AzureWorkloadSQLRestoreRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recoveryType".equals(fieldName)) { + deserializedAzureWorkloadSQLRestoreRequest + .withRecoveryType(RecoveryType.fromString(reader.getString())); + } else if ("sourceResourceId".equals(fieldName)) { + deserializedAzureWorkloadSQLRestoreRequest.withSourceResourceId(reader.getString()); + } else if ("propertyBag".equals(fieldName)) { + Map propertyBag = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureWorkloadSQLRestoreRequest.withPropertyBag(propertyBag); + } else if ("targetInfo".equals(fieldName)) { + deserializedAzureWorkloadSQLRestoreRequest.withTargetInfo(TargetRestoreInfo.fromJson(reader)); + } else if ("recoveryMode".equals(fieldName)) { + deserializedAzureWorkloadSQLRestoreRequest + .withRecoveryMode(RecoveryMode.fromString(reader.getString())); + } else if ("targetVirtualMachineId".equals(fieldName)) { + deserializedAzureWorkloadSQLRestoreRequest.withTargetVirtualMachineId(reader.getString()); + } else if ("objectType".equals(fieldName)) { + deserializedAzureWorkloadSQLRestoreRequest.objectType = reader.getString(); + } else if ("shouldUseAlternateTargetLocation".equals(fieldName)) { + deserializedAzureWorkloadSQLRestoreRequest.shouldUseAlternateTargetLocation + = reader.getNullable(JsonReader::getBoolean); + } else if ("isNonRecoverable".equals(fieldName)) { + deserializedAzureWorkloadSQLRestoreRequest.isNonRecoverable + = reader.getNullable(JsonReader::getBoolean); + } else if ("alternateDirectoryPaths".equals(fieldName)) { + List alternateDirectoryPaths + = reader.readArray(reader1 -> SQLDataDirectoryMapping.fromJson(reader1)); + deserializedAzureWorkloadSQLRestoreRequest.alternateDirectoryPaths = alternateDirectoryPaths; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureWorkloadSQLRestoreRequest; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BEKDetails.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BEKDetails.java new file mode 100644 index 000000000000..9e37408e963b --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BEKDetails.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * BEK is bitlocker encryption key. + */ +@Immutable +public final class BEKDetails implements JsonSerializable { + /* + * Secret is BEK. + */ + private String secretUrl; + + /* + * ID of the Key Vault where this Secret is stored. + */ + private String secretVaultId; + + /* + * BEK data. + */ + private String secretData; + + /** + * Creates an instance of BEKDetails class. + */ + private BEKDetails() { + } + + /** + * Get the secretUrl property: Secret is BEK. + * + * @return the secretUrl value. + */ + public String secretUrl() { + return this.secretUrl; + } + + /** + * Get the secretVaultId property: ID of the Key Vault where this Secret is stored. + * + * @return the secretVaultId value. + */ + public String secretVaultId() { + return this.secretVaultId; + } + + /** + * Get the secretData property: BEK data. + * + * @return the secretData value. + */ + public String secretData() { + return this.secretData; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("secretUrl", this.secretUrl); + jsonWriter.writeStringField("secretVaultId", this.secretVaultId); + jsonWriter.writeStringField("secretData", this.secretData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BEKDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BEKDetails 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 BEKDetails. + */ + public static BEKDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BEKDetails deserializedBEKDetails = new BEKDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secretUrl".equals(fieldName)) { + deserializedBEKDetails.secretUrl = reader.getString(); + } else if ("secretVaultId".equals(fieldName)) { + deserializedBEKDetails.secretVaultId = reader.getString(); + } else if ("secretData".equals(fieldName)) { + deserializedBEKDetails.secretData = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBEKDetails; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupCrrJobDetails.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupCrrJobDetails.java new file mode 100644 index 000000000000..7362ca99eaad --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupCrrJobDetails.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of BackupCrrJobDetails. + */ +public interface BackupCrrJobDetails { + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @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 cRR job details from target region along with {@link Response}. + */ + Response getWithResponse(String azureRegion, CrrJobRequest parameters, Context context); + + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cRR job details from target region. + */ + JobResource get(String azureRegion, CrrJobRequest parameters); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupCrrJobs.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupCrrJobs.java new file mode 100644 index 000000000000..889461cc6302 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupCrrJobs.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of BackupCrrJobs. + */ +public interface BackupCrrJobs { + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region along with {@link Response}. + */ + Response listWithResponse(String azureRegion, CrrJobRequest parameters, String filter, + String skipToken, Context context); + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region. + */ + JobResourceList list(String azureRegion, CrrJobRequest parameters); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementType.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementType.java new file mode 100644 index 000000000000..15d0059f6682 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementType.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Backup management type to execute the current job. + */ +public final class BackupManagementType extends ExpandableStringEnum { + /** + * Static value Invalid for BackupManagementType. + */ + public static final BackupManagementType INVALID = fromString("Invalid"); + + /** + * Static value AzureIaasVM for BackupManagementType. + */ + public static final BackupManagementType AZURE_IAAS_VM = fromString("AzureIaasVM"); + + /** + * Static value MAB for BackupManagementType. + */ + public static final BackupManagementType MAB = fromString("MAB"); + + /** + * Static value DPM for BackupManagementType. + */ + public static final BackupManagementType DPM = fromString("DPM"); + + /** + * Static value AzureBackupServer for BackupManagementType. + */ + public static final BackupManagementType AZURE_BACKUP_SERVER = fromString("AzureBackupServer"); + + /** + * Static value AzureSql for BackupManagementType. + */ + public static final BackupManagementType AZURE_SQL = fromString("AzureSql"); + + /** + * Static value AzureStorage for BackupManagementType. + */ + public static final BackupManagementType AZURE_STORAGE = fromString("AzureStorage"); + + /** + * Static value AzureWorkload for BackupManagementType. + */ + public static final BackupManagementType AZURE_WORKLOAD = fromString("AzureWorkload"); + + /** + * Static value DefaultBackup for BackupManagementType. + */ + public static final BackupManagementType DEFAULT_BACKUP = fromString("DefaultBackup"); + + /** + * Creates a new instance of BackupManagementType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BackupManagementType() { + } + + /** + * Creates or finds a BackupManagementType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupManagementType. + */ + public static BackupManagementType fromString(String name) { + return fromString(name, BackupManagementType.class); + } + + /** + * Gets known BackupManagementType values. + * + * @return known BackupManagementType values. + */ + public static Collection values() { + return values(BackupManagementType.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementUsage.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementUsage.java new file mode 100644 index 000000000000..aadc167ef81c --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementUsage.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Backup management usages of a vault. + */ +@Immutable +public final class BackupManagementUsage implements JsonSerializable { + /* + * Unit of the usage. + */ + private UsagesUnit unit; + + /* + * Quota period of usage. + */ + private String quotaPeriod; + + /* + * Next reset time of usage. + */ + private OffsetDateTime nextResetTime; + + /* + * Current value of usage. + */ + private Long currentValue; + + /* + * Limit of usage. + */ + private Long limit; + + /* + * Name of usage. + */ + private NameInfo name; + + /** + * Creates an instance of BackupManagementUsage class. + */ + private BackupManagementUsage() { + } + + /** + * Get the unit property: Unit of the usage. + * + * @return the unit value. + */ + public UsagesUnit unit() { + return this.unit; + } + + /** + * Get the quotaPeriod property: Quota period of usage. + * + * @return the quotaPeriod value. + */ + public String quotaPeriod() { + return this.quotaPeriod; + } + + /** + * Get the nextResetTime property: Next reset time of usage. + * + * @return the nextResetTime value. + */ + public OffsetDateTime nextResetTime() { + return this.nextResetTime; + } + + /** + * Get the currentValue property: Current value of usage. + * + * @return the currentValue value. + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Get the limit property: Limit of usage. + * + * @return the limit value. + */ + public Long limit() { + return this.limit; + } + + /** + * Get the name property: Name of usage. + * + * @return the name value. + */ + public NameInfo name() { + return this.name; + } + + /** + * {@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 BackupManagementUsage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupManagementUsage 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 BackupManagementUsage. + */ + public static BackupManagementUsage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupManagementUsage deserializedBackupManagementUsage = new BackupManagementUsage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("unit".equals(fieldName)) { + deserializedBackupManagementUsage.unit = UsagesUnit.fromString(reader.getString()); + } else if ("quotaPeriod".equals(fieldName)) { + deserializedBackupManagementUsage.quotaPeriod = reader.getString(); + } else if ("nextResetTime".equals(fieldName)) { + deserializedBackupManagementUsage.nextResetTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("currentValue".equals(fieldName)) { + deserializedBackupManagementUsage.currentValue = reader.getNullable(JsonReader::getLong); + } else if ("limit".equals(fieldName)) { + deserializedBackupManagementUsage.limit = reader.getNullable(JsonReader::getLong); + } else if ("name".equals(fieldName)) { + deserializedBackupManagementUsage.name = NameInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupManagementUsage; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementUsageList.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementUsageList.java new file mode 100644 index 000000000000..15479fde4cdd --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementUsageList.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupManagementUsageListInner; +import java.util.List; + +/** + * An immutable client-side representation of BackupManagementUsageList. + */ +public interface BackupManagementUsageList { + /** + * Gets the value property: The list of backup management usages for the given vault. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupManagementUsageListInner + * object. + * + * @return the inner object. + */ + BackupManagementUsageListInner innerModel(); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupProtectedItemsCrrs.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupProtectedItemsCrrs.java new file mode 100644 index 000000000000..41d31e6ac5e5 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupProtectedItemsCrrs.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of BackupProtectedItemsCrrs. + */ +public interface BackupProtectedItemsCrrs { + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @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 list of ProtectedItem resources along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String vaultName, String filter, + String skipToken, Context context); + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 list of ProtectedItem resources. + */ + ProtectedItemResourceList list(String resourceGroupName, String vaultName); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceConfig.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceConfig.java new file mode 100644 index 000000000000..1e2f0fcf86b2 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceConfig.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The resource storage details. + */ +@Fluent +public final class BackupResourceConfig implements JsonSerializable { + /* + * Storage type + */ + private StorageType storageModelType; + + /* + * Storage type. + */ + private StorageType storageType; + + /* + * Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + */ + private StorageTypeState storageTypeState; + + /* + * Opt in details of Cross Region Restore feature. + */ + private Boolean crossRegionRestoreFlag; + + /** + * Creates an instance of BackupResourceConfig class. + */ + public BackupResourceConfig() { + } + + /** + * Get the storageModelType property: Storage type. + * + * @return the storageModelType value. + */ + public StorageType storageModelType() { + return this.storageModelType; + } + + /** + * Set the storageModelType property: Storage type. + * + * @param storageModelType the storageModelType value to set. + * @return the BackupResourceConfig object itself. + */ + public BackupResourceConfig withStorageModelType(StorageType storageModelType) { + this.storageModelType = storageModelType; + return this; + } + + /** + * Get the storageType property: Storage type. + * + * @return the storageType value. + */ + public StorageType storageType() { + return this.storageType; + } + + /** + * Set the storageType property: Storage type. + * + * @param storageType the storageType value to set. + * @return the BackupResourceConfig object itself. + */ + public BackupResourceConfig withStorageType(StorageType storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the storageTypeState property: Locked or Unlocked. Once a machine is registered against a resource, the + * storageTypeState is always Locked. + * + * @return the storageTypeState value. + */ + public StorageTypeState storageTypeState() { + return this.storageTypeState; + } + + /** + * Set the storageTypeState property: Locked or Unlocked. Once a machine is registered against a resource, the + * storageTypeState is always Locked. + * + * @param storageTypeState the storageTypeState value to set. + * @return the BackupResourceConfig object itself. + */ + public BackupResourceConfig withStorageTypeState(StorageTypeState storageTypeState) { + this.storageTypeState = storageTypeState; + return this; + } + + /** + * Get the crossRegionRestoreFlag property: Opt in details of Cross Region Restore feature. + * + * @return the crossRegionRestoreFlag value. + */ + public Boolean crossRegionRestoreFlag() { + return this.crossRegionRestoreFlag; + } + + /** + * Set the crossRegionRestoreFlag property: Opt in details of Cross Region Restore feature. + * + * @param crossRegionRestoreFlag the crossRegionRestoreFlag value to set. + * @return the BackupResourceConfig object itself. + */ + public BackupResourceConfig withCrossRegionRestoreFlag(Boolean crossRegionRestoreFlag) { + this.crossRegionRestoreFlag = crossRegionRestoreFlag; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageModelType", + this.storageModelType == null ? null : this.storageModelType.toString()); + jsonWriter.writeStringField("storageType", this.storageType == null ? null : this.storageType.toString()); + jsonWriter.writeStringField("storageTypeState", + this.storageTypeState == null ? null : this.storageTypeState.toString()); + jsonWriter.writeBooleanField("crossRegionRestoreFlag", this.crossRegionRestoreFlag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupResourceConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupResourceConfig 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 BackupResourceConfig. + */ + public static BackupResourceConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupResourceConfig deserializedBackupResourceConfig = new BackupResourceConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageModelType".equals(fieldName)) { + deserializedBackupResourceConfig.storageModelType = StorageType.fromString(reader.getString()); + } else if ("storageType".equals(fieldName)) { + deserializedBackupResourceConfig.storageType = StorageType.fromString(reader.getString()); + } else if ("storageTypeState".equals(fieldName)) { + deserializedBackupResourceConfig.storageTypeState = StorageTypeState.fromString(reader.getString()); + } else if ("crossRegionRestoreFlag".equals(fieldName)) { + deserializedBackupResourceConfig.crossRegionRestoreFlag + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupResourceConfig; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceConfigResource.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceConfigResource.java new file mode 100644 index 000000000000..08430aee8af7 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceConfigResource.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupResourceConfigResourceInner; +import java.util.Map; + +/** + * An immutable client-side representation of BackupResourceConfigResource. + */ +public interface BackupResourceConfigResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: BackupResourceConfigResource properties. + * + * @return the properties value. + */ + BackupResourceConfig properties(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the eTag property: Optional ETag. + * + * @return the eTag value. + */ + String eTag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupResourceConfigResourceInner + * object. + * + * @return the inner object. + */ + BackupResourceConfigResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceStorageConfigs.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceStorageConfigs.java new file mode 100644 index 000000000000..70e3ecc1a924 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceStorageConfigs.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupResourceConfigResourceInner; + +/** + * Resource collection API of BackupResourceStorageConfigs. + */ +public interface BackupResourceStorageConfigs { + /** + * Fetches resource storage config. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String vaultName, Context context); + + /** + * Fetches resource storage config. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + BackupResourceConfigResource get(String resourceGroupName, String vaultName); + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details along with {@link Response}. + */ + Response updateWithResponse(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters, Context context); + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + BackupResourceConfigResource update(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters); + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response patchWithResponse(String resourceGroupName, String vaultName, + BackupResourceConfigResourceInner parameters, Context context); + + /** + * Updates vault storage model type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void patch(String resourceGroupName, String vaultName, BackupResourceConfigResourceInner parameters); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupUsageSummariesCRRs.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupUsageSummariesCRRs.java new file mode 100644 index 000000000000..b57947492911 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupUsageSummariesCRRs.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of BackupUsageSummariesCRRs. + */ +public interface BackupUsageSummariesCRRs { + /** + * Fetches the backup management usage summaries of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @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 backup management usage for vault along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String vaultName, String filter, + String skipToken, Context context); + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 backup management usage for vault. + */ + BackupManagementUsageList list(String resourceGroupName, String vaultName); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ClientScriptForConnect.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ClientScriptForConnect.java new file mode 100644 index 000000000000..b39b0ff20538 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ClientScriptForConnect.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Client script details for file / folder restore. + */ +@Immutable +public final class ClientScriptForConnect implements JsonSerializable { + /* + * File content of the client script for file / folder restore. + */ + private String scriptContent; + + /* + * File extension of the client script for file / folder restore - .ps1 , .sh , etc. + */ + private String scriptExtension; + + /* + * OS type - Windows, Linux etc. for which this file / folder restore client script works. + */ + private String osType; + + /* + * URL of Executable from where to source the content. If this is not null then ScriptContent should not be used + */ + private String url; + + /* + * Mandatory suffix that should be added to the name of script that is given for download to user. + * If its null or empty then , ignore it. + */ + private String scriptNameSuffix; + + /** + * Creates an instance of ClientScriptForConnect class. + */ + private ClientScriptForConnect() { + } + + /** + * Get the scriptContent property: File content of the client script for file / folder restore. + * + * @return the scriptContent value. + */ + public String scriptContent() { + return this.scriptContent; + } + + /** + * Get the scriptExtension property: File extension of the client script for file / folder restore - .ps1 , .sh , + * etc. + * + * @return the scriptExtension value. + */ + public String scriptExtension() { + return this.scriptExtension; + } + + /** + * Get the osType property: OS type - Windows, Linux etc. for which this file / folder restore client script works. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Get the url property: URL of Executable from where to source the content. If this is not null then ScriptContent + * should not be used. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the scriptNameSuffix property: Mandatory suffix that should be added to the name of script that is given for + * download to user. + * If its null or empty then , ignore it. + * + * @return the scriptNameSuffix value. + */ + public String scriptNameSuffix() { + return this.scriptNameSuffix; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scriptContent", this.scriptContent); + jsonWriter.writeStringField("scriptExtension", this.scriptExtension); + jsonWriter.writeStringField("osType", this.osType); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("scriptNameSuffix", this.scriptNameSuffix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClientScriptForConnect from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClientScriptForConnect 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 ClientScriptForConnect. + */ + public static ClientScriptForConnect fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClientScriptForConnect deserializedClientScriptForConnect = new ClientScriptForConnect(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scriptContent".equals(fieldName)) { + deserializedClientScriptForConnect.scriptContent = reader.getString(); + } else if ("scriptExtension".equals(fieldName)) { + deserializedClientScriptForConnect.scriptExtension = reader.getString(); + } else if ("osType".equals(fieldName)) { + deserializedClientScriptForConnect.osType = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedClientScriptForConnect.url = reader.getString(); + } else if ("scriptNameSuffix".equals(fieldName)) { + deserializedClientScriptForConnect.scriptNameSuffix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClientScriptForConnect; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CopyOptions.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CopyOptions.java new file mode 100644 index 000000000000..94b62118ea7a --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CopyOptions.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Options to resolve copy conflicts. + */ +public final class CopyOptions extends ExpandableStringEnum { + /** + * Static value Invalid for CopyOptions. + */ + public static final CopyOptions INVALID = fromString("Invalid"); + + /** + * Static value CreateCopy for CopyOptions. + */ + public static final CopyOptions CREATE_COPY = fromString("CreateCopy"); + + /** + * Static value Skip for CopyOptions. + */ + public static final CopyOptions SKIP = fromString("Skip"); + + /** + * Static value Overwrite for CopyOptions. + */ + public static final CopyOptions OVERWRITE = fromString("Overwrite"); + + /** + * Static value FailOnConflict for CopyOptions. + */ + public static final CopyOptions FAIL_ON_CONFLICT = fromString("FailOnConflict"); + + /** + * Creates a new instance of CopyOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CopyOptions() { + } + + /** + * Creates or finds a CopyOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding CopyOptions. + */ + public static CopyOptions fromString(String name) { + return fromString(name, CopyOptions.class); + } + + /** + * Gets known CopyOptions values. + * + * @return known CopyOptions values. + */ + public static Collection values() { + return values(CopyOptions.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CreateMode.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CreateMode.java new file mode 100644 index 000000000000..75b12236fb20 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CreateMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + */ +public final class CreateMode extends ExpandableStringEnum { + /** + * Static value Invalid for CreateMode. + */ + public static final CreateMode INVALID = fromString("Invalid"); + + /** + * Static value Default for CreateMode. + */ + public static final CreateMode DEFAULT = fromString("Default"); + + /** + * Static value Recover for CreateMode. + */ + public static final CreateMode RECOVER = fromString("Recover"); + + /** + * Creates a new instance of CreateMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CreateMode() { + } + + /** + * Creates or finds a CreateMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding CreateMode. + */ + public static CreateMode fromString(String name) { + return fromString(name, CreateMode.class); + } + + /** + * Gets known CreateMode values. + * + * @return known CreateMode values. + */ + public static Collection values() { + return values(CreateMode.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrossRegionRestoreRequest.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrossRegionRestoreRequest.java new file mode 100644 index 000000000000..505dd718c16c --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrossRegionRestoreRequest.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CrossRegionRestoreRequest model. + */ +@Fluent +public final class CrossRegionRestoreRequest implements JsonSerializable { + /* + * Access details for cross region restore + */ + private CrrAccessToken crossRegionRestoreAccessDetails; + + /* + * Request object for triggering restore + */ + private RestoreRequest restoreRequest; + + /** + * Creates an instance of CrossRegionRestoreRequest class. + */ + public CrossRegionRestoreRequest() { + } + + /** + * Get the crossRegionRestoreAccessDetails property: Access details for cross region restore. + * + * @return the crossRegionRestoreAccessDetails value. + */ + public CrrAccessToken crossRegionRestoreAccessDetails() { + return this.crossRegionRestoreAccessDetails; + } + + /** + * Set the crossRegionRestoreAccessDetails property: Access details for cross region restore. + * + * @param crossRegionRestoreAccessDetails the crossRegionRestoreAccessDetails value to set. + * @return the CrossRegionRestoreRequest object itself. + */ + public CrossRegionRestoreRequest + withCrossRegionRestoreAccessDetails(CrrAccessToken crossRegionRestoreAccessDetails) { + this.crossRegionRestoreAccessDetails = crossRegionRestoreAccessDetails; + return this; + } + + /** + * Get the restoreRequest property: Request object for triggering restore. + * + * @return the restoreRequest value. + */ + public RestoreRequest restoreRequest() { + return this.restoreRequest; + } + + /** + * Set the restoreRequest property: Request object for triggering restore. + * + * @param restoreRequest the restoreRequest value to set. + * @return the CrossRegionRestoreRequest object itself. + */ + public CrossRegionRestoreRequest withRestoreRequest(RestoreRequest restoreRequest) { + this.restoreRequest = restoreRequest; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("crossRegionRestoreAccessDetails", this.crossRegionRestoreAccessDetails); + jsonWriter.writeJsonField("restoreRequest", this.restoreRequest); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CrossRegionRestoreRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CrossRegionRestoreRequest 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 CrossRegionRestoreRequest. + */ + public static CrossRegionRestoreRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CrossRegionRestoreRequest deserializedCrossRegionRestoreRequest = new CrossRegionRestoreRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("crossRegionRestoreAccessDetails".equals(fieldName)) { + deserializedCrossRegionRestoreRequest.crossRegionRestoreAccessDetails + = CrrAccessToken.fromJson(reader); + } else if ("restoreRequest".equals(fieldName)) { + deserializedCrossRegionRestoreRequest.restoreRequest = RestoreRequest.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCrossRegionRestoreRequest; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrossRegionRestores.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrossRegionRestores.java new file mode 100644 index 000000000000..37c93909156f --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrossRegionRestores.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CrossRegionRestores. + */ +public interface CrossRegionRestores { + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response triggerWithResponse(String azureRegion, CrossRegionRestoreRequest parameters, Context context); + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void trigger(String azureRegion, CrossRegionRestoreRequest parameters); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrAccessToken.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrAccessToken.java new file mode 100644 index 000000000000..250ac61d8bc9 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrAccessToken.java @@ -0,0 +1,802 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The CrrAccessToken model. + */ +@Fluent +public class CrrAccessToken implements JsonSerializable { + /* + * Type of the specific object - used for deserializing + */ + private String objectType = "CrrAccessToken"; + + /* + * Access token used for authentication + */ + private String accessTokenString; + + /* + * Subscription Id of the source vault + */ + private String subscriptionId; + + /* + * Resource Group name of the source vault + */ + private String resourceGroupName; + + /* + * Resource Name of the source vault + */ + private String resourceName; + + /* + * Resource Id of the source vault + */ + private String resourceId; + + /* + * Protected item container id + */ + private Long protectionContainerId; + + /* + * Recovery Point Id + */ + private String recoveryPointId; + + /* + * Recovery Point Time + */ + private String recoveryPointTime; + + /* + * Container Unique name + */ + private String containerName; + + /* + * Container Type + */ + private String containerType; + + /* + * Backup Management Type + */ + private String backupManagementType; + + /* + * Datasource Type + */ + private String datasourceType; + + /* + * Datasource Friendly Name + */ + private String datasourceName; + + /* + * Datasource Id + */ + private String datasourceId; + + /* + * Datasource Container Unique Name + */ + private String datasourceContainerName; + + /* + * CoordinatorServiceStampId to be used by BCM in restore call + */ + private String coordinatorServiceStampId; + + /* + * CoordinatorServiceStampUri to be used by BCM in restore call + */ + private String coordinatorServiceStampUri; + + /* + * ProtectionServiceStampId to be used by BCM in restore call + */ + private String protectionServiceStampId; + + /* + * ProtectionServiceStampUri to be used by BCM in restore call + */ + private String protectionServiceStampUri; + + /* + * Extended Information about the token like FileSpec etc. + */ + private String tokenExtendedInformation; + + /* + * Recovery point Tier Information + */ + private Map rpTierInformation; + + /* + * Recovery point information: Original SA option + */ + private Boolean rpOriginalSAOption; + + /* + * Recovery point information: Managed virtual machine + */ + private Boolean rpIsManagedVirtualMachine; + + /* + * Recovery point information: VM size description + */ + private String rpVMSizeDescription; + + /* + * Active region name of BMS Stamp + */ + private String bMSActiveRegion; + + /** + * Creates an instance of CrrAccessToken class. + */ + public CrrAccessToken() { + } + + /** + * Get the objectType property: Type of the specific object - used for deserializing. + * + * @return the objectType value. + */ + public String objectType() { + return this.objectType; + } + + /** + * Get the accessTokenString property: Access token used for authentication. + * + * @return the accessTokenString value. + */ + public String accessTokenString() { + return this.accessTokenString; + } + + /** + * Set the accessTokenString property: Access token used for authentication. + * + * @param accessTokenString the accessTokenString value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withAccessTokenString(String accessTokenString) { + this.accessTokenString = accessTokenString; + return this; + } + + /** + * Get the subscriptionId property: Subscription Id of the source vault. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Subscription Id of the source vault. + * + * @param subscriptionId the subscriptionId value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the resourceGroupName property: Resource Group name of the source vault. + * + * @return the resourceGroupName value. + */ + public String resourceGroupName() { + return this.resourceGroupName; + } + + /** + * Set the resourceGroupName property: Resource Group name of the source vault. + * + * @param resourceGroupName the resourceGroupName value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withResourceGroupName(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + /** + * Get the resourceName property: Resource Name of the source vault. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: Resource Name of the source vault. + * + * @param resourceName the resourceName value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the resourceId property: Resource Id of the source vault. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource Id of the source vault. + * + * @param resourceId the resourceId value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the protectionContainerId property: Protected item container id. + * + * @return the protectionContainerId value. + */ + public Long protectionContainerId() { + return this.protectionContainerId; + } + + /** + * Set the protectionContainerId property: Protected item container id. + * + * @param protectionContainerId the protectionContainerId value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withProtectionContainerId(Long protectionContainerId) { + this.protectionContainerId = protectionContainerId; + return this; + } + + /** + * Get the recoveryPointId property: Recovery Point Id. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: Recovery Point Id. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get the recoveryPointTime property: Recovery Point Time. + * + * @return the recoveryPointTime value. + */ + public String recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Set the recoveryPointTime property: Recovery Point Time. + * + * @param recoveryPointTime the recoveryPointTime value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withRecoveryPointTime(String recoveryPointTime) { + this.recoveryPointTime = recoveryPointTime; + return this; + } + + /** + * Get the containerName property: Container Unique name. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Container Unique name. + * + * @param containerName the containerName value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the containerType property: Container Type. + * + * @return the containerType value. + */ + public String containerType() { + return this.containerType; + } + + /** + * Set the containerType property: Container Type. + * + * @param containerType the containerType value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withContainerType(String containerType) { + this.containerType = containerType; + return this; + } + + /** + * Get the backupManagementType property: Backup Management Type. + * + * @return the backupManagementType value. + */ + public String backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backupManagementType property: Backup Management Type. + * + * @param backupManagementType the backupManagementType value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withBackupManagementType(String backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the datasourceType property: Datasource Type. + * + * @return the datasourceType value. + */ + public String datasourceType() { + return this.datasourceType; + } + + /** + * Set the datasourceType property: Datasource Type. + * + * @param datasourceType the datasourceType value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withDatasourceType(String datasourceType) { + this.datasourceType = datasourceType; + return this; + } + + /** + * Get the datasourceName property: Datasource Friendly Name. + * + * @return the datasourceName value. + */ + public String datasourceName() { + return this.datasourceName; + } + + /** + * Set the datasourceName property: Datasource Friendly Name. + * + * @param datasourceName the datasourceName value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withDatasourceName(String datasourceName) { + this.datasourceName = datasourceName; + return this; + } + + /** + * Get the datasourceId property: Datasource Id. + * + * @return the datasourceId value. + */ + public String datasourceId() { + return this.datasourceId; + } + + /** + * Set the datasourceId property: Datasource Id. + * + * @param datasourceId the datasourceId value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withDatasourceId(String datasourceId) { + this.datasourceId = datasourceId; + return this; + } + + /** + * Get the datasourceContainerName property: Datasource Container Unique Name. + * + * @return the datasourceContainerName value. + */ + public String datasourceContainerName() { + return this.datasourceContainerName; + } + + /** + * Set the datasourceContainerName property: Datasource Container Unique Name. + * + * @param datasourceContainerName the datasourceContainerName value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withDatasourceContainerName(String datasourceContainerName) { + this.datasourceContainerName = datasourceContainerName; + return this; + } + + /** + * Get the coordinatorServiceStampId property: CoordinatorServiceStampId to be used by BCM in restore call. + * + * @return the coordinatorServiceStampId value. + */ + public String coordinatorServiceStampId() { + return this.coordinatorServiceStampId; + } + + /** + * Set the coordinatorServiceStampId property: CoordinatorServiceStampId to be used by BCM in restore call. + * + * @param coordinatorServiceStampId the coordinatorServiceStampId value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withCoordinatorServiceStampId(String coordinatorServiceStampId) { + this.coordinatorServiceStampId = coordinatorServiceStampId; + return this; + } + + /** + * Get the coordinatorServiceStampUri property: CoordinatorServiceStampUri to be used by BCM in restore call. + * + * @return the coordinatorServiceStampUri value. + */ + public String coordinatorServiceStampUri() { + return this.coordinatorServiceStampUri; + } + + /** + * Set the coordinatorServiceStampUri property: CoordinatorServiceStampUri to be used by BCM in restore call. + * + * @param coordinatorServiceStampUri the coordinatorServiceStampUri value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withCoordinatorServiceStampUri(String coordinatorServiceStampUri) { + this.coordinatorServiceStampUri = coordinatorServiceStampUri; + return this; + } + + /** + * Get the protectionServiceStampId property: ProtectionServiceStampId to be used by BCM in restore call. + * + * @return the protectionServiceStampId value. + */ + public String protectionServiceStampId() { + return this.protectionServiceStampId; + } + + /** + * Set the protectionServiceStampId property: ProtectionServiceStampId to be used by BCM in restore call. + * + * @param protectionServiceStampId the protectionServiceStampId value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withProtectionServiceStampId(String protectionServiceStampId) { + this.protectionServiceStampId = protectionServiceStampId; + return this; + } + + /** + * Get the protectionServiceStampUri property: ProtectionServiceStampUri to be used by BCM in restore call. + * + * @return the protectionServiceStampUri value. + */ + public String protectionServiceStampUri() { + return this.protectionServiceStampUri; + } + + /** + * Set the protectionServiceStampUri property: ProtectionServiceStampUri to be used by BCM in restore call. + * + * @param protectionServiceStampUri the protectionServiceStampUri value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withProtectionServiceStampUri(String protectionServiceStampUri) { + this.protectionServiceStampUri = protectionServiceStampUri; + return this; + } + + /** + * Get the tokenExtendedInformation property: Extended Information about the token like FileSpec etc. + * + * @return the tokenExtendedInformation value. + */ + public String tokenExtendedInformation() { + return this.tokenExtendedInformation; + } + + /** + * Set the tokenExtendedInformation property: Extended Information about the token like FileSpec etc. + * + * @param tokenExtendedInformation the tokenExtendedInformation value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withTokenExtendedInformation(String tokenExtendedInformation) { + this.tokenExtendedInformation = tokenExtendedInformation; + return this; + } + + /** + * Get the rpTierInformation property: Recovery point Tier Information. + * + * @return the rpTierInformation value. + */ + public Map rpTierInformation() { + return this.rpTierInformation; + } + + /** + * Set the rpTierInformation property: Recovery point Tier Information. + * + * @param rpTierInformation the rpTierInformation value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withRpTierInformation(Map rpTierInformation) { + this.rpTierInformation = rpTierInformation; + return this; + } + + /** + * Get the rpOriginalSAOption property: Recovery point information: Original SA option. + * + * @return the rpOriginalSAOption value. + */ + public Boolean rpOriginalSAOption() { + return this.rpOriginalSAOption; + } + + /** + * Set the rpOriginalSAOption property: Recovery point information: Original SA option. + * + * @param rpOriginalSAOption the rpOriginalSAOption value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withRpOriginalSAOption(Boolean rpOriginalSAOption) { + this.rpOriginalSAOption = rpOriginalSAOption; + return this; + } + + /** + * Get the rpIsManagedVirtualMachine property: Recovery point information: Managed virtual machine. + * + * @return the rpIsManagedVirtualMachine value. + */ + public Boolean rpIsManagedVirtualMachine() { + return this.rpIsManagedVirtualMachine; + } + + /** + * Set the rpIsManagedVirtualMachine property: Recovery point information: Managed virtual machine. + * + * @param rpIsManagedVirtualMachine the rpIsManagedVirtualMachine value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withRpIsManagedVirtualMachine(Boolean rpIsManagedVirtualMachine) { + this.rpIsManagedVirtualMachine = rpIsManagedVirtualMachine; + return this; + } + + /** + * Get the rpVMSizeDescription property: Recovery point information: VM size description. + * + * @return the rpVMSizeDescription value. + */ + public String rpVMSizeDescription() { + return this.rpVMSizeDescription; + } + + /** + * Set the rpVMSizeDescription property: Recovery point information: VM size description. + * + * @param rpVMSizeDescription the rpVMSizeDescription value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withRpVMSizeDescription(String rpVMSizeDescription) { + this.rpVMSizeDescription = rpVMSizeDescription; + return this; + } + + /** + * Get the bMSActiveRegion property: Active region name of BMS Stamp. + * + * @return the bMSActiveRegion value. + */ + public String bMSActiveRegion() { + return this.bMSActiveRegion; + } + + /** + * Set the bMSActiveRegion property: Active region name of BMS Stamp. + * + * @param bMSActiveRegion the bMSActiveRegion value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withBMSActiveRegion(String bMSActiveRegion) { + this.bMSActiveRegion = bMSActiveRegion; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + jsonWriter.writeStringField("accessTokenString", this.accessTokenString); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + jsonWriter.writeStringField("resourceGroupName", this.resourceGroupName); + jsonWriter.writeStringField("resourceName", this.resourceName); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeNumberField("protectionContainerId", this.protectionContainerId); + jsonWriter.writeStringField("recoveryPointId", this.recoveryPointId); + jsonWriter.writeStringField("recoveryPointTime", this.recoveryPointTime); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeStringField("containerType", this.containerType); + jsonWriter.writeStringField("backupManagementType", this.backupManagementType); + jsonWriter.writeStringField("datasourceType", this.datasourceType); + jsonWriter.writeStringField("datasourceName", this.datasourceName); + jsonWriter.writeStringField("datasourceId", this.datasourceId); + jsonWriter.writeStringField("datasourceContainerName", this.datasourceContainerName); + jsonWriter.writeStringField("coordinatorServiceStampId", this.coordinatorServiceStampId); + jsonWriter.writeStringField("coordinatorServiceStampUri", this.coordinatorServiceStampUri); + jsonWriter.writeStringField("protectionServiceStampId", this.protectionServiceStampId); + jsonWriter.writeStringField("protectionServiceStampUri", this.protectionServiceStampUri); + jsonWriter.writeStringField("tokenExtendedInformation", this.tokenExtendedInformation); + jsonWriter.writeMapField("rpTierInformation", this.rpTierInformation, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("rpOriginalSAOption", this.rpOriginalSAOption); + jsonWriter.writeBooleanField("rpIsManagedVirtualMachine", this.rpIsManagedVirtualMachine); + jsonWriter.writeStringField("rpVMSizeDescription", this.rpVMSizeDescription); + jsonWriter.writeStringField("bMSActiveRegion", this.bMSActiveRegion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CrrAccessToken from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CrrAccessToken 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 CrrAccessToken. + */ + public static CrrAccessToken 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 ("WorkloadCrrAccessToken".equals(discriminatorValue)) { + return WorkloadCrrAccessToken.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static CrrAccessToken fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CrrAccessToken deserializedCrrAccessToken = new CrrAccessToken(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedCrrAccessToken.objectType = reader.getString(); + } else if ("accessTokenString".equals(fieldName)) { + deserializedCrrAccessToken.accessTokenString = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedCrrAccessToken.subscriptionId = reader.getString(); + } else if ("resourceGroupName".equals(fieldName)) { + deserializedCrrAccessToken.resourceGroupName = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedCrrAccessToken.resourceName = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedCrrAccessToken.resourceId = reader.getString(); + } else if ("protectionContainerId".equals(fieldName)) { + deserializedCrrAccessToken.protectionContainerId = reader.getNullable(JsonReader::getLong); + } else if ("recoveryPointId".equals(fieldName)) { + deserializedCrrAccessToken.recoveryPointId = reader.getString(); + } else if ("recoveryPointTime".equals(fieldName)) { + deserializedCrrAccessToken.recoveryPointTime = reader.getString(); + } else if ("containerName".equals(fieldName)) { + deserializedCrrAccessToken.containerName = reader.getString(); + } else if ("containerType".equals(fieldName)) { + deserializedCrrAccessToken.containerType = reader.getString(); + } else if ("backupManagementType".equals(fieldName)) { + deserializedCrrAccessToken.backupManagementType = reader.getString(); + } else if ("datasourceType".equals(fieldName)) { + deserializedCrrAccessToken.datasourceType = reader.getString(); + } else if ("datasourceName".equals(fieldName)) { + deserializedCrrAccessToken.datasourceName = reader.getString(); + } else if ("datasourceId".equals(fieldName)) { + deserializedCrrAccessToken.datasourceId = reader.getString(); + } else if ("datasourceContainerName".equals(fieldName)) { + deserializedCrrAccessToken.datasourceContainerName = reader.getString(); + } else if ("coordinatorServiceStampId".equals(fieldName)) { + deserializedCrrAccessToken.coordinatorServiceStampId = reader.getString(); + } else if ("coordinatorServiceStampUri".equals(fieldName)) { + deserializedCrrAccessToken.coordinatorServiceStampUri = reader.getString(); + } else if ("protectionServiceStampId".equals(fieldName)) { + deserializedCrrAccessToken.protectionServiceStampId = reader.getString(); + } else if ("protectionServiceStampUri".equals(fieldName)) { + deserializedCrrAccessToken.protectionServiceStampUri = reader.getString(); + } else if ("tokenExtendedInformation".equals(fieldName)) { + deserializedCrrAccessToken.tokenExtendedInformation = reader.getString(); + } else if ("rpTierInformation".equals(fieldName)) { + Map rpTierInformation = reader.readMap(reader1 -> reader1.getString()); + deserializedCrrAccessToken.rpTierInformation = rpTierInformation; + } else if ("rpOriginalSAOption".equals(fieldName)) { + deserializedCrrAccessToken.rpOriginalSAOption = reader.getNullable(JsonReader::getBoolean); + } else if ("rpIsManagedVirtualMachine".equals(fieldName)) { + deserializedCrrAccessToken.rpIsManagedVirtualMachine = reader.getNullable(JsonReader::getBoolean); + } else if ("rpVMSizeDescription".equals(fieldName)) { + deserializedCrrAccessToken.rpVMSizeDescription = reader.getString(); + } else if ("bMSActiveRegion".equals(fieldName)) { + deserializedCrrAccessToken.bMSActiveRegion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCrrAccessToken; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrAccessTokenResource.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrAccessTokenResource.java new file mode 100644 index 000000000000..b3cc78c973d8 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrAccessTokenResource.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.CrrAccessTokenResourceInner; +import java.util.Map; + +/** + * An immutable client-side representation of CrrAccessTokenResource. + */ +public interface CrrAccessTokenResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: CrrAccessTokenResource properties. + * + * @return the properties value. + */ + CrrAccessToken properties(); + + /** + * Gets the eTag property: Optional ETag. + * + * @return the eTag value. + */ + String eTag(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.CrrAccessTokenResourceInner + * object. + * + * @return the inner object. + */ + CrrAccessTokenResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrJobRequest.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrJobRequest.java new file mode 100644 index 000000000000..89a9278a992a --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrJobRequest.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request object for fetching CRR jobs. + */ +@Fluent +public final class CrrJobRequest implements JsonSerializable { + /* + * Entire ARM resource id of the resource + */ + private String resourceId; + + /* + * Job Name of the job to be fetched + */ + private String jobName; + + /** + * Creates an instance of CrrJobRequest class. + */ + public CrrJobRequest() { + } + + /** + * Get the resourceId property: Entire ARM resource id of the resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Entire ARM resource id of the resource. + * + * @param resourceId the resourceId value to set. + * @return the CrrJobRequest object itself. + */ + public CrrJobRequest withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the jobName property: Job Name of the job to be fetched. + * + * @return the jobName value. + */ + public String jobName() { + return this.jobName; + } + + /** + * Set the jobName property: Job Name of the job to be fetched. + * + * @param jobName the jobName value to set. + * @return the CrrJobRequest object itself. + */ + public CrrJobRequest withJobName(String jobName) { + this.jobName = jobName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("jobName", this.jobName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CrrJobRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CrrJobRequest 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 CrrJobRequest. + */ + public static CrrJobRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CrrJobRequest deserializedCrrJobRequest = new CrrJobRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedCrrJobRequest.resourceId = reader.getString(); + } else if ("jobName".equals(fieldName)) { + deserializedCrrJobRequest.jobName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCrrJobRequest; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrOperationResults.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrOperationResults.java new file mode 100644 index 000000000000..7ed547f3ab90 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrOperationResults.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CrrOperationResults. + */ +public interface CrrOperationResults { + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response getWithResponse(String azureRegion, String operationId, Context context); + + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void get(String azureRegion, String operationId); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrOperationStatus.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrOperationStatus.java new file mode 100644 index 000000000000..da144cdf6fda --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrOperationStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CrrOperationStatus. + */ +public interface CrrOperationStatus { + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status along with {@link Response}. + */ + Response getWithResponse(String azureRegion, String operationId, Context context); + + /** + * The get operation. + * + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + OperationStatus get(String azureRegion, String operationId); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DPMProtectedItem.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DPMProtectedItem.java new file mode 100644 index 000000000000..d27d11e0c321 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DPMProtectedItem.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Additional information on Backup engine specific backup item. + */ +@Immutable +public final class DPMProtectedItem extends ProtectedItem { + /* + * backup item type. + */ + private String protectedItemType = "DPMProtectedItem"; + + /* + * Friendly name of the managed item + */ + private String friendlyName; + + /* + * Backup Management server protecting this backup item + */ + private String backupEngineName; + + /* + * Protection state of the backup engine + */ + private ProtectedItemState protectionState; + + /* + * Extended info of the backup item. + */ + private DPMProtectedItemExtendedInfo extendedInfo; + + /** + * Creates an instance of DPMProtectedItem class. + */ + private DPMProtectedItem() { + } + + /** + * Get the protectedItemType property: backup item type. + * + * @return the protectedItemType value. + */ + @Override + public String protectedItemType() { + return this.protectedItemType; + } + + /** + * Get the friendlyName property: Friendly name of the managed item. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Get the backupEngineName property: Backup Management server protecting this backup item. + * + * @return the backupEngineName value. + */ + public String backupEngineName() { + return this.backupEngineName; + } + + /** + * Get the protectionState property: Protection state of the backup engine. + * + * @return the protectionState value. + */ + public ProtectedItemState protectionState() { + return this.protectionState; + } + + /** + * Get the extendedInfo property: Extended info of the backup item. + * + * @return the extendedInfo value. + */ + public DPMProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupManagementType", + backupManagementType() == null ? null : backupManagementType().toString()); + jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString()); + 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.writeStringField("protectedItemType", this.protectedItemType); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("backupEngineName", this.backupEngineName); + jsonWriter.writeStringField("protectionState", + this.protectionState == null ? null : this.protectionState.toString()); + jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DPMProtectedItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DPMProtectedItem 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 DPMProtectedItem. + */ + public static DPMProtectedItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DPMProtectedItem deserializedDPMProtectedItem = new DPMProtectedItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupManagementType".equals(fieldName)) { + deserializedDPMProtectedItem + .withBackupManagementType(BackupManagementType.fromString(reader.getString())); + } else if ("workloadType".equals(fieldName)) { + deserializedDPMProtectedItem.withWorkloadType(DataSourceType.fromString(reader.getString())); + } else if ("containerName".equals(fieldName)) { + deserializedDPMProtectedItem.withContainerName(reader.getString()); + } else if ("sourceResourceId".equals(fieldName)) { + deserializedDPMProtectedItem.withSourceResourceId(reader.getString()); + } else if ("policyId".equals(fieldName)) { + deserializedDPMProtectedItem.withPolicyId(reader.getString()); + } else if ("lastRecoveryPoint".equals(fieldName)) { + deserializedDPMProtectedItem.withLastRecoveryPoint(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("backupSetName".equals(fieldName)) { + deserializedDPMProtectedItem.withBackupSetName(reader.getString()); + } else if ("createMode".equals(fieldName)) { + deserializedDPMProtectedItem.withCreateMode(CreateMode.fromString(reader.getString())); + } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { + deserializedDPMProtectedItem.withDeferredDeleteTimeInUTC(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("isScheduledForDeferredDelete".equals(fieldName)) { + deserializedDPMProtectedItem + .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); + } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { + deserializedDPMProtectedItem.withDeferredDeleteTimeRemaining(reader.getString()); + } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { + deserializedDPMProtectedItem + .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); + } else if ("isRehydrate".equals(fieldName)) { + deserializedDPMProtectedItem.withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); + } else if ("resourceGuardOperationRequests".equals(fieldName)) { + List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); + deserializedDPMProtectedItem.withResourceGuardOperationRequests(resourceGuardOperationRequests); + } else if ("protectedItemType".equals(fieldName)) { + deserializedDPMProtectedItem.protectedItemType = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedDPMProtectedItem.friendlyName = reader.getString(); + } else if ("backupEngineName".equals(fieldName)) { + deserializedDPMProtectedItem.backupEngineName = reader.getString(); + } else if ("protectionState".equals(fieldName)) { + deserializedDPMProtectedItem.protectionState = ProtectedItemState.fromString(reader.getString()); + } else if ("extendedInfo".equals(fieldName)) { + deserializedDPMProtectedItem.extendedInfo = DPMProtectedItemExtendedInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDPMProtectedItem; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DPMProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DPMProtectedItemExtendedInfo.java new file mode 100644 index 000000000000..06c07b47a77c --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DPMProtectedItemExtendedInfo.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; + +/** + * Additional information of DPM Protected item. + */ +@Immutable +public final class DPMProtectedItemExtendedInfo implements JsonSerializable { + /* + * Attribute to provide information on various DBs. + */ + private Map protectableObjectLoadPath; + + /* + * To check if backup item is disk protected. + */ + private Boolean protectedProperty; + + /* + * To check if backup item is cloud protected. + */ + private Boolean isPresentOnCloud; + + /* + * Last backup status information on backup item. + */ + private String lastBackupStatus; + + /* + * Last refresh time on backup item. + */ + private OffsetDateTime lastRefreshedAt; + + /* + * Oldest cloud recovery point time. + */ + private OffsetDateTime oldestRecoveryPoint; + + /* + * cloud recovery point count. + */ + private Integer recoveryPointCount; + + /* + * Oldest disk recovery point time. + */ + private OffsetDateTime onPremiseOldestRecoveryPoint; + + /* + * latest disk recovery point time. + */ + private OffsetDateTime onPremiseLatestRecoveryPoint; + + /* + * disk recovery point count. + */ + private Integer onPremiseRecoveryPointCount; + + /* + * To check if backup item is collocated. + */ + private Boolean isCollocated; + + /* + * Protection group name of the backup item. + */ + private String protectionGroupName; + + /* + * Used Disk storage in bytes. + */ + private String diskStorageUsedInBytes; + + /* + * total Disk storage in bytes. + */ + private String totalDiskStorageSizeInBytes; + + /** + * Creates an instance of DPMProtectedItemExtendedInfo class. + */ + private DPMProtectedItemExtendedInfo() { + } + + /** + * Get the protectableObjectLoadPath property: Attribute to provide information on various DBs. + * + * @return the protectableObjectLoadPath value. + */ + public Map protectableObjectLoadPath() { + return this.protectableObjectLoadPath; + } + + /** + * Get the protectedProperty property: To check if backup item is disk protected. + * + * @return the protectedProperty value. + */ + public Boolean protectedProperty() { + return this.protectedProperty; + } + + /** + * Get the isPresentOnCloud property: To check if backup item is cloud protected. + * + * @return the isPresentOnCloud value. + */ + public Boolean isPresentOnCloud() { + return this.isPresentOnCloud; + } + + /** + * Get the lastBackupStatus property: Last backup status information on backup item. + * + * @return the lastBackupStatus value. + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Get the lastRefreshedAt property: Last refresh time on backup item. + * + * @return the lastRefreshedAt value. + */ + public OffsetDateTime lastRefreshedAt() { + return this.lastRefreshedAt; + } + + /** + * Get the oldestRecoveryPoint property: Oldest cloud recovery point time. + * + * @return the oldestRecoveryPoint value. + */ + public OffsetDateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Get the recoveryPointCount property: cloud recovery point count. + * + * @return the recoveryPointCount value. + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Get the onPremiseOldestRecoveryPoint property: Oldest disk recovery point time. + * + * @return the onPremiseOldestRecoveryPoint value. + */ + public OffsetDateTime onPremiseOldestRecoveryPoint() { + return this.onPremiseOldestRecoveryPoint; + } + + /** + * Get the onPremiseLatestRecoveryPoint property: latest disk recovery point time. + * + * @return the onPremiseLatestRecoveryPoint value. + */ + public OffsetDateTime onPremiseLatestRecoveryPoint() { + return this.onPremiseLatestRecoveryPoint; + } + + /** + * Get the onPremiseRecoveryPointCount property: disk recovery point count. + * + * @return the onPremiseRecoveryPointCount value. + */ + public Integer onPremiseRecoveryPointCount() { + return this.onPremiseRecoveryPointCount; + } + + /** + * Get the isCollocated property: To check if backup item is collocated. + * + * @return the isCollocated value. + */ + public Boolean isCollocated() { + return this.isCollocated; + } + + /** + * Get the protectionGroupName property: Protection group name of the backup item. + * + * @return the protectionGroupName value. + */ + public String protectionGroupName() { + return this.protectionGroupName; + } + + /** + * Get the diskStorageUsedInBytes property: Used Disk storage in bytes. + * + * @return the diskStorageUsedInBytes value. + */ + public String diskStorageUsedInBytes() { + return this.diskStorageUsedInBytes; + } + + /** + * Get the totalDiskStorageSizeInBytes property: total Disk storage in bytes. + * + * @return the totalDiskStorageSizeInBytes value. + */ + public String totalDiskStorageSizeInBytes() { + return this.totalDiskStorageSizeInBytes; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("protectableObjectLoadPath", this.protectableObjectLoadPath, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("protected", this.protectedProperty); + jsonWriter.writeBooleanField("isPresentOnCloud", this.isPresentOnCloud); + jsonWriter.writeStringField("lastBackupStatus", this.lastBackupStatus); + jsonWriter.writeStringField("lastRefreshedAt", + this.lastRefreshedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastRefreshedAt)); + jsonWriter.writeStringField("oldestRecoveryPoint", + this.oldestRecoveryPoint == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPoint)); + jsonWriter.writeNumberField("recoveryPointCount", this.recoveryPointCount); + jsonWriter.writeStringField("onPremiseOldestRecoveryPoint", + this.onPremiseOldestRecoveryPoint == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.onPremiseOldestRecoveryPoint)); + jsonWriter.writeStringField("onPremiseLatestRecoveryPoint", + this.onPremiseLatestRecoveryPoint == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.onPremiseLatestRecoveryPoint)); + jsonWriter.writeNumberField("onPremiseRecoveryPointCount", this.onPremiseRecoveryPointCount); + jsonWriter.writeBooleanField("isCollocated", this.isCollocated); + jsonWriter.writeStringField("protectionGroupName", this.protectionGroupName); + jsonWriter.writeStringField("diskStorageUsedInBytes", this.diskStorageUsedInBytes); + jsonWriter.writeStringField("totalDiskStorageSizeInBytes", this.totalDiskStorageSizeInBytes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DPMProtectedItemExtendedInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DPMProtectedItemExtendedInfo 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 DPMProtectedItemExtendedInfo. + */ + public static DPMProtectedItemExtendedInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DPMProtectedItemExtendedInfo deserializedDPMProtectedItemExtendedInfo = new DPMProtectedItemExtendedInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protectableObjectLoadPath".equals(fieldName)) { + Map protectableObjectLoadPath = reader.readMap(reader1 -> reader1.getString()); + deserializedDPMProtectedItemExtendedInfo.protectableObjectLoadPath = protectableObjectLoadPath; + } else if ("protected".equals(fieldName)) { + deserializedDPMProtectedItemExtendedInfo.protectedProperty + = reader.getNullable(JsonReader::getBoolean); + } else if ("isPresentOnCloud".equals(fieldName)) { + deserializedDPMProtectedItemExtendedInfo.isPresentOnCloud + = reader.getNullable(JsonReader::getBoolean); + } else if ("lastBackupStatus".equals(fieldName)) { + deserializedDPMProtectedItemExtendedInfo.lastBackupStatus = reader.getString(); + } else if ("lastRefreshedAt".equals(fieldName)) { + deserializedDPMProtectedItemExtendedInfo.lastRefreshedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("oldestRecoveryPoint".equals(fieldName)) { + deserializedDPMProtectedItemExtendedInfo.oldestRecoveryPoint = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("recoveryPointCount".equals(fieldName)) { + deserializedDPMProtectedItemExtendedInfo.recoveryPointCount + = reader.getNullable(JsonReader::getInt); + } else if ("onPremiseOldestRecoveryPoint".equals(fieldName)) { + deserializedDPMProtectedItemExtendedInfo.onPremiseOldestRecoveryPoint = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("onPremiseLatestRecoveryPoint".equals(fieldName)) { + deserializedDPMProtectedItemExtendedInfo.onPremiseLatestRecoveryPoint = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("onPremiseRecoveryPointCount".equals(fieldName)) { + deserializedDPMProtectedItemExtendedInfo.onPremiseRecoveryPointCount + = reader.getNullable(JsonReader::getInt); + } else if ("isCollocated".equals(fieldName)) { + deserializedDPMProtectedItemExtendedInfo.isCollocated = reader.getNullable(JsonReader::getBoolean); + } else if ("protectionGroupName".equals(fieldName)) { + deserializedDPMProtectedItemExtendedInfo.protectionGroupName = reader.getString(); + } else if ("diskStorageUsedInBytes".equals(fieldName)) { + deserializedDPMProtectedItemExtendedInfo.diskStorageUsedInBytes = reader.getString(); + } else if ("totalDiskStorageSizeInBytes".equals(fieldName)) { + deserializedDPMProtectedItemExtendedInfo.totalDiskStorageSizeInBytes = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDPMProtectedItemExtendedInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DataSourceType.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DataSourceType.java new file mode 100644 index 000000000000..1e33b1cc0936 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DataSourceType.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of workload this item represents. + */ +public final class DataSourceType extends ExpandableStringEnum { + /** + * Static value Invalid for DataSourceType. + */ + public static final DataSourceType INVALID = fromString("Invalid"); + + /** + * Static value VM for DataSourceType. + */ + public static final DataSourceType VM = fromString("VM"); + + /** + * Static value FileFolder for DataSourceType. + */ + public static final DataSourceType FILE_FOLDER = fromString("FileFolder"); + + /** + * Static value AzureSqlDb for DataSourceType. + */ + public static final DataSourceType AZURE_SQL_DB = fromString("AzureSqlDb"); + + /** + * Static value SQLDB for DataSourceType. + */ + public static final DataSourceType SQLDB = fromString("SQLDB"); + + /** + * Static value Exchange for DataSourceType. + */ + public static final DataSourceType EXCHANGE = fromString("Exchange"); + + /** + * Static value Sharepoint for DataSourceType. + */ + public static final DataSourceType SHAREPOINT = fromString("Sharepoint"); + + /** + * Static value VMwareVM for DataSourceType. + */ + public static final DataSourceType VMWARE_VM = fromString("VMwareVM"); + + /** + * Static value SystemState for DataSourceType. + */ + public static final DataSourceType SYSTEM_STATE = fromString("SystemState"); + + /** + * Static value Client for DataSourceType. + */ + public static final DataSourceType CLIENT = fromString("Client"); + + /** + * Static value GenericDataSource for DataSourceType. + */ + public static final DataSourceType GENERIC_DATA_SOURCE = fromString("GenericDataSource"); + + /** + * Static value SQLDataBase for DataSourceType. + */ + public static final DataSourceType SQLDATA_BASE = fromString("SQLDataBase"); + + /** + * Static value AzureFileShare for DataSourceType. + */ + public static final DataSourceType AZURE_FILE_SHARE = fromString("AzureFileShare"); + + /** + * Static value SAPHanaDatabase for DataSourceType. + */ + public static final DataSourceType SAPHANA_DATABASE = fromString("SAPHanaDatabase"); + + /** + * Static value SAPAseDatabase for DataSourceType. + */ + public static final DataSourceType SAPASE_DATABASE = fromString("SAPAseDatabase"); + + /** + * Creates a new instance of DataSourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataSourceType() { + } + + /** + * Creates or finds a DataSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataSourceType. + */ + public static DataSourceType fromString(String name) { + return fromString(name, DataSourceType.class); + } + + /** + * Gets known DataSourceType values. + * + * @return known DataSourceType values. + */ + public static Collection values() { + return values(DataSourceType.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DiskExclusionProperties.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DiskExclusionProperties.java new file mode 100644 index 000000000000..5e47e1080056 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DiskExclusionProperties.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The DiskExclusionProperties model. + */ +@Immutable +public final class DiskExclusionProperties implements JsonSerializable { + /* + * List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + */ + private List diskLunList; + + /* + * Flag to indicate whether DiskLunList is to be included/ excluded from backup. + */ + private Boolean isInclusionList; + + /** + * Creates an instance of DiskExclusionProperties class. + */ + private DiskExclusionProperties() { + } + + /** + * Get the diskLunList property: List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + * + * @return the diskLunList value. + */ + public List diskLunList() { + return this.diskLunList; + } + + /** + * Get the isInclusionList property: Flag to indicate whether DiskLunList is to be included/ excluded from backup. + * + * @return the isInclusionList value. + */ + public Boolean isInclusionList() { + return this.isInclusionList; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("diskLunList", this.diskLunList, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeBooleanField("isInclusionList", this.isInclusionList); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiskExclusionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiskExclusionProperties 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 DiskExclusionProperties. + */ + public static DiskExclusionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiskExclusionProperties deserializedDiskExclusionProperties = new DiskExclusionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("diskLunList".equals(fieldName)) { + List diskLunList = reader.readArray(reader1 -> reader1.getInt()); + deserializedDiskExclusionProperties.diskLunList = diskLunList; + } else if ("isInclusionList".equals(fieldName)) { + deserializedDiskExclusionProperties.isInclusionList = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDiskExclusionProperties; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DiskInformation.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DiskInformation.java new file mode 100644 index 000000000000..cd774f0d8569 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DiskInformation.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Disk information. + */ +@Immutable +public final class DiskInformation implements JsonSerializable { + /* + * The lun property. + */ + private Integer lun; + + /* + * The name property. + */ + private String name; + + /** + * Creates an instance of DiskInformation class. + */ + private DiskInformation() { + } + + /** + * Get the lun property: The lun property. + * + * @return the lun value. + */ + public Integer lun() { + return this.lun; + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("lun", this.lun); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiskInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiskInformation 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 DiskInformation. + */ + public static DiskInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiskInformation deserializedDiskInformation = new DiskInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lun".equals(fieldName)) { + deserializedDiskInformation.lun = reader.getNullable(JsonReader::getInt); + } else if ("name".equals(fieldName)) { + deserializedDiskInformation.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDiskInformation; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmErrorInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmErrorInfo.java new file mode 100644 index 000000000000..65c788ee8b40 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmErrorInfo.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * DPM workload-specific error information. + */ +@Immutable +public final class DpmErrorInfo implements JsonSerializable { + /* + * Localized error string. + */ + private String errorString; + + /* + * List of localized recommendations for above error code. + */ + private List recommendations; + + /** + * Creates an instance of DpmErrorInfo class. + */ + private DpmErrorInfo() { + } + + /** + * Get the errorString property: Localized error string. + * + * @return the errorString value. + */ + public String errorString() { + return this.errorString; + } + + /** + * Get the recommendations property: List of localized recommendations for above error code. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("errorString", this.errorString); + jsonWriter.writeArrayField("recommendations", this.recommendations, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DpmErrorInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DpmErrorInfo 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 DpmErrorInfo. + */ + public static DpmErrorInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DpmErrorInfo deserializedDpmErrorInfo = new DpmErrorInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorString".equals(fieldName)) { + deserializedDpmErrorInfo.errorString = reader.getString(); + } else if ("recommendations".equals(fieldName)) { + List recommendations = reader.readArray(reader1 -> reader1.getString()); + deserializedDpmErrorInfo.recommendations = recommendations; + } else { + reader.skipChildren(); + } + } + + return deserializedDpmErrorInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJob.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJob.java new file mode 100644 index 000000000000..75b0a2a32192 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJob.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * DPM workload-specific job object. + */ +@Immutable +public final class DpmJob extends Job { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String jobType = "DpmJob"; + + /* + * Time elapsed for job. + */ + private Duration duration; + + /* + * DPM server name managing the backup item or backup job. + */ + private String dpmServerName; + + /* + * Name of cluster/server protecting current backup item, if any. + */ + private String containerName; + + /* + * Type of container. + */ + private String containerType; + + /* + * Type of backup item. + */ + private String workloadType; + + /* + * The state/actions applicable on this job like cancel/retry. + */ + private List actionsInfo; + + /* + * The errors. + */ + private List errorDetails; + + /* + * Additional information for this job. + */ + private DpmJobExtendedInfo extendedInfo; + + /** + * Creates an instance of DpmJob class. + */ + private DpmJob() { + } + + /** + * Get the jobType property: This property will be used as the discriminator for deciding the specific types in the + * polymorphic chain of types. + * + * @return the jobType value. + */ + @Override + public String jobType() { + return this.jobType; + } + + /** + * Get the duration property: Time elapsed for job. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Get the dpmServerName property: DPM server name managing the backup item or backup job. + * + * @return the dpmServerName value. + */ + public String dpmServerName() { + return this.dpmServerName; + } + + /** + * Get the containerName property: Name of cluster/server protecting current backup item, if any. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Get the containerType property: Type of container. + * + * @return the containerType value. + */ + public String containerType() { + return this.containerType; + } + + /** + * Get the workloadType property: Type of backup item. + * + * @return the workloadType value. + */ + public String workloadType() { + return this.workloadType; + } + + /** + * Get the actionsInfo property: The state/actions applicable on this job like cancel/retry. + * + * @return the actionsInfo value. + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Get the errorDetails property: The errors. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Get the extendedInfo property: Additional information for this job. + * + * @return the extendedInfo value. + */ + public DpmJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * {@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.writeStringField("dpmServerName", this.dpmServerName); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeStringField("containerType", this.containerType); + jsonWriter.writeStringField("workloadType", this.workloadType); + 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 DpmJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DpmJob 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 DpmJob. + */ + public static DpmJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DpmJob deserializedDpmJob = new DpmJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("entityFriendlyName".equals(fieldName)) { + deserializedDpmJob.withEntityFriendlyName(reader.getString()); + } else if ("backupManagementType".equals(fieldName)) { + deserializedDpmJob.withBackupManagementType(BackupManagementType.fromString(reader.getString())); + } else if ("operation".equals(fieldName)) { + deserializedDpmJob.withOperation(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedDpmJob.withStatus(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedDpmJob.withStartTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("endTime".equals(fieldName)) { + deserializedDpmJob.withEndTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("activityId".equals(fieldName)) { + deserializedDpmJob.withActivityId(reader.getString()); + } else if ("jobType".equals(fieldName)) { + deserializedDpmJob.jobType = reader.getString(); + } else if ("duration".equals(fieldName)) { + deserializedDpmJob.duration + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("dpmServerName".equals(fieldName)) { + deserializedDpmJob.dpmServerName = reader.getString(); + } else if ("containerName".equals(fieldName)) { + deserializedDpmJob.containerName = reader.getString(); + } else if ("containerType".equals(fieldName)) { + deserializedDpmJob.containerType = reader.getString(); + } else if ("workloadType".equals(fieldName)) { + deserializedDpmJob.workloadType = reader.getString(); + } else if ("actionsInfo".equals(fieldName)) { + List actionsInfo + = reader.readArray(reader1 -> JobSupportedAction.fromString(reader1.getString())); + deserializedDpmJob.actionsInfo = actionsInfo; + } else if ("errorDetails".equals(fieldName)) { + List errorDetails = reader.readArray(reader1 -> DpmErrorInfo.fromJson(reader1)); + deserializedDpmJob.errorDetails = errorDetails; + } else if ("extendedInfo".equals(fieldName)) { + deserializedDpmJob.extendedInfo = DpmJobExtendedInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDpmJob; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJobExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJobExtendedInfo.java new file mode 100644 index 000000000000..d4829e66c019 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJobExtendedInfo.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Additional information on the DPM workload-specific job. + */ +@Immutable +public final class DpmJobExtendedInfo implements JsonSerializable { + /* + * List of tasks associated with this job. + */ + private List tasksList; + + /* + * The job properties. + */ + private Map propertyBag; + + /* + * Non localized error message on job execution. + */ + private String dynamicErrorMessage; + + /** + * Creates an instance of DpmJobExtendedInfo class. + */ + private DpmJobExtendedInfo() { + } + + /** + * Get the tasksList property: List of tasks associated with this job. + * + * @return the tasksList value. + */ + public List tasksList() { + return this.tasksList; + } + + /** + * Get the propertyBag property: The job properties. + * + * @return the propertyBag value. + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Get the dynamicErrorMessage property: Non localized error message on job execution. + * + * @return the dynamicErrorMessage value. + */ + public String dynamicErrorMessage() { + return this.dynamicErrorMessage; + } + + /** + * {@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 DpmJobExtendedInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DpmJobExtendedInfo 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 DpmJobExtendedInfo. + */ + public static DpmJobExtendedInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DpmJobExtendedInfo deserializedDpmJobExtendedInfo = new DpmJobExtendedInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tasksList".equals(fieldName)) { + List tasksList + = reader.readArray(reader1 -> DpmJobTaskDetails.fromJson(reader1)); + deserializedDpmJobExtendedInfo.tasksList = tasksList; + } else if ("propertyBag".equals(fieldName)) { + Map propertyBag = reader.readMap(reader1 -> reader1.getString()); + deserializedDpmJobExtendedInfo.propertyBag = propertyBag; + } else if ("dynamicErrorMessage".equals(fieldName)) { + deserializedDpmJobExtendedInfo.dynamicErrorMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDpmJobExtendedInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJobTaskDetails.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJobTaskDetails.java new file mode 100644 index 000000000000..890f1652a653 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJobTaskDetails.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * DPM workload-specific job task details. + */ +@Immutable +public final class DpmJobTaskDetails implements JsonSerializable { + /* + * The task display name. + */ + private String taskId; + + /* + * The start time. + */ + private OffsetDateTime startTime; + + /* + * The end time. + */ + private OffsetDateTime endTime; + + /* + * Time elapsed for task. + */ + private Duration duration; + + /* + * The status. + */ + private String status; + + /** + * Creates an instance of DpmJobTaskDetails class. + */ + private DpmJobTaskDetails() { + } + + /** + * Get the taskId property: The task display name. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Get the startTime property: The start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the duration property: Time elapsed for task. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Get the status property: The status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * {@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("duration", CoreUtils.durationToStringWithDays(this.duration)); + jsonWriter.writeStringField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DpmJobTaskDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DpmJobTaskDetails 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 DpmJobTaskDetails. + */ + public static DpmJobTaskDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DpmJobTaskDetails deserializedDpmJobTaskDetails = new DpmJobTaskDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("taskId".equals(fieldName)) { + deserializedDpmJobTaskDetails.taskId = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedDpmJobTaskDetails.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedDpmJobTaskDetails.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("duration".equals(fieldName)) { + deserializedDpmJobTaskDetails.duration + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedDpmJobTaskDetails.status = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDpmJobTaskDetails; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/EncryptionDetails.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/EncryptionDetails.java new file mode 100644 index 000000000000..4250ba652208 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/EncryptionDetails.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details needed if the VM was encrypted at the time of backup. + */ +@Fluent +public final class EncryptionDetails implements JsonSerializable { + /* + * Identifies whether this backup copy represents an encrypted VM at the time of backup. + */ + private Boolean encryptionEnabled; + + /* + * Key Url. + */ + private String kekUrl; + + /* + * Secret Url. + */ + private String secretKeyUrl; + + /* + * ID of Key Vault where KEK is stored. + */ + private String kekVaultId; + + /* + * ID of Key Vault where Secret is stored. + */ + private String secretKeyVaultId; + + /** + * Creates an instance of EncryptionDetails class. + */ + public EncryptionDetails() { + } + + /** + * Get the encryptionEnabled property: Identifies whether this backup copy represents an encrypted VM at the time of + * backup. + * + * @return the encryptionEnabled value. + */ + public Boolean encryptionEnabled() { + return this.encryptionEnabled; + } + + /** + * Set the encryptionEnabled property: Identifies whether this backup copy represents an encrypted VM at the time of + * backup. + * + * @param encryptionEnabled the encryptionEnabled value to set. + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withEncryptionEnabled(Boolean encryptionEnabled) { + this.encryptionEnabled = encryptionEnabled; + return this; + } + + /** + * Get the kekUrl property: Key Url. + * + * @return the kekUrl value. + */ + public String kekUrl() { + return this.kekUrl; + } + + /** + * Set the kekUrl property: Key Url. + * + * @param kekUrl the kekUrl value to set. + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withKekUrl(String kekUrl) { + this.kekUrl = kekUrl; + return this; + } + + /** + * Get the secretKeyUrl property: Secret Url. + * + * @return the secretKeyUrl value. + */ + public String secretKeyUrl() { + return this.secretKeyUrl; + } + + /** + * Set the secretKeyUrl property: Secret Url. + * + * @param secretKeyUrl the secretKeyUrl value to set. + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withSecretKeyUrl(String secretKeyUrl) { + this.secretKeyUrl = secretKeyUrl; + return this; + } + + /** + * Get the kekVaultId property: ID of Key Vault where KEK is stored. + * + * @return the kekVaultId value. + */ + public String kekVaultId() { + return this.kekVaultId; + } + + /** + * Set the kekVaultId property: ID of Key Vault where KEK is stored. + * + * @param kekVaultId the kekVaultId value to set. + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withKekVaultId(String kekVaultId) { + this.kekVaultId = kekVaultId; + return this; + } + + /** + * Get the secretKeyVaultId property: ID of Key Vault where Secret is stored. + * + * @return the secretKeyVaultId value. + */ + public String secretKeyVaultId() { + return this.secretKeyVaultId; + } + + /** + * Set the secretKeyVaultId property: ID of Key Vault where Secret is stored. + * + * @param secretKeyVaultId the secretKeyVaultId value to set. + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withSecretKeyVaultId(String secretKeyVaultId) { + this.secretKeyVaultId = secretKeyVaultId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("encryptionEnabled", this.encryptionEnabled); + jsonWriter.writeStringField("kekUrl", this.kekUrl); + jsonWriter.writeStringField("secretKeyUrl", this.secretKeyUrl); + jsonWriter.writeStringField("kekVaultId", this.kekVaultId); + jsonWriter.writeStringField("secretKeyVaultId", this.secretKeyVaultId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionDetails 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 EncryptionDetails. + */ + public static EncryptionDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionDetails deserializedEncryptionDetails = new EncryptionDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("encryptionEnabled".equals(fieldName)) { + deserializedEncryptionDetails.encryptionEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("kekUrl".equals(fieldName)) { + deserializedEncryptionDetails.kekUrl = reader.getString(); + } else if ("secretKeyUrl".equals(fieldName)) { + deserializedEncryptionDetails.secretKeyUrl = reader.getString(); + } else if ("kekVaultId".equals(fieldName)) { + deserializedEncryptionDetails.kekVaultId = reader.getString(); + } else if ("secretKeyVaultId".equals(fieldName)) { + deserializedEncryptionDetails.secretKeyVaultId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionDetails; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ErrorDetail.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ErrorDetail.java new file mode 100644 index 000000000000..b6aef9483581 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ErrorDetail.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Error Detail class which encapsulates Code, Message and Recommendations. + */ +@Immutable +public final class ErrorDetail implements JsonSerializable { + /* + * Error code. + */ + private String code; + + /* + * Error Message related to the Code. + */ + private String message; + + /* + * List of recommendation strings. + */ + private List recommendations; + + /** + * Creates an instance of ErrorDetail class. + */ + private ErrorDetail() { + } + + /** + * Get the code property: Error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: Error Message related to the Code. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the recommendations property: List of recommendation strings. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorDetail from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorDetail 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 ErrorDetail. + */ + public static ErrorDetail fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorDetail deserializedErrorDetail = new ErrorDetail(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedErrorDetail.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedErrorDetail.message = reader.getString(); + } else if ("recommendations".equals(fieldName)) { + List recommendations = reader.readArray(reader1 -> reader1.getString()); + deserializedErrorDetail.recommendations = recommendations; + } else { + reader.skipChildren(); + } + } + + return deserializedErrorDetail; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ExtendedProperties.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ExtendedProperties.java new file mode 100644 index 000000000000..92ba7c574079 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ExtendedProperties.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Extended Properties for Azure IaasVM Backup. + */ +@Immutable +public final class ExtendedProperties implements JsonSerializable { + /* + * Extended Properties for Disk Exclusion. + */ + private DiskExclusionProperties diskExclusionProperties; + + /** + * Creates an instance of ExtendedProperties class. + */ + private ExtendedProperties() { + } + + /** + * Get the diskExclusionProperties property: Extended Properties for Disk Exclusion. + * + * @return the diskExclusionProperties value. + */ + public DiskExclusionProperties diskExclusionProperties() { + return this.diskExclusionProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("diskExclusionProperties", this.diskExclusionProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtendedProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtendedProperties 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 ExtendedProperties. + */ + public static ExtendedProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtendedProperties deserializedExtendedProperties = new ExtendedProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("diskExclusionProperties".equals(fieldName)) { + deserializedExtendedProperties.diskExclusionProperties = DiskExclusionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExtendedProperties; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/GenericProtectedItem.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/GenericProtectedItem.java new file mode 100644 index 000000000000..59aa3ebae6b2 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/GenericProtectedItem.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * Base class for backup items. + */ +@Immutable +public final class GenericProtectedItem extends ProtectedItem { + /* + * backup item type. + */ + private String protectedItemType = "GenericProtectedItem"; + + /* + * Friendly name of the container. + */ + private String friendlyName; + + /* + * Indicates consistency of policy object and policy applied to this backup item. + */ + private String policyState; + + /* + * Backup state of this backup item. + */ + private ProtectionState protectionState; + + /* + * Data Plane Service ID of the protected item. + */ + private Long protectedItemId; + + /* + * Loosely coupled (type, value) associations (example - parent of a protected item) + */ + private Map sourceAssociations; + + /* + * Name of this backup item's fabric. + */ + private String fabricName; + + /** + * Creates an instance of GenericProtectedItem class. + */ + private GenericProtectedItem() { + } + + /** + * Get the protectedItemType property: backup item type. + * + * @return the protectedItemType value. + */ + @Override + public String protectedItemType() { + return this.protectedItemType; + } + + /** + * Get the friendlyName property: Friendly name of the container. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Get the policyState property: Indicates consistency of policy object and policy applied to this backup item. + * + * @return the policyState value. + */ + public String policyState() { + return this.policyState; + } + + /** + * Get the protectionState property: Backup state of this backup item. + * + * @return the protectionState value. + */ + public ProtectionState protectionState() { + return this.protectionState; + } + + /** + * Get the protectedItemId property: Data Plane Service ID of the protected item. + * + * @return the protectedItemId value. + */ + public Long protectedItemId() { + return this.protectedItemId; + } + + /** + * Get the sourceAssociations property: Loosely coupled (type, value) associations (example - parent of a protected + * item). + * + * @return the sourceAssociations value. + */ + public Map sourceAssociations() { + return this.sourceAssociations; + } + + /** + * Get the fabricName property: Name of this backup item's fabric. + * + * @return the fabricName value. + */ + public String fabricName() { + return this.fabricName; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupManagementType", + backupManagementType() == null ? null : backupManagementType().toString()); + jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString()); + 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.writeStringField("protectedItemType", this.protectedItemType); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("policyState", this.policyState); + jsonWriter.writeStringField("protectionState", + this.protectionState == null ? null : this.protectionState.toString()); + jsonWriter.writeNumberField("protectedItemId", this.protectedItemId); + jsonWriter.writeMapField("sourceAssociations", this.sourceAssociations, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("fabricName", this.fabricName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenericProtectedItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenericProtectedItem 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 GenericProtectedItem. + */ + public static GenericProtectedItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GenericProtectedItem deserializedGenericProtectedItem = new GenericProtectedItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupManagementType".equals(fieldName)) { + deserializedGenericProtectedItem + .withBackupManagementType(BackupManagementType.fromString(reader.getString())); + } else if ("workloadType".equals(fieldName)) { + deserializedGenericProtectedItem.withWorkloadType(DataSourceType.fromString(reader.getString())); + } else if ("containerName".equals(fieldName)) { + deserializedGenericProtectedItem.withContainerName(reader.getString()); + } else if ("sourceResourceId".equals(fieldName)) { + deserializedGenericProtectedItem.withSourceResourceId(reader.getString()); + } else if ("policyId".equals(fieldName)) { + deserializedGenericProtectedItem.withPolicyId(reader.getString()); + } else if ("lastRecoveryPoint".equals(fieldName)) { + deserializedGenericProtectedItem.withLastRecoveryPoint(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("backupSetName".equals(fieldName)) { + deserializedGenericProtectedItem.withBackupSetName(reader.getString()); + } else if ("createMode".equals(fieldName)) { + deserializedGenericProtectedItem.withCreateMode(CreateMode.fromString(reader.getString())); + } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { + deserializedGenericProtectedItem.withDeferredDeleteTimeInUTC(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("isScheduledForDeferredDelete".equals(fieldName)) { + deserializedGenericProtectedItem + .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); + } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { + deserializedGenericProtectedItem.withDeferredDeleteTimeRemaining(reader.getString()); + } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { + deserializedGenericProtectedItem + .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); + } else if ("isRehydrate".equals(fieldName)) { + deserializedGenericProtectedItem.withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); + } else if ("resourceGuardOperationRequests".equals(fieldName)) { + List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); + deserializedGenericProtectedItem.withResourceGuardOperationRequests(resourceGuardOperationRequests); + } else if ("protectedItemType".equals(fieldName)) { + deserializedGenericProtectedItem.protectedItemType = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedGenericProtectedItem.friendlyName = reader.getString(); + } else if ("policyState".equals(fieldName)) { + deserializedGenericProtectedItem.policyState = reader.getString(); + } else if ("protectionState".equals(fieldName)) { + deserializedGenericProtectedItem.protectionState = ProtectionState.fromString(reader.getString()); + } else if ("protectedItemId".equals(fieldName)) { + deserializedGenericProtectedItem.protectedItemId = reader.getNullable(JsonReader::getLong); + } else if ("sourceAssociations".equals(fieldName)) { + Map sourceAssociations = reader.readMap(reader1 -> reader1.getString()); + deserializedGenericProtectedItem.sourceAssociations = sourceAssociations; + } else if ("fabricName".equals(fieldName)) { + deserializedGenericProtectedItem.fabricName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGenericProtectedItem; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/GenericRecoveryPoint.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/GenericRecoveryPoint.java new file mode 100644 index 000000000000..eb0fe4ef12e5 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/GenericRecoveryPoint.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Generic backup copy. + */ +@Immutable +public final class GenericRecoveryPoint extends RecoveryPoint { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "GenericRecoveryPoint"; + + /* + * Friendly name of the backup copy. + */ + private String friendlyName; + + /* + * Type of the backup copy. + */ + private String recoveryPointType; + + /* + * Time at which this backup copy was created. + */ + private OffsetDateTime recoveryPointTime; + + /* + * Additional information associated with this backup copy. + */ + private String recoveryPointAdditionalInfo; + + /* + * Properties of Recovery Point + */ + private RecoveryPointProperties recoveryPointProperties; + + /** + * Creates an instance of GenericRecoveryPoint class. + */ + private GenericRecoveryPoint() { + } + + /** + * 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 friendlyName property: Friendly name of the backup copy. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Get the recoveryPointType property: Type of the backup copy. + * + * @return the recoveryPointType value. + */ + public String recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Get the recoveryPointTime property: Time at which this backup copy was created. + * + * @return the recoveryPointTime value. + */ + public OffsetDateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Get the recoveryPointAdditionalInfo property: Additional information associated with this backup copy. + * + * @return the recoveryPointAdditionalInfo value. + */ + public String recoveryPointAdditionalInfo() { + return this.recoveryPointAdditionalInfo; + } + + /** + * Get the recoveryPointProperties property: Properties of Recovery Point. + * + * @return the recoveryPointProperties value. + */ + public RecoveryPointProperties recoveryPointProperties() { + return this.recoveryPointProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("recoveryPointType", this.recoveryPointType); + jsonWriter.writeStringField("recoveryPointTime", + this.recoveryPointTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.recoveryPointTime)); + jsonWriter.writeStringField("recoveryPointAdditionalInfo", this.recoveryPointAdditionalInfo); + jsonWriter.writeJsonField("recoveryPointProperties", this.recoveryPointProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenericRecoveryPoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenericRecoveryPoint 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 GenericRecoveryPoint. + */ + public static GenericRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GenericRecoveryPoint deserializedGenericRecoveryPoint = new GenericRecoveryPoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedGenericRecoveryPoint.objectType = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedGenericRecoveryPoint.friendlyName = reader.getString(); + } else if ("recoveryPointType".equals(fieldName)) { + deserializedGenericRecoveryPoint.recoveryPointType = reader.getString(); + } else if ("recoveryPointTime".equals(fieldName)) { + deserializedGenericRecoveryPoint.recoveryPointTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("recoveryPointAdditionalInfo".equals(fieldName)) { + deserializedGenericRecoveryPoint.recoveryPointAdditionalInfo = reader.getString(); + } else if ("recoveryPointProperties".equals(fieldName)) { + deserializedGenericRecoveryPoint.recoveryPointProperties = RecoveryPointProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGenericRecoveryPoint; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/HealthStatus.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/HealthStatus.java new file mode 100644 index 000000000000..6ab42b710d46 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/HealthStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * backups running status for this backup item. + */ +public final class HealthStatus extends ExpandableStringEnum { + /** + * Static value Passed for HealthStatus. + */ + public static final HealthStatus PASSED = fromString("Passed"); + + /** + * Static value ActionRequired for HealthStatus. + */ + public static final HealthStatus ACTION_REQUIRED = fromString("ActionRequired"); + + /** + * Static value ActionSuggested for HealthStatus. + */ + public static final HealthStatus ACTION_SUGGESTED = fromString("ActionSuggested"); + + /** + * Static value Invalid for HealthStatus. + */ + public static final HealthStatus INVALID = fromString("Invalid"); + + /** + * Creates a new instance of HealthStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HealthStatus() { + } + + /** + * Creates or finds a HealthStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding HealthStatus. + */ + public static HealthStatus fromString(String name) { + return fromString(name, HealthStatus.class); + } + + /** + * Gets known HealthStatus values. + * + * @return known HealthStatus values. + */ + public static Collection values() { + return values(HealthStatus.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IaasVMRecoveryPoint.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IaasVMRecoveryPoint.java new file mode 100644 index 000000000000..8d12ba9da148 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IaasVMRecoveryPoint.java @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * IaaS VM workload specific backup copy. + */ +@Immutable +public final class IaasVMRecoveryPoint extends RecoveryPoint { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "IaasVMRecoveryPoint"; + + /* + * Type of the backup copy. + */ + private String recoveryPointType; + + /* + * Time at which this backup copy was created. + */ + private OffsetDateTime recoveryPointTime; + + /* + * Additional information associated with this backup copy. + */ + private String recoveryPointAdditionalInfo; + + /* + * Storage type of the VM whose backup copy is created. + */ + private String sourceVMStorageType; + + /* + * Identifies whether the VM was encrypted when the backup copy is created. + */ + private Boolean isSourceVMEncrypted; + + /* + * Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. + */ + private KeyAndSecretDetails keyAndSecret; + + /* + * Is the session to recover items from this backup copy still active. + */ + private Boolean isInstantIlrSessionActive; + + /* + * Recovery point tier information. + */ + private List recoveryPointTierDetails; + + /* + * Whether VM is with Managed Disks + */ + private Boolean isManagedVirtualMachine; + + /* + * Virtual Machine Size + */ + private String virtualMachineSize; + + /* + * Original Storage Account Option + */ + private Boolean originalStorageAccountOption; + + /* + * OS type + */ + private String osType; + + /* + * Disk configuration + */ + private RecoveryPointDiskConfiguration recoveryPointDiskConfiguration; + + /* + * Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms + */ + private List zones; + + /* + * Eligibility of RP to be moved to another tier + */ + private Map recoveryPointMoveReadinessInfo; + + /* + * Properties of Recovery Point + */ + private RecoveryPointProperties recoveryPointProperties; + + /** + * Creates an instance of IaasVMRecoveryPoint class. + */ + private IaasVMRecoveryPoint() { + } + + /** + * 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 recoveryPointType property: Type of the backup copy. + * + * @return the recoveryPointType value. + */ + public String recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Get the recoveryPointTime property: Time at which this backup copy was created. + * + * @return the recoveryPointTime value. + */ + public OffsetDateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Get the recoveryPointAdditionalInfo property: Additional information associated with this backup copy. + * + * @return the recoveryPointAdditionalInfo value. + */ + public String recoveryPointAdditionalInfo() { + return this.recoveryPointAdditionalInfo; + } + + /** + * Get the sourceVMStorageType property: Storage type of the VM whose backup copy is created. + * + * @return the sourceVMStorageType value. + */ + public String sourceVMStorageType() { + return this.sourceVMStorageType; + } + + /** + * Get the isSourceVMEncrypted property: Identifies whether the VM was encrypted when the backup copy is created. + * + * @return the isSourceVMEncrypted value. + */ + public Boolean isSourceVMEncrypted() { + return this.isSourceVMEncrypted; + } + + /** + * Get the keyAndSecret property: Required details for recovering an encrypted VM. Applicable only when + * IsSourceVMEncrypted is true. + * + * @return the keyAndSecret value. + */ + public KeyAndSecretDetails keyAndSecret() { + return this.keyAndSecret; + } + + /** + * Get the isInstantIlrSessionActive property: Is the session to recover items from this backup copy still active. + * + * @return the isInstantIlrSessionActive value. + */ + public Boolean isInstantIlrSessionActive() { + return this.isInstantIlrSessionActive; + } + + /** + * Get the recoveryPointTierDetails property: Recovery point tier information. + * + * @return the recoveryPointTierDetails value. + */ + public List recoveryPointTierDetails() { + return this.recoveryPointTierDetails; + } + + /** + * Get the isManagedVirtualMachine property: Whether VM is with Managed Disks. + * + * @return the isManagedVirtualMachine value. + */ + public Boolean isManagedVirtualMachine() { + return this.isManagedVirtualMachine; + } + + /** + * Get the virtualMachineSize property: Virtual Machine Size. + * + * @return the virtualMachineSize value. + */ + public String virtualMachineSize() { + return this.virtualMachineSize; + } + + /** + * Get the originalStorageAccountOption property: Original Storage Account Option. + * + * @return the originalStorageAccountOption value. + */ + public Boolean originalStorageAccountOption() { + return this.originalStorageAccountOption; + } + + /** + * Get the osType property: OS type. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Get the recoveryPointDiskConfiguration property: Disk configuration. + * + * @return the recoveryPointDiskConfiguration value. + */ + public RecoveryPointDiskConfiguration recoveryPointDiskConfiguration() { + return this.recoveryPointDiskConfiguration; + } + + /** + * Get the zones property: Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Get the recoveryPointMoveReadinessInfo property: Eligibility of RP to be moved to another tier. + * + * @return the recoveryPointMoveReadinessInfo value. + */ + public Map recoveryPointMoveReadinessInfo() { + return this.recoveryPointMoveReadinessInfo; + } + + /** + * Get the recoveryPointProperties property: Properties of Recovery Point. + * + * @return the recoveryPointProperties value. + */ + public RecoveryPointProperties recoveryPointProperties() { + return this.recoveryPointProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + jsonWriter.writeJsonField("keyAndSecret", this.keyAndSecret); + jsonWriter.writeBooleanField("isInstantIlrSessionActive", this.isInstantIlrSessionActive); + jsonWriter.writeArrayField("recoveryPointTierDetails", this.recoveryPointTierDetails, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("isManagedVirtualMachine", this.isManagedVirtualMachine); + jsonWriter.writeStringField("virtualMachineSize", this.virtualMachineSize); + jsonWriter.writeBooleanField("originalStorageAccountOption", this.originalStorageAccountOption); + jsonWriter.writeStringField("osType", this.osType); + jsonWriter.writeJsonField("recoveryPointDiskConfiguration", this.recoveryPointDiskConfiguration); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", this.recoveryPointMoveReadinessInfo, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("recoveryPointProperties", this.recoveryPointProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IaasVMRecoveryPoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IaasVMRecoveryPoint 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 IaasVMRecoveryPoint. + */ + public static IaasVMRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IaasVMRecoveryPoint deserializedIaasVMRecoveryPoint = new IaasVMRecoveryPoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedIaasVMRecoveryPoint.objectType = reader.getString(); + } else if ("recoveryPointType".equals(fieldName)) { + deserializedIaasVMRecoveryPoint.recoveryPointType = reader.getString(); + } else if ("recoveryPointTime".equals(fieldName)) { + deserializedIaasVMRecoveryPoint.recoveryPointTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("recoveryPointAdditionalInfo".equals(fieldName)) { + deserializedIaasVMRecoveryPoint.recoveryPointAdditionalInfo = reader.getString(); + } else if ("sourceVMStorageType".equals(fieldName)) { + deserializedIaasVMRecoveryPoint.sourceVMStorageType = reader.getString(); + } else if ("isSourceVMEncrypted".equals(fieldName)) { + deserializedIaasVMRecoveryPoint.isSourceVMEncrypted = reader.getNullable(JsonReader::getBoolean); + } else if ("keyAndSecret".equals(fieldName)) { + deserializedIaasVMRecoveryPoint.keyAndSecret = KeyAndSecretDetails.fromJson(reader); + } else if ("isInstantIlrSessionActive".equals(fieldName)) { + deserializedIaasVMRecoveryPoint.isInstantIlrSessionActive + = reader.getNullable(JsonReader::getBoolean); + } else if ("recoveryPointTierDetails".equals(fieldName)) { + List recoveryPointTierDetails + = reader.readArray(reader1 -> RecoveryPointTierInformation.fromJson(reader1)); + deserializedIaasVMRecoveryPoint.recoveryPointTierDetails = recoveryPointTierDetails; + } else if ("isManagedVirtualMachine".equals(fieldName)) { + deserializedIaasVMRecoveryPoint.isManagedVirtualMachine + = reader.getNullable(JsonReader::getBoolean); + } else if ("virtualMachineSize".equals(fieldName)) { + deserializedIaasVMRecoveryPoint.virtualMachineSize = reader.getString(); + } else if ("originalStorageAccountOption".equals(fieldName)) { + deserializedIaasVMRecoveryPoint.originalStorageAccountOption + = reader.getNullable(JsonReader::getBoolean); + } else if ("osType".equals(fieldName)) { + deserializedIaasVMRecoveryPoint.osType = reader.getString(); + } else if ("recoveryPointDiskConfiguration".equals(fieldName)) { + deserializedIaasVMRecoveryPoint.recoveryPointDiskConfiguration + = RecoveryPointDiskConfiguration.fromJson(reader); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedIaasVMRecoveryPoint.zones = zones; + } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) { + Map recoveryPointMoveReadinessInfo + = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1)); + deserializedIaasVMRecoveryPoint.recoveryPointMoveReadinessInfo = recoveryPointMoveReadinessInfo; + } else if ("recoveryPointProperties".equals(fieldName)) { + deserializedIaasVMRecoveryPoint.recoveryPointProperties = RecoveryPointProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIaasVMRecoveryPoint; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IaasVMRestoreRequest.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IaasVMRestoreRequest.java new file mode 100644 index 000000000000..99fefbe0c383 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IaasVMRestoreRequest.java @@ -0,0 +1,688 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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; + +/** + * IaaS VM workload-specific restore. + */ +@Fluent +public final class IaasVMRestoreRequest extends RestoreRequest { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "IaasVMRestoreRequest"; + + /* + * ID of the backup copy to be recovered. + */ + private String recoveryPointId; + + /* + * Type of this recovery. + */ + private RecoveryType recoveryType; + + /* + * Fully qualified ARM ID of the VM which is being recovered. + */ + private String sourceResourceId; + + /* + * This is the complete ARM Id of the VM that will be created. + * For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + */ + private String targetVirtualMachineId; + + /* + * This is the ARM Id of the resource group that you want to create for this Virtual machine and other artifacts. + * For e.g. /subscriptions/{subId}/resourcegroups/{rg} + */ + private String targetResourceGroupId; + + /* + * Fully qualified ARM ID of the storage account to which the VM has to be restored. + */ + private String storageAccountId; + + /* + * This is the virtual network Id of the vnet that will be attached to the virtual machine. + * User will be validated for join action permissions in the linked access. + */ + private String virtualNetworkId; + + /* + * Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it would be + * {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to + * represent + * the subnet. + */ + private String subnetId; + + /* + * Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic + * Virtual Machines. + */ + private String targetDomainNameId; + + /* + * Region in which the virtual machine is restored. + */ + private String region; + + /* + * Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. + */ + private String affinityGroup; + + /* + * Should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same + * cloud service as it was at the time of backup. + */ + private Boolean createNewCloudService; + + /* + * Original Storage Account Option + */ + private Boolean originalStorageAccountOption; + + /* + * Details needed if the VM was encrypted at the time of backup. + */ + private EncryptionDetails encryptionDetails; + + /* + * List of Disk LUNs for partial restore + */ + private List restoreDiskLunList; + + /* + * Flag to denote of an Unmanaged disk VM should be restored with Managed disks. + */ + private Boolean restoreWithManagedDisks; + + /* + * DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest during restore with customer managed key. + */ + private String diskEncryptionSetId; + + /* + * Target zone where the VM and its disks should be restored. + */ + private List zones; + + /* + * Managed Identity information required to access customer storage account. + */ + private IdentityInfo identityInfo; + + /* + * IaaS VM workload specific restore details for restores using managed identity. + */ + private IdentityBasedRestoreDetails identityBasedRestoreDetails; + + /** + * Creates an instance of IaasVMRestoreRequest class. + */ + public IaasVMRestoreRequest() { + } + + /** + * 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 recoveryPointId property: ID of the backup copy to be recovered. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: ID of the backup copy to be recovered. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get the recoveryType property: Type of this recovery. + * + * @return the recoveryType value. + */ + public RecoveryType recoveryType() { + return this.recoveryType; + } + + /** + * Set the recoveryType property: Type of this recovery. + * + * @param recoveryType the recoveryType value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRecoveryType(RecoveryType recoveryType) { + this.recoveryType = recoveryType; + return this; + } + + /** + * Get the sourceResourceId property: Fully qualified ARM ID of the VM which is being recovered. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: Fully qualified ARM ID of the VM which is being recovered. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the targetVirtualMachineId property: This is the complete ARM Id of the VM that will be created. + * For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + * + * @return the targetVirtualMachineId value. + */ + public String targetVirtualMachineId() { + return this.targetVirtualMachineId; + } + + /** + * Set the targetVirtualMachineId property: This is the complete ARM Id of the VM that will be created. + * For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + * + * @param targetVirtualMachineId the targetVirtualMachineId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + this.targetVirtualMachineId = targetVirtualMachineId; + return this; + } + + /** + * Get the targetResourceGroupId property: This is the ARM Id of the resource group that you want to create for this + * Virtual machine and other artifacts. + * For e.g. /subscriptions/{subId}/resourcegroups/{rg}. + * + * @return the targetResourceGroupId value. + */ + public String targetResourceGroupId() { + return this.targetResourceGroupId; + } + + /** + * Set the targetResourceGroupId property: This is the ARM Id of the resource group that you want to create for this + * Virtual machine and other artifacts. + * For e.g. /subscriptions/{subId}/resourcegroups/{rg}. + * + * @param targetResourceGroupId the targetResourceGroupId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withTargetResourceGroupId(String targetResourceGroupId) { + this.targetResourceGroupId = targetResourceGroupId; + return this; + } + + /** + * Get the storageAccountId property: Fully qualified ARM ID of the storage account to which the VM has to be + * restored. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: Fully qualified ARM ID of the storage account to which the VM has to be + * restored. + * + * @param storageAccountId the storageAccountId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the virtualNetworkId property: This is the virtual network Id of the vnet that will be attached to the + * virtual machine. + * User will be validated for join action permissions in the linked access. + * + * @return the virtualNetworkId value. + */ + public String virtualNetworkId() { + return this.virtualNetworkId; + } + + /** + * Set the virtualNetworkId property: This is the virtual network Id of the vnet that will be attached to the + * virtual machine. + * User will be validated for join action permissions in the linked access. + * + * @param virtualNetworkId the virtualNetworkId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withVirtualNetworkId(String virtualNetworkId) { + this.virtualNetworkId = virtualNetworkId; + return this; + } + + /** + * Get the subnetId property: Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it + * would be + * {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to + * represent + * the subnet. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it + * would be + * {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to + * represent + * the subnet. + * + * @param subnetId the subnetId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the targetDomainNameId property: Fully qualified ARM ID of the domain name to be associated to the VM being + * restored. This applies only to Classic + * Virtual Machines. + * + * @return the targetDomainNameId value. + */ + public String targetDomainNameId() { + return this.targetDomainNameId; + } + + /** + * Set the targetDomainNameId property: Fully qualified ARM ID of the domain name to be associated to the VM being + * restored. This applies only to Classic + * Virtual Machines. + * + * @param targetDomainNameId the targetDomainNameId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withTargetDomainNameId(String targetDomainNameId) { + this.targetDomainNameId = targetDomainNameId; + return this; + } + + /** + * Get the region property: Region in which the virtual machine is restored. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: Region in which the virtual machine is restored. + * + * @param region the region value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the affinityGroup property: Affinity group associated to VM to be restored. Used only for Classic Compute + * Virtual Machines. + * + * @return the affinityGroup value. + */ + public String affinityGroup() { + return this.affinityGroup; + } + + /** + * Set the affinityGroup property: Affinity group associated to VM to be restored. Used only for Classic Compute + * Virtual Machines. + * + * @param affinityGroup the affinityGroup value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withAffinityGroup(String affinityGroup) { + this.affinityGroup = affinityGroup; + return this; + } + + /** + * Get the createNewCloudService property: Should a new cloud service be created while restoring the VM. If this is + * false, VM will be restored to the same + * cloud service as it was at the time of backup. + * + * @return the createNewCloudService value. + */ + public Boolean createNewCloudService() { + return this.createNewCloudService; + } + + /** + * Set the createNewCloudService property: Should a new cloud service be created while restoring the VM. If this is + * false, VM will be restored to the same + * cloud service as it was at the time of backup. + * + * @param createNewCloudService the createNewCloudService value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withCreateNewCloudService(Boolean createNewCloudService) { + this.createNewCloudService = createNewCloudService; + return this; + } + + /** + * Get the originalStorageAccountOption property: Original Storage Account Option. + * + * @return the originalStorageAccountOption value. + */ + public Boolean originalStorageAccountOption() { + return this.originalStorageAccountOption; + } + + /** + * Set the originalStorageAccountOption property: Original Storage Account Option. + * + * @param originalStorageAccountOption the originalStorageAccountOption value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withOriginalStorageAccountOption(Boolean originalStorageAccountOption) { + this.originalStorageAccountOption = originalStorageAccountOption; + return this; + } + + /** + * Get the encryptionDetails property: Details needed if the VM was encrypted at the time of backup. + * + * @return the encryptionDetails value. + */ + public EncryptionDetails encryptionDetails() { + return this.encryptionDetails; + } + + /** + * Set the encryptionDetails property: Details needed if the VM was encrypted at the time of backup. + * + * @param encryptionDetails the encryptionDetails value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withEncryptionDetails(EncryptionDetails encryptionDetails) { + this.encryptionDetails = encryptionDetails; + return this; + } + + /** + * Get the restoreDiskLunList property: List of Disk LUNs for partial restore. + * + * @return the restoreDiskLunList value. + */ + public List restoreDiskLunList() { + return this.restoreDiskLunList; + } + + /** + * Set the restoreDiskLunList property: List of Disk LUNs for partial restore. + * + * @param restoreDiskLunList the restoreDiskLunList value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRestoreDiskLunList(List restoreDiskLunList) { + this.restoreDiskLunList = restoreDiskLunList; + return this; + } + + /** + * Get the restoreWithManagedDisks property: Flag to denote of an Unmanaged disk VM should be restored with Managed + * disks. + * + * @return the restoreWithManagedDisks value. + */ + public Boolean restoreWithManagedDisks() { + return this.restoreWithManagedDisks; + } + + /** + * Set the restoreWithManagedDisks property: Flag to denote of an Unmanaged disk VM should be restored with Managed + * disks. + * + * @param restoreWithManagedDisks the restoreWithManagedDisks value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRestoreWithManagedDisks(Boolean restoreWithManagedDisks) { + this.restoreWithManagedDisks = restoreWithManagedDisks; + return this; + } + + /** + * Get the diskEncryptionSetId property: DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest + * during restore with customer managed key. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest + * during restore with customer managed key. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + return this; + } + + /** + * Get the zones property: Target zone where the VM and its disks should be restored. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Target zone where the VM and its disks should be restored. + * + * @param zones the zones value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the identityInfo property: Managed Identity information required to access customer storage account. + * + * @return the identityInfo value. + */ + public IdentityInfo identityInfo() { + return this.identityInfo; + } + + /** + * Set the identityInfo property: Managed Identity information required to access customer storage account. + * + * @param identityInfo the identityInfo value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withIdentityInfo(IdentityInfo identityInfo) { + this.identityInfo = identityInfo; + return this; + } + + /** + * Get the identityBasedRestoreDetails property: IaaS VM workload specific restore details for restores using + * managed identity. + * + * @return the identityBasedRestoreDetails value. + */ + public IdentityBasedRestoreDetails identityBasedRestoreDetails() { + return this.identityBasedRestoreDetails; + } + + /** + * Set the identityBasedRestoreDetails property: IaaS VM workload specific restore details for restores using + * managed identity. + * + * @param identityBasedRestoreDetails the identityBasedRestoreDetails value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest + withIdentityBasedRestoreDetails(IdentityBasedRestoreDetails identityBasedRestoreDetails) { + this.identityBasedRestoreDetails = identityBasedRestoreDetails; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + jsonWriter.writeStringField("recoveryPointId", this.recoveryPointId); + jsonWriter.writeStringField("recoveryType", this.recoveryType == null ? null : this.recoveryType.toString()); + jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); + jsonWriter.writeStringField("targetVirtualMachineId", this.targetVirtualMachineId); + jsonWriter.writeStringField("targetResourceGroupId", this.targetResourceGroupId); + jsonWriter.writeStringField("storageAccountId", this.storageAccountId); + jsonWriter.writeStringField("virtualNetworkId", this.virtualNetworkId); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeStringField("targetDomainNameId", this.targetDomainNameId); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("affinityGroup", this.affinityGroup); + jsonWriter.writeBooleanField("createNewCloudService", this.createNewCloudService); + jsonWriter.writeBooleanField("originalStorageAccountOption", this.originalStorageAccountOption); + jsonWriter.writeJsonField("encryptionDetails", this.encryptionDetails); + jsonWriter.writeArrayField("restoreDiskLunList", this.restoreDiskLunList, + (writer, element) -> writer.writeInt(element)); + jsonWriter.writeBooleanField("restoreWithManagedDisks", this.restoreWithManagedDisks); + jsonWriter.writeStringField("diskEncryptionSetId", this.diskEncryptionSetId); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identityInfo", this.identityInfo); + jsonWriter.writeJsonField("identityBasedRestoreDetails", this.identityBasedRestoreDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IaasVMRestoreRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IaasVMRestoreRequest 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 IaasVMRestoreRequest. + */ + public static IaasVMRestoreRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IaasVMRestoreRequest deserializedIaasVMRestoreRequest = new IaasVMRestoreRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedIaasVMRestoreRequest.objectType = reader.getString(); + } else if ("recoveryPointId".equals(fieldName)) { + deserializedIaasVMRestoreRequest.recoveryPointId = reader.getString(); + } else if ("recoveryType".equals(fieldName)) { + deserializedIaasVMRestoreRequest.recoveryType = RecoveryType.fromString(reader.getString()); + } else if ("sourceResourceId".equals(fieldName)) { + deserializedIaasVMRestoreRequest.sourceResourceId = reader.getString(); + } else if ("targetVirtualMachineId".equals(fieldName)) { + deserializedIaasVMRestoreRequest.targetVirtualMachineId = reader.getString(); + } else if ("targetResourceGroupId".equals(fieldName)) { + deserializedIaasVMRestoreRequest.targetResourceGroupId = reader.getString(); + } else if ("storageAccountId".equals(fieldName)) { + deserializedIaasVMRestoreRequest.storageAccountId = reader.getString(); + } else if ("virtualNetworkId".equals(fieldName)) { + deserializedIaasVMRestoreRequest.virtualNetworkId = reader.getString(); + } else if ("subnetId".equals(fieldName)) { + deserializedIaasVMRestoreRequest.subnetId = reader.getString(); + } else if ("targetDomainNameId".equals(fieldName)) { + deserializedIaasVMRestoreRequest.targetDomainNameId = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedIaasVMRestoreRequest.region = reader.getString(); + } else if ("affinityGroup".equals(fieldName)) { + deserializedIaasVMRestoreRequest.affinityGroup = reader.getString(); + } else if ("createNewCloudService".equals(fieldName)) { + deserializedIaasVMRestoreRequest.createNewCloudService = reader.getNullable(JsonReader::getBoolean); + } else if ("originalStorageAccountOption".equals(fieldName)) { + deserializedIaasVMRestoreRequest.originalStorageAccountOption + = reader.getNullable(JsonReader::getBoolean); + } else if ("encryptionDetails".equals(fieldName)) { + deserializedIaasVMRestoreRequest.encryptionDetails = EncryptionDetails.fromJson(reader); + } else if ("restoreDiskLunList".equals(fieldName)) { + List restoreDiskLunList = reader.readArray(reader1 -> reader1.getInt()); + deserializedIaasVMRestoreRequest.restoreDiskLunList = restoreDiskLunList; + } else if ("restoreWithManagedDisks".equals(fieldName)) { + deserializedIaasVMRestoreRequest.restoreWithManagedDisks + = reader.getNullable(JsonReader::getBoolean); + } else if ("diskEncryptionSetId".equals(fieldName)) { + deserializedIaasVMRestoreRequest.diskEncryptionSetId = reader.getString(); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedIaasVMRestoreRequest.zones = zones; + } else if ("identityInfo".equals(fieldName)) { + deserializedIaasVMRestoreRequest.identityInfo = IdentityInfo.fromJson(reader); + } else if ("identityBasedRestoreDetails".equals(fieldName)) { + deserializedIaasVMRestoreRequest.identityBasedRestoreDetails + = IdentityBasedRestoreDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIaasVMRestoreRequest; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IdentityBasedRestoreDetails.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IdentityBasedRestoreDetails.java new file mode 100644 index 000000000000..6459cac29256 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IdentityBasedRestoreDetails.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * IaaS VM workload specific restore details for restores using managed identity. + */ +@Fluent +public final class IdentityBasedRestoreDetails implements JsonSerializable { + /* + * Gets the class type. + */ + private String objectType; + + /* + * Fully qualified ARM ID of the target storage account. + */ + private String targetStorageAccountId; + + /** + * Creates an instance of IdentityBasedRestoreDetails class. + */ + public IdentityBasedRestoreDetails() { + } + + /** + * Get the objectType property: Gets the class type. + * + * @return the objectType value. + */ + public String objectType() { + return this.objectType; + } + + /** + * Set the objectType property: Gets the class type. + * + * @param objectType the objectType value to set. + * @return the IdentityBasedRestoreDetails object itself. + */ + public IdentityBasedRestoreDetails withObjectType(String objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the targetStorageAccountId property: Fully qualified ARM ID of the target storage account. + * + * @return the targetStorageAccountId value. + */ + public String targetStorageAccountId() { + return this.targetStorageAccountId; + } + + /** + * Set the targetStorageAccountId property: Fully qualified ARM ID of the target storage account. + * + * @param targetStorageAccountId the targetStorageAccountId value to set. + * @return the IdentityBasedRestoreDetails object itself. + */ + public IdentityBasedRestoreDetails withTargetStorageAccountId(String targetStorageAccountId) { + this.targetStorageAccountId = targetStorageAccountId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + jsonWriter.writeStringField("targetStorageAccountId", this.targetStorageAccountId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdentityBasedRestoreDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdentityBasedRestoreDetails 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 IdentityBasedRestoreDetails. + */ + public static IdentityBasedRestoreDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdentityBasedRestoreDetails deserializedIdentityBasedRestoreDetails = new IdentityBasedRestoreDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedIdentityBasedRestoreDetails.objectType = reader.getString(); + } else if ("targetStorageAccountId".equals(fieldName)) { + deserializedIdentityBasedRestoreDetails.targetStorageAccountId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIdentityBasedRestoreDetails; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IdentityInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IdentityInfo.java new file mode 100644 index 000000000000..c041c7aa31eb --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IdentityInfo.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Encapsulates Managed Identity related information. + */ +@Fluent +public final class IdentityInfo implements JsonSerializable { + /* + * To differentiate if the managed identity is system assigned or user assigned + */ + private Boolean isSystemAssignedIdentity; + + /* + * Managed Identity Resource Id + * Optional: Might not be required in the case of system assigned managed identity + */ + private String managedIdentityResourceId; + + /** + * Creates an instance of IdentityInfo class. + */ + public IdentityInfo() { + } + + /** + * Get the isSystemAssignedIdentity property: To differentiate if the managed identity is system assigned or user + * assigned. + * + * @return the isSystemAssignedIdentity value. + */ + public Boolean isSystemAssignedIdentity() { + return this.isSystemAssignedIdentity; + } + + /** + * Set the isSystemAssignedIdentity property: To differentiate if the managed identity is system assigned or user + * assigned. + * + * @param isSystemAssignedIdentity the isSystemAssignedIdentity value to set. + * @return the IdentityInfo object itself. + */ + public IdentityInfo withIsSystemAssignedIdentity(Boolean isSystemAssignedIdentity) { + this.isSystemAssignedIdentity = isSystemAssignedIdentity; + return this; + } + + /** + * Get the managedIdentityResourceId property: Managed Identity Resource Id + * Optional: Might not be required in the case of system assigned managed identity. + * + * @return the managedIdentityResourceId value. + */ + public String managedIdentityResourceId() { + return this.managedIdentityResourceId; + } + + /** + * Set the managedIdentityResourceId property: Managed Identity Resource Id + * Optional: Might not be required in the case of system assigned managed identity. + * + * @param managedIdentityResourceId the managedIdentityResourceId value to set. + * @return the IdentityInfo object itself. + */ + public IdentityInfo withManagedIdentityResourceId(String managedIdentityResourceId) { + this.managedIdentityResourceId = managedIdentityResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isSystemAssignedIdentity", this.isSystemAssignedIdentity); + jsonWriter.writeStringField("managedIdentityResourceId", this.managedIdentityResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdentityInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdentityInfo 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 IdentityInfo. + */ + public static IdentityInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdentityInfo deserializedIdentityInfo = new IdentityInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isSystemAssignedIdentity".equals(fieldName)) { + deserializedIdentityInfo.isSystemAssignedIdentity = reader.getNullable(JsonReader::getBoolean); + } else if ("managedIdentityResourceId".equals(fieldName)) { + deserializedIdentityInfo.managedIdentityResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIdentityInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/InstantItemRecoveryTarget.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/InstantItemRecoveryTarget.java new file mode 100644 index 000000000000..5c2da45b36ac --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/InstantItemRecoveryTarget.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Target details for file / folder restore. + */ +@Immutable +public final class InstantItemRecoveryTarget implements JsonSerializable { + /* + * List of client scripts. + */ + private List clientScripts; + + /** + * Creates an instance of InstantItemRecoveryTarget class. + */ + private InstantItemRecoveryTarget() { + } + + /** + * Get the clientScripts property: List of client scripts. + * + * @return the clientScripts value. + */ + public List clientScripts() { + return this.clientScripts; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("clientScripts", this.clientScripts, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstantItemRecoveryTarget from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstantItemRecoveryTarget 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 InstantItemRecoveryTarget. + */ + public static InstantItemRecoveryTarget fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstantItemRecoveryTarget deserializedInstantItemRecoveryTarget = new InstantItemRecoveryTarget(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientScripts".equals(fieldName)) { + List clientScripts + = reader.readArray(reader1 -> ClientScriptForConnect.fromJson(reader1)); + deserializedInstantItemRecoveryTarget.clientScripts = clientScripts; + } else { + reader.skipChildren(); + } + } + + return deserializedInstantItemRecoveryTarget; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/Job.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/Job.java new file mode 100644 index 000000000000..6b0f4ee83581 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/Job.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Defines workload agnostic properties for a job. + */ +@Immutable +public class Job implements JsonSerializable { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String jobType = "Job"; + + /* + * Friendly name of the entity on which the current job is executing. + */ + private String entityFriendlyName; + + /* + * Backup management type to execute the current job. + */ + private BackupManagementType backupManagementType; + + /* + * The operation name. + */ + private String operation; + + /* + * Job status. + */ + private String status; + + /* + * The start time. + */ + private OffsetDateTime startTime; + + /* + * The end time. + */ + private OffsetDateTime endTime; + + /* + * ActivityId of job. + */ + private String activityId; + + /** + * Creates an instance of Job class. + */ + protected Job() { + } + + /** + * Get the jobType property: This property will be used as the discriminator for deciding the specific types in the + * polymorphic chain of types. + * + * @return the jobType value. + */ + public String jobType() { + return this.jobType; + } + + /** + * Get the entityFriendlyName property: Friendly name of the entity on which the current job is executing. + * + * @return the entityFriendlyName value. + */ + public String entityFriendlyName() { + return this.entityFriendlyName; + } + + /** + * Set the entityFriendlyName property: Friendly name of the entity on which the current job is executing. + * + * @param entityFriendlyName the entityFriendlyName value to set. + * @return the Job object itself. + */ + Job withEntityFriendlyName(String entityFriendlyName) { + this.entityFriendlyName = entityFriendlyName; + return this; + } + + /** + * Get the backupManagementType property: Backup management type to execute the current job. + * + * @return the backupManagementType value. + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backupManagementType property: Backup management type to execute the current job. + * + * @param backupManagementType the backupManagementType value to set. + * @return the Job object itself. + */ + Job withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the operation property: The operation name. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The operation name. + * + * @param operation the operation value to set. + * @return the Job object itself. + */ + Job withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the status property: Job status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Job status. + * + * @param status the status value to set. + * @return the Job object itself. + */ + Job withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the startTime property: The start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time. + * + * @param startTime the startTime value to set. + * @return the Job object itself. + */ + Job withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time. + * + * @param endTime the endTime value to set. + * @return the Job object itself. + */ + Job withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the activityId property: ActivityId of job. + * + * @return the activityId value. + */ + public String activityId() { + return this.activityId; + } + + /** + * Set the activityId property: ActivityId of job. + * + * @param activityId the activityId value to set. + * @return the Job object itself. + */ + Job withActivityId(String activityId) { + this.activityId = activityId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobType", this.jobType); + jsonWriter.writeStringField("entityFriendlyName", this.entityFriendlyName); + jsonWriter.writeStringField("backupManagementType", + this.backupManagementType == null ? null : this.backupManagementType.toString()); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("status", this.status); + 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("activityId", this.activityId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Job from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Job 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 Job. + */ + public static Job 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 ("jobType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AzureIaaSVMJob".equals(discriminatorValue)) { + return AzureIaaSVMJob.fromJson(readerToUse.reset()); + } else if ("AzureStorageJob".equals(discriminatorValue)) { + return AzureStorageJob.fromJson(readerToUse.reset()); + } else if ("AzureWorkloadJob".equals(discriminatorValue)) { + return AzureWorkloadJob.fromJson(readerToUse.reset()); + } else if ("DpmJob".equals(discriminatorValue)) { + return DpmJob.fromJson(readerToUse.reset()); + } else if ("MabJob".equals(discriminatorValue)) { + return MabJob.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static Job fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Job deserializedJob = new Job(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobType".equals(fieldName)) { + deserializedJob.jobType = reader.getString(); + } else if ("entityFriendlyName".equals(fieldName)) { + deserializedJob.entityFriendlyName = reader.getString(); + } else if ("backupManagementType".equals(fieldName)) { + deserializedJob.backupManagementType = BackupManagementType.fromString(reader.getString()); + } else if ("operation".equals(fieldName)) { + deserializedJob.operation = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedJob.status = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedJob.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedJob.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("activityId".equals(fieldName)) { + deserializedJob.activityId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJob; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobResource.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobResource.java new file mode 100644 index 000000000000..b42073474189 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobResource.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceInner; +import java.util.Map; + +/** + * An immutable client-side representation of JobResource. + */ +public interface JobResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: JobResource properties. + * + * @return the properties value. + */ + Job properties(); + + /** + * Gets the eTag property: Optional ETag. + * + * @return the eTag value. + */ + String eTag(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceInner + * object. + * + * @return the inner object. + */ + JobResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobResourceList.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobResourceList.java new file mode 100644 index 000000000000..a6a6df41124e --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobResourceList.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceListInner; +import java.util.List; + +/** + * An immutable client-side representation of JobResourceList. + */ +public interface JobResourceList { + /** + * Gets the nextLink property: The uri to fetch the next page of resources. Call ListNext() fetches next page of + * resources. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the value property: List of resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceListInner object. + * + * @return the inner object. + */ + JobResourceListInner innerModel(); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobSupportedAction.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobSupportedAction.java new file mode 100644 index 000000000000..e20536e982f7 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobSupportedAction.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +/** + * Defines values for JobSupportedAction. + */ +public enum JobSupportedAction { + /** + * Enum value Invalid. + */ + INVALID("Invalid"), + + /** + * Enum value Cancellable. + */ + CANCELLABLE("Cancellable"), + + /** + * Enum value Retriable. + */ + RETRIABLE("Retriable"); + + /** + * The actual serialized value for a JobSupportedAction instance. + */ + private final String value; + + JobSupportedAction(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobSupportedAction instance. + * + * @param value the serialized value to parse. + * @return the parsed JobSupportedAction object, or null if unable to parse. + */ + public static JobSupportedAction fromString(String value) { + if (value == null) { + return null; + } + JobSupportedAction[] items = JobSupportedAction.values(); + for (JobSupportedAction item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KEKDetails.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KEKDetails.java new file mode 100644 index 000000000000..b61618eed124 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KEKDetails.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * KEK is encryption key for BEK. + */ +@Immutable +public final class KEKDetails implements JsonSerializable { + /* + * Key is KEK. + */ + private String keyUrl; + + /* + * Key Vault ID where this Key is stored. + */ + private String keyVaultId; + + /* + * KEK data. + */ + private String keyBackupData; + + /** + * Creates an instance of KEKDetails class. + */ + private KEKDetails() { + } + + /** + * Get the keyUrl property: Key is KEK. + * + * @return the keyUrl value. + */ + public String keyUrl() { + return this.keyUrl; + } + + /** + * Get the keyVaultId property: Key Vault ID where this Key is stored. + * + * @return the keyVaultId value. + */ + public String keyVaultId() { + return this.keyVaultId; + } + + /** + * Get the keyBackupData property: KEK data. + * + * @return the keyBackupData value. + */ + public String keyBackupData() { + return this.keyBackupData; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyUrl", this.keyUrl); + jsonWriter.writeStringField("keyVaultId", this.keyVaultId); + jsonWriter.writeStringField("keyBackupData", this.keyBackupData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KEKDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KEKDetails 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 KEKDetails. + */ + public static KEKDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KEKDetails deserializedKEKDetails = new KEKDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyUrl".equals(fieldName)) { + deserializedKEKDetails.keyUrl = reader.getString(); + } else if ("keyVaultId".equals(fieldName)) { + deserializedKEKDetails.keyVaultId = reader.getString(); + } else if ("keyBackupData".equals(fieldName)) { + deserializedKEKDetails.keyBackupData = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKEKDetails; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KPIResourceHealthDetails.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KPIResourceHealthDetails.java new file mode 100644 index 000000000000..c755ee76c4f2 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KPIResourceHealthDetails.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * KPI Resource Health Details. + */ +@Immutable +public final class KPIResourceHealthDetails implements JsonSerializable { + /* + * Resource Health Status + */ + private ResourceHealthStatus resourceHealthStatus; + + /* + * Resource Health Status + */ + private List resourceHealthDetails; + + /** + * Creates an instance of KPIResourceHealthDetails class. + */ + private KPIResourceHealthDetails() { + } + + /** + * Get the resourceHealthStatus property: Resource Health Status. + * + * @return the resourceHealthStatus value. + */ + public ResourceHealthStatus resourceHealthStatus() { + return this.resourceHealthStatus; + } + + /** + * Get the resourceHealthDetails property: Resource Health Status. + * + * @return the resourceHealthDetails value. + */ + public List resourceHealthDetails() { + return this.resourceHealthDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceHealthStatus", + this.resourceHealthStatus == null ? null : this.resourceHealthStatus.toString()); + jsonWriter.writeArrayField("resourceHealthDetails", this.resourceHealthDetails, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KPIResourceHealthDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KPIResourceHealthDetails 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 KPIResourceHealthDetails. + */ + public static KPIResourceHealthDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KPIResourceHealthDetails deserializedKPIResourceHealthDetails = new KPIResourceHealthDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceHealthStatus".equals(fieldName)) { + deserializedKPIResourceHealthDetails.resourceHealthStatus + = ResourceHealthStatus.fromString(reader.getString()); + } else if ("resourceHealthDetails".equals(fieldName)) { + List resourceHealthDetails + = reader.readArray(reader1 -> ResourceHealthDetails.fromJson(reader1)); + deserializedKPIResourceHealthDetails.resourceHealthDetails = resourceHealthDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedKPIResourceHealthDetails; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KeyAndSecretDetails.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KeyAndSecretDetails.java new file mode 100644 index 000000000000..fe0008e2089b --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KeyAndSecretDetails.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * BEK is bitlocker key. + * KEK is encryption key for BEK + * If the VM was encrypted then we will store following details : + * 1. Secret(BEK) - Url + Backup Data + vaultId. + * 2. Key(KEK) - Url + Backup Data + vaultId. + * 3. EncryptionMechanism + * BEK and KEK can potentially have different vault ids. + */ +@Immutable +public final class KeyAndSecretDetails implements JsonSerializable { + /* + * KEK is encryption key for BEK. + */ + private KEKDetails kekDetails; + + /* + * BEK is bitlocker encryption key. + */ + private BEKDetails bekDetails; + + /* + * Encryption mechanism: None/ SinglePass/ DoublePass + */ + private String encryptionMechanism; + + /** + * Creates an instance of KeyAndSecretDetails class. + */ + private KeyAndSecretDetails() { + } + + /** + * Get the kekDetails property: KEK is encryption key for BEK. + * + * @return the kekDetails value. + */ + public KEKDetails kekDetails() { + return this.kekDetails; + } + + /** + * Get the bekDetails property: BEK is bitlocker encryption key. + * + * @return the bekDetails value. + */ + public BEKDetails bekDetails() { + return this.bekDetails; + } + + /** + * Get the encryptionMechanism property: Encryption mechanism: None/ SinglePass/ DoublePass. + * + * @return the encryptionMechanism value. + */ + public String encryptionMechanism() { + return this.encryptionMechanism; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("kekDetails", this.kekDetails); + jsonWriter.writeJsonField("bekDetails", this.bekDetails); + jsonWriter.writeStringField("encryptionMechanism", this.encryptionMechanism); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyAndSecretDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyAndSecretDetails 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 KeyAndSecretDetails. + */ + public static KeyAndSecretDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyAndSecretDetails deserializedKeyAndSecretDetails = new KeyAndSecretDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kekDetails".equals(fieldName)) { + deserializedKeyAndSecretDetails.kekDetails = KEKDetails.fromJson(reader); + } else if ("bekDetails".equals(fieldName)) { + deserializedKeyAndSecretDetails.bekDetails = BEKDetails.fromJson(reader); + } else if ("encryptionMechanism".equals(fieldName)) { + deserializedKeyAndSecretDetails.encryptionMechanism = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyAndSecretDetails; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/LastBackupStatus.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/LastBackupStatus.java new file mode 100644 index 000000000000..eb5e56de5eee --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/LastBackupStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Last backup operation status. Possible values: Healthy, Unhealthy. + */ +public final class LastBackupStatus extends ExpandableStringEnum { + /** + * Static value Invalid for LastBackupStatus. + */ + public static final LastBackupStatus INVALID = fromString("Invalid"); + + /** + * Static value Healthy for LastBackupStatus. + */ + public static final LastBackupStatus HEALTHY = fromString("Healthy"); + + /** + * Static value Unhealthy for LastBackupStatus. + */ + public static final LastBackupStatus UNHEALTHY = fromString("Unhealthy"); + + /** + * Static value IRPending for LastBackupStatus. + */ + public static final LastBackupStatus IRPENDING = fromString("IRPending"); + + /** + * Creates a new instance of LastBackupStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LastBackupStatus() { + } + + /** + * Creates or finds a LastBackupStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding LastBackupStatus. + */ + public static LastBackupStatus fromString(String name) { + return fromString(name, LastBackupStatus.class); + } + + /** + * Gets known LastBackupStatus values. + * + * @return known LastBackupStatus values. + */ + public static Collection values() { + return values(LastBackupStatus.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabErrorInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabErrorInfo.java new file mode 100644 index 000000000000..7dda1e7ae606 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabErrorInfo.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * MAB workload-specific error information. + */ +@Immutable +public final class MabErrorInfo implements JsonSerializable { + /* + * Localized error string. + */ + private String errorString; + + /* + * List of localized recommendations. + */ + private List recommendations; + + /** + * Creates an instance of MabErrorInfo class. + */ + private MabErrorInfo() { + } + + /** + * Get the errorString property: Localized error string. + * + * @return the errorString value. + */ + public String errorString() { + return this.errorString; + } + + /** + * Get the recommendations property: List of localized recommendations. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MabErrorInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MabErrorInfo 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 MabErrorInfo. + */ + public static MabErrorInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MabErrorInfo deserializedMabErrorInfo = new MabErrorInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorString".equals(fieldName)) { + deserializedMabErrorInfo.errorString = reader.getString(); + } else if ("recommendations".equals(fieldName)) { + List recommendations = reader.readArray(reader1 -> reader1.getString()); + deserializedMabErrorInfo.recommendations = recommendations; + } else { + reader.skipChildren(); + } + } + + return deserializedMabErrorInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabFileFolderProtectedItem.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabFileFolderProtectedItem.java new file mode 100644 index 000000000000..c6ab116affbf --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabFileFolderProtectedItem.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * MAB workload-specific backup item. + */ +@Immutable +public final class MabFileFolderProtectedItem extends ProtectedItem { + /* + * backup item type. + */ + private String protectedItemType = "MabFileFolderProtectedItem"; + + /* + * Friendly name of this backup item. + */ + private String friendlyName; + + /* + * Name of the computer associated with this backup item. + */ + private String computerName; + + /* + * Status of last backup operation. + */ + private String lastBackupStatus; + + /* + * Timestamp of the last backup operation on this backup item. + */ + private OffsetDateTime lastBackupTime; + + /* + * Protected, ProtectionStopped, IRPending or ProtectionError + */ + private String protectionState; + + /* + * Sync time for deferred deletion in UTC + */ + private Long deferredDeleteSyncTimeInUTC; + + /* + * Additional information with this backup item. + */ + private MabFileFolderProtectedItemExtendedInfo extendedInfo; + + /** + * Creates an instance of MabFileFolderProtectedItem class. + */ + private MabFileFolderProtectedItem() { + } + + /** + * Get the protectedItemType property: backup item type. + * + * @return the protectedItemType value. + */ + @Override + public String protectedItemType() { + return this.protectedItemType; + } + + /** + * Get the friendlyName property: Friendly name of this backup item. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Get the computerName property: Name of the computer associated with this backup item. + * + * @return the computerName value. + */ + public String computerName() { + return this.computerName; + } + + /** + * Get the lastBackupStatus property: Status of last backup operation. + * + * @return the lastBackupStatus value. + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item. + * + * @return the lastBackupTime value. + */ + public OffsetDateTime lastBackupTime() { + return this.lastBackupTime; + } + + /** + * Get the protectionState property: Protected, ProtectionStopped, IRPending or ProtectionError. + * + * @return the protectionState value. + */ + public String protectionState() { + return this.protectionState; + } + + /** + * Get the deferredDeleteSyncTimeInUTC property: Sync time for deferred deletion in UTC. + * + * @return the deferredDeleteSyncTimeInUTC value. + */ + public Long deferredDeleteSyncTimeInUTC() { + return this.deferredDeleteSyncTimeInUTC; + } + + /** + * Get the extendedInfo property: Additional information with this backup item. + * + * @return the extendedInfo value. + */ + public MabFileFolderProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupManagementType", + backupManagementType() == null ? null : backupManagementType().toString()); + jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString()); + 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.writeStringField("protectedItemType", this.protectedItemType); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("computerName", this.computerName); + jsonWriter.writeStringField("lastBackupStatus", this.lastBackupStatus); + jsonWriter.writeStringField("lastBackupTime", + this.lastBackupTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastBackupTime)); + jsonWriter.writeStringField("protectionState", this.protectionState); + jsonWriter.writeNumberField("deferredDeleteSyncTimeInUTC", this.deferredDeleteSyncTimeInUTC); + jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MabFileFolderProtectedItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MabFileFolderProtectedItem 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 MabFileFolderProtectedItem. + */ + public static MabFileFolderProtectedItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MabFileFolderProtectedItem deserializedMabFileFolderProtectedItem = new MabFileFolderProtectedItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupManagementType".equals(fieldName)) { + deserializedMabFileFolderProtectedItem + .withBackupManagementType(BackupManagementType.fromString(reader.getString())); + } else if ("workloadType".equals(fieldName)) { + deserializedMabFileFolderProtectedItem + .withWorkloadType(DataSourceType.fromString(reader.getString())); + } else if ("containerName".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.withContainerName(reader.getString()); + } else if ("sourceResourceId".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.withSourceResourceId(reader.getString()); + } else if ("policyId".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.withPolicyId(reader.getString()); + } else if ("lastRecoveryPoint".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.withLastRecoveryPoint(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("backupSetName".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.withBackupSetName(reader.getString()); + } else if ("createMode".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.withCreateMode(CreateMode.fromString(reader.getString())); + } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.withDeferredDeleteTimeInUTC(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("isScheduledForDeferredDelete".equals(fieldName)) { + deserializedMabFileFolderProtectedItem + .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); + } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.withDeferredDeleteTimeRemaining(reader.getString()); + } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { + deserializedMabFileFolderProtectedItem + .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); + } else if ("isRehydrate".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); + } else if ("resourceGuardOperationRequests".equals(fieldName)) { + List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); + deserializedMabFileFolderProtectedItem + .withResourceGuardOperationRequests(resourceGuardOperationRequests); + } else if ("protectedItemType".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.protectedItemType = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.friendlyName = reader.getString(); + } else if ("computerName".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.computerName = reader.getString(); + } else if ("lastBackupStatus".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.lastBackupStatus = reader.getString(); + } else if ("lastBackupTime".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.lastBackupTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("protectionState".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.protectionState = reader.getString(); + } else if ("deferredDeleteSyncTimeInUTC".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.deferredDeleteSyncTimeInUTC + = reader.getNullable(JsonReader::getLong); + } else if ("extendedInfo".equals(fieldName)) { + deserializedMabFileFolderProtectedItem.extendedInfo + = MabFileFolderProtectedItemExtendedInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMabFileFolderProtectedItem; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabFileFolderProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabFileFolderProtectedItemExtendedInfo.java new file mode 100644 index 000000000000..b27af92f0673 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabFileFolderProtectedItemExtendedInfo.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Additional information on the backed up item. + */ +@Immutable +public final class MabFileFolderProtectedItemExtendedInfo + implements JsonSerializable { + /* + * Last time when the agent data synced to service. + */ + private OffsetDateTime lastRefreshedAt; + + /* + * The oldest backup copy available. + */ + private OffsetDateTime oldestRecoveryPoint; + + /* + * Number of backup copies associated with the backup item. + */ + private Integer recoveryPointCount; + + /** + * Creates an instance of MabFileFolderProtectedItemExtendedInfo class. + */ + private MabFileFolderProtectedItemExtendedInfo() { + } + + /** + * Get the lastRefreshedAt property: Last time when the agent data synced to service. + * + * @return the lastRefreshedAt value. + */ + public OffsetDateTime lastRefreshedAt() { + return this.lastRefreshedAt; + } + + /** + * Get the oldestRecoveryPoint property: The oldest backup copy available. + * + * @return the oldestRecoveryPoint value. + */ + public OffsetDateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Get the recoveryPointCount property: Number of backup copies associated with the backup item. + * + * @return the recoveryPointCount value. + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("lastRefreshedAt", + this.lastRefreshedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastRefreshedAt)); + jsonWriter.writeStringField("oldestRecoveryPoint", + this.oldestRecoveryPoint == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPoint)); + jsonWriter.writeNumberField("recoveryPointCount", this.recoveryPointCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MabFileFolderProtectedItemExtendedInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MabFileFolderProtectedItemExtendedInfo 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 MabFileFolderProtectedItemExtendedInfo. + */ + public static MabFileFolderProtectedItemExtendedInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MabFileFolderProtectedItemExtendedInfo deserializedMabFileFolderProtectedItemExtendedInfo + = new MabFileFolderProtectedItemExtendedInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastRefreshedAt".equals(fieldName)) { + deserializedMabFileFolderProtectedItemExtendedInfo.lastRefreshedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("oldestRecoveryPoint".equals(fieldName)) { + deserializedMabFileFolderProtectedItemExtendedInfo.oldestRecoveryPoint = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("recoveryPointCount".equals(fieldName)) { + deserializedMabFileFolderProtectedItemExtendedInfo.recoveryPointCount + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMabFileFolderProtectedItemExtendedInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJob.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJob.java new file mode 100644 index 000000000000..5adafca2f6e1 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJob.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * MAB workload-specific job. + */ +@Immutable +public final class MabJob extends Job { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String jobType = "MabJob"; + + /* + * Time taken by job to run. + */ + private Duration duration; + + /* + * The state/actions applicable on jobs like cancel/retry. + */ + private List actionsInfo; + + /* + * Name of server protecting the DS. + */ + private String mabServerName; + + /* + * Server type of MAB container. + */ + private MabServerType mabServerType; + + /* + * Workload type of backup item. + */ + private WorkloadType workloadType; + + /* + * The errors. + */ + private List errorDetails; + + /* + * Additional information on the job. + */ + private MabJobExtendedInfo extendedInfo; + + /** + * Creates an instance of MabJob class. + */ + private MabJob() { + } + + /** + * Get the jobType property: This property will be used as the discriminator for deciding the specific types in the + * polymorphic chain of types. + * + * @return the jobType value. + */ + @Override + public String jobType() { + return this.jobType; + } + + /** + * Get the duration property: Time taken by job to run. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Get the actionsInfo property: The state/actions applicable on jobs like cancel/retry. + * + * @return the actionsInfo value. + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Get the mabServerName property: Name of server protecting the DS. + * + * @return the mabServerName value. + */ + public String mabServerName() { + return this.mabServerName; + } + + /** + * Get the mabServerType property: Server type of MAB container. + * + * @return the mabServerType value. + */ + public MabServerType mabServerType() { + return this.mabServerType; + } + + /** + * Get the workloadType property: Workload type of backup item. + * + * @return the workloadType value. + */ + public WorkloadType workloadType() { + return this.workloadType; + } + + /** + * Get the errorDetails property: The errors. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Get the extendedInfo property: Additional information on the job. + * + * @return the extendedInfo value. + */ + public MabJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * {@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.writeStringField("mabServerName", this.mabServerName); + jsonWriter.writeStringField("mabServerType", this.mabServerType == null ? null : this.mabServerType.toString()); + jsonWriter.writeStringField("workloadType", this.workloadType == null ? null : this.workloadType.toString()); + jsonWriter.writeArrayField("errorDetails", this.errorDetails, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MabJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MabJob 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 MabJob. + */ + public static MabJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MabJob deserializedMabJob = new MabJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("entityFriendlyName".equals(fieldName)) { + deserializedMabJob.withEntityFriendlyName(reader.getString()); + } else if ("backupManagementType".equals(fieldName)) { + deserializedMabJob.withBackupManagementType(BackupManagementType.fromString(reader.getString())); + } else if ("operation".equals(fieldName)) { + deserializedMabJob.withOperation(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedMabJob.withStatus(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedMabJob.withStartTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("endTime".equals(fieldName)) { + deserializedMabJob.withEndTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("activityId".equals(fieldName)) { + deserializedMabJob.withActivityId(reader.getString()); + } else if ("jobType".equals(fieldName)) { + deserializedMabJob.jobType = reader.getString(); + } else if ("duration".equals(fieldName)) { + deserializedMabJob.duration + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("actionsInfo".equals(fieldName)) { + List actionsInfo + = reader.readArray(reader1 -> JobSupportedAction.fromString(reader1.getString())); + deserializedMabJob.actionsInfo = actionsInfo; + } else if ("mabServerName".equals(fieldName)) { + deserializedMabJob.mabServerName = reader.getString(); + } else if ("mabServerType".equals(fieldName)) { + deserializedMabJob.mabServerType = MabServerType.fromString(reader.getString()); + } else if ("workloadType".equals(fieldName)) { + deserializedMabJob.workloadType = WorkloadType.fromString(reader.getString()); + } else if ("errorDetails".equals(fieldName)) { + List errorDetails = reader.readArray(reader1 -> MabErrorInfo.fromJson(reader1)); + deserializedMabJob.errorDetails = errorDetails; + } else if ("extendedInfo".equals(fieldName)) { + deserializedMabJob.extendedInfo = MabJobExtendedInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMabJob; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJobExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJobExtendedInfo.java new file mode 100644 index 000000000000..4ebab777ed6c --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJobExtendedInfo.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Additional information for the MAB workload-specific job. + */ +@Immutable +public final class MabJobExtendedInfo implements JsonSerializable { + /* + * List of tasks for this job. + */ + private List tasksList; + + /* + * The job properties. + */ + private Map propertyBag; + + /* + * Non localized error message specific to this job. + */ + private String dynamicErrorMessage; + + /** + * Creates an instance of MabJobExtendedInfo class. + */ + private MabJobExtendedInfo() { + } + + /** + * Get the tasksList property: List of tasks for this job. + * + * @return the tasksList value. + */ + public List tasksList() { + return this.tasksList; + } + + /** + * Get the propertyBag property: The job properties. + * + * @return the propertyBag value. + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Get the dynamicErrorMessage property: Non localized error message specific to this job. + * + * @return the dynamicErrorMessage value. + */ + public String dynamicErrorMessage() { + return this.dynamicErrorMessage; + } + + /** + * {@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 MabJobExtendedInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MabJobExtendedInfo 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 MabJobExtendedInfo. + */ + public static MabJobExtendedInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MabJobExtendedInfo deserializedMabJobExtendedInfo = new MabJobExtendedInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tasksList".equals(fieldName)) { + List tasksList + = reader.readArray(reader1 -> MabJobTaskDetails.fromJson(reader1)); + deserializedMabJobExtendedInfo.tasksList = tasksList; + } else if ("propertyBag".equals(fieldName)) { + Map propertyBag = reader.readMap(reader1 -> reader1.getString()); + deserializedMabJobExtendedInfo.propertyBag = propertyBag; + } else if ("dynamicErrorMessage".equals(fieldName)) { + deserializedMabJobExtendedInfo.dynamicErrorMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMabJobExtendedInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJobTaskDetails.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJobTaskDetails.java new file mode 100644 index 000000000000..42aab33ffabd --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJobTaskDetails.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * MAB workload-specific job task details. + */ +@Immutable +public final class MabJobTaskDetails implements JsonSerializable { + /* + * The task display name. + */ + private String taskId; + + /* + * The start time. + */ + private OffsetDateTime startTime; + + /* + * The end time. + */ + private OffsetDateTime endTime; + + /* + * Time elapsed for task. + */ + private Duration duration; + + /* + * The status. + */ + private String status; + + /** + * Creates an instance of MabJobTaskDetails class. + */ + private MabJobTaskDetails() { + } + + /** + * Get the taskId property: The task display name. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Get the startTime property: The start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the duration property: Time elapsed for task. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Get the status property: The status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * {@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("duration", CoreUtils.durationToStringWithDays(this.duration)); + jsonWriter.writeStringField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MabJobTaskDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MabJobTaskDetails 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 MabJobTaskDetails. + */ + public static MabJobTaskDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MabJobTaskDetails deserializedMabJobTaskDetails = new MabJobTaskDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("taskId".equals(fieldName)) { + deserializedMabJobTaskDetails.taskId = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedMabJobTaskDetails.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedMabJobTaskDetails.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("duration".equals(fieldName)) { + deserializedMabJobTaskDetails.duration + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedMabJobTaskDetails.status = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMabJobTaskDetails; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabServerType.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabServerType.java new file mode 100644 index 000000000000..a22bb58446de --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabServerType.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Server type of MAB container. + */ +public final class MabServerType extends ExpandableStringEnum { + /** + * Static value Invalid for MabServerType. + */ + public static final MabServerType INVALID = fromString("Invalid"); + + /** + * Static value Unknown for MabServerType. + */ + public static final MabServerType UNKNOWN = fromString("Unknown"); + + /** + * Static value IaasVMContainer for MabServerType. + */ + public static final MabServerType IAAS_VMCONTAINER = fromString("IaasVMContainer"); + + /** + * Static value IaasVMServiceContainer for MabServerType. + */ + public static final MabServerType IAAS_VMSERVICE_CONTAINER = fromString("IaasVMServiceContainer"); + + /** + * Static value DPMContainer for MabServerType. + */ + public static final MabServerType DPMCONTAINER = fromString("DPMContainer"); + + /** + * Static value AzureBackupServerContainer for MabServerType. + */ + public static final MabServerType AZURE_BACKUP_SERVER_CONTAINER = fromString("AzureBackupServerContainer"); + + /** + * Static value MABContainer for MabServerType. + */ + public static final MabServerType MABCONTAINER = fromString("MABContainer"); + + /** + * Static value Cluster for MabServerType. + */ + public static final MabServerType CLUSTER = fromString("Cluster"); + + /** + * Static value AzureSqlContainer for MabServerType. + */ + public static final MabServerType AZURE_SQL_CONTAINER = fromString("AzureSqlContainer"); + + /** + * Static value Windows for MabServerType. + */ + public static final MabServerType WINDOWS = fromString("Windows"); + + /** + * Static value VCenter for MabServerType. + */ + public static final MabServerType VCENTER = fromString("VCenter"); + + /** + * Static value VMAppContainer for MabServerType. + */ + public static final MabServerType VMAPP_CONTAINER = fromString("VMAppContainer"); + + /** + * Static value SQLAGWorkLoadContainer for MabServerType. + */ + public static final MabServerType SQLAGWORK_LOAD_CONTAINER = fromString("SQLAGWorkLoadContainer"); + + /** + * Static value StorageContainer for MabServerType. + */ + public static final MabServerType STORAGE_CONTAINER = fromString("StorageContainer"); + + /** + * Static value GenericContainer for MabServerType. + */ + public static final MabServerType GENERIC_CONTAINER = fromString("GenericContainer"); + + /** + * Creates a new instance of MabServerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MabServerType() { + } + + /** + * Creates or finds a MabServerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MabServerType. + */ + public static MabServerType fromString(String name) { + return fromString(name, MabServerType.class); + } + + /** + * Gets known MabServerType values. + * + * @return known MabServerType values. + */ + public static Collection values() { + return values(MabServerType.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/NameInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/NameInfo.java new file mode 100644 index 000000000000..ea072fe9ff17 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/NameInfo.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The name of usage. + */ +@Immutable +public final class NameInfo implements JsonSerializable { + /* + * Value of usage. + */ + private String value; + + /* + * Localized value of usage. + */ + private String localizedValue; + + /** + * Creates an instance of NameInfo class. + */ + private NameInfo() { + } + + /** + * Get the value property: Value of usage. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Get the localizedValue property: Localized value of usage. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("localizedValue", this.localizedValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NameInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NameInfo 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 NameInfo. + */ + public static NameInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NameInfo deserializedNameInfo = new NameInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedNameInfo.value = reader.getString(); + } else if ("localizedValue".equals(fieldName)) { + deserializedNameInfo.localizedValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNameInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatus.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatus.java new file mode 100644 index 000000000000..08b56ea28940 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatus.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.OperationStatusInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of OperationStatus. + */ +public interface OperationStatus { + /** + * Gets the id property: ID of the operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + OperationStatusValues status(); + + /** + * Gets the startTime property: Operation start time. Format: ISO-8601. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: Operation end time. Format: ISO-8601. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the error property: Error information related to this operation. + * + * @return the error value. + */ + OperationStatusError error(); + + /** + * Gets the properties property: Additional information associated with this operation. + * + * @return the properties value. + */ + OperationStatusExtendedInfo properties(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.OperationStatusInner object. + * + * @return the inner object. + */ + OperationStatusInner innerModel(); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusError.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusError.java new file mode 100644 index 000000000000..e7e763eb3d62 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusError.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Error information associated with operation status call. + */ +@Immutable +public final class OperationStatusError implements JsonSerializable { + /* + * Error code of the operation failure. + */ + private String code; + + /* + * Error message displayed if the operation failure. + */ + private String message; + + /** + * Creates an instance of OperationStatusError class. + */ + private OperationStatusError() { + } + + /** + * Get the code property: Error code of the operation failure. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: Error message displayed if the operation failure. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusError 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 OperationStatusError. + */ + public static OperationStatusError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusError deserializedOperationStatusError = new OperationStatusError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedOperationStatusError.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedOperationStatusError.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusError; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusExtendedInfo.java new file mode 100644 index 000000000000..772e239d2911 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusExtendedInfo.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base class for additional information of operation status. + */ +@Immutable +public class OperationStatusExtendedInfo implements JsonSerializable { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "OperationStatusExtendedInfo"; + + /** + * Creates an instance of OperationStatusExtendedInfo class. + */ + protected OperationStatusExtendedInfo() { + } + + /** + * 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. + */ + public String objectType() { + return this.objectType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusExtendedInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusExtendedInfo 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 OperationStatusExtendedInfo. + */ + public static OperationStatusExtendedInfo 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 ("OperationStatusJobExtendedInfo".equals(discriminatorValue)) { + return OperationStatusJobExtendedInfo.fromJson(readerToUse.reset()); + } else if ("OperationStatusJobsExtendedInfo".equals(discriminatorValue)) { + return OperationStatusJobsExtendedInfo.fromJson(readerToUse.reset()); + } else if ("OperationStatusProvisionILRExtendedInfo".equals(discriminatorValue)) { + return OperationStatusProvisionILRExtendedInfo.fromJson(readerToUse.reset()); + } else if ("OperationStatusRecoveryPointExtendedInfo".equals(discriminatorValue)) { + return OperationStatusRecoveryPointExtendedInfo.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static OperationStatusExtendedInfo fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusExtendedInfo deserializedOperationStatusExtendedInfo = new OperationStatusExtendedInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedOperationStatusExtendedInfo.objectType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusExtendedInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusJobExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusJobExtendedInfo.java new file mode 100644 index 000000000000..8da1949d48b9 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusJobExtendedInfo.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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; + +/** + * Operation status job extended info. + */ +@Immutable +public final class OperationStatusJobExtendedInfo extends OperationStatusExtendedInfo { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "OperationStatusJobExtendedInfo"; + + /* + * ID of the job created for this protected item. + */ + private String jobId; + + /** + * Creates an instance of OperationStatusJobExtendedInfo class. + */ + private OperationStatusJobExtendedInfo() { + } + + /** + * 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 jobId property: ID of the job created for this protected item. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + jsonWriter.writeStringField("jobId", this.jobId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusJobExtendedInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusJobExtendedInfo 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 OperationStatusJobExtendedInfo. + */ + public static OperationStatusJobExtendedInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusJobExtendedInfo deserializedOperationStatusJobExtendedInfo + = new OperationStatusJobExtendedInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedOperationStatusJobExtendedInfo.objectType = reader.getString(); + } else if ("jobId".equals(fieldName)) { + deserializedOperationStatusJobExtendedInfo.jobId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusJobExtendedInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusJobsExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusJobsExtendedInfo.java new file mode 100644 index 000000000000..5d847daf297f --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusJobsExtendedInfo.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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; +import java.util.Map; + +/** + * Operation status extended info for list of jobs. + */ +@Immutable +public final class OperationStatusJobsExtendedInfo extends OperationStatusExtendedInfo { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "OperationStatusJobsExtendedInfo"; + + /* + * IDs of the jobs created for the protected item. + */ + private List jobIds; + + /* + * Stores all the failed jobs along with the corresponding error codes. + */ + private Map failedJobsError; + + /** + * Creates an instance of OperationStatusJobsExtendedInfo class. + */ + private OperationStatusJobsExtendedInfo() { + } + + /** + * 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 jobIds property: IDs of the jobs created for the protected item. + * + * @return the jobIds value. + */ + public List jobIds() { + return this.jobIds; + } + + /** + * Get the failedJobsError property: Stores all the failed jobs along with the corresponding error codes. + * + * @return the failedJobsError value. + */ + public Map failedJobsError() { + return this.failedJobsError; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + jsonWriter.writeArrayField("jobIds", this.jobIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("failedJobsError", this.failedJobsError, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusJobsExtendedInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusJobsExtendedInfo 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 OperationStatusJobsExtendedInfo. + */ + public static OperationStatusJobsExtendedInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusJobsExtendedInfo deserializedOperationStatusJobsExtendedInfo + = new OperationStatusJobsExtendedInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedOperationStatusJobsExtendedInfo.objectType = reader.getString(); + } else if ("jobIds".equals(fieldName)) { + List jobIds = reader.readArray(reader1 -> reader1.getString()); + deserializedOperationStatusJobsExtendedInfo.jobIds = jobIds; + } else if ("failedJobsError".equals(fieldName)) { + Map failedJobsError = reader.readMap(reader1 -> reader1.getString()); + deserializedOperationStatusJobsExtendedInfo.failedJobsError = failedJobsError; + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusJobsExtendedInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusProvisionILRExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusProvisionILRExtendedInfo.java new file mode 100644 index 000000000000..0daf93e34813 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusProvisionILRExtendedInfo.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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; + +/** + * Operation status extended info for ILR provision action. + */ +@Immutable +public final class OperationStatusProvisionILRExtendedInfo extends OperationStatusExtendedInfo { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "OperationStatusProvisionILRExtendedInfo"; + + /* + * Target details for file / folder restore. + */ + private InstantItemRecoveryTarget recoveryTarget; + + /** + * Creates an instance of OperationStatusProvisionILRExtendedInfo class. + */ + private OperationStatusProvisionILRExtendedInfo() { + } + + /** + * 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 recoveryTarget property: Target details for file / folder restore. + * + * @return the recoveryTarget value. + */ + public InstantItemRecoveryTarget recoveryTarget() { + return this.recoveryTarget; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + jsonWriter.writeJsonField("recoveryTarget", this.recoveryTarget); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusProvisionILRExtendedInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusProvisionILRExtendedInfo 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 OperationStatusProvisionILRExtendedInfo. + */ + public static OperationStatusProvisionILRExtendedInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusProvisionILRExtendedInfo deserializedOperationStatusProvisionILRExtendedInfo + = new OperationStatusProvisionILRExtendedInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedOperationStatusProvisionILRExtendedInfo.objectType = reader.getString(); + } else if ("recoveryTarget".equals(fieldName)) { + deserializedOperationStatusProvisionILRExtendedInfo.recoveryTarget + = InstantItemRecoveryTarget.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusProvisionILRExtendedInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusRecoveryPointExtendedInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusRecoveryPointExtendedInfo.java new file mode 100644 index 000000000000..ce43e464703a --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusRecoveryPointExtendedInfo.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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; + +/** + * Operation status extended info for Updated Recovery Point. + */ +@Immutable +public final class OperationStatusRecoveryPointExtendedInfo extends OperationStatusExtendedInfo { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "OperationStatusRecoveryPointExtendedInfo"; + + /* + * Recovery Point info with updated source snapshot URI + */ + private RecoveryPoint updatedRecoveryPoint; + + /* + * In case the share is in soft-deleted state, populate this field with deleted backup item + */ + private String deletedBackupItemVersion; + + /** + * Creates an instance of OperationStatusRecoveryPointExtendedInfo class. + */ + private OperationStatusRecoveryPointExtendedInfo() { + } + + /** + * 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 updatedRecoveryPoint property: Recovery Point info with updated source snapshot URI. + * + * @return the updatedRecoveryPoint value. + */ + public RecoveryPoint updatedRecoveryPoint() { + return this.updatedRecoveryPoint; + } + + /** + * Get the deletedBackupItemVersion property: In case the share is in soft-deleted state, populate this field with + * deleted backup item. + * + * @return the deletedBackupItemVersion value. + */ + public String deletedBackupItemVersion() { + return this.deletedBackupItemVersion; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + jsonWriter.writeJsonField("updatedRecoveryPoint", this.updatedRecoveryPoint); + jsonWriter.writeStringField("deletedBackupItemVersion", this.deletedBackupItemVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusRecoveryPointExtendedInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusRecoveryPointExtendedInfo 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 OperationStatusRecoveryPointExtendedInfo. + */ + public static OperationStatusRecoveryPointExtendedInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusRecoveryPointExtendedInfo deserializedOperationStatusRecoveryPointExtendedInfo + = new OperationStatusRecoveryPointExtendedInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedOperationStatusRecoveryPointExtendedInfo.objectType = reader.getString(); + } else if ("updatedRecoveryPoint".equals(fieldName)) { + deserializedOperationStatusRecoveryPointExtendedInfo.updatedRecoveryPoint + = RecoveryPoint.fromJson(reader); + } else if ("deletedBackupItemVersion".equals(fieldName)) { + deserializedOperationStatusRecoveryPointExtendedInfo.deletedBackupItemVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusRecoveryPointExtendedInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusValues.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusValues.java new file mode 100644 index 000000000000..737f5fca9628 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusValues.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Operation status. + */ +public final class OperationStatusValues extends ExpandableStringEnum { + /** + * Static value Invalid for OperationStatusValues. + */ + public static final OperationStatusValues INVALID = fromString("Invalid"); + + /** + * Static value InProgress for OperationStatusValues. + */ + public static final OperationStatusValues IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Succeeded for OperationStatusValues. + */ + public static final OperationStatusValues SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for OperationStatusValues. + */ + public static final OperationStatusValues FAILED = fromString("Failed"); + + /** + * Static value Canceled for OperationStatusValues. + */ + public static final OperationStatusValues CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of OperationStatusValues value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperationStatusValues() { + } + + /** + * Creates or finds a OperationStatusValues from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationStatusValues. + */ + public static OperationStatusValues fromString(String name) { + return fromString(name, OperationStatusValues.class); + } + + /** + * Gets known OperationStatusValues values. + * + * @return known OperationStatusValues values. + */ + public static Collection values() { + return values(OperationStatusValues.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OverwriteOptions.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OverwriteOptions.java new file mode 100644 index 000000000000..90839b988a53 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OverwriteOptions.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Can Overwrite if Target DataBase already exists. + */ +public final class OverwriteOptions extends ExpandableStringEnum { + /** + * Static value Invalid for OverwriteOptions. + */ + public static final OverwriteOptions INVALID = fromString("Invalid"); + + /** + * Static value FailOnConflict for OverwriteOptions. + */ + public static final OverwriteOptions FAIL_ON_CONFLICT = fromString("FailOnConflict"); + + /** + * Static value Overwrite for OverwriteOptions. + */ + public static final OverwriteOptions OVERWRITE = fromString("Overwrite"); + + /** + * Creates a new instance of OverwriteOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OverwriteOptions() { + } + + /** + * Creates or finds a OverwriteOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding OverwriteOptions. + */ + public static OverwriteOptions fromString(String name) { + return fromString(name, OverwriteOptions.class); + } + + /** + * Gets known OverwriteOptions values. + * + * @return known OverwriteOptions values. + */ + public static Collection values() { + return values(OverwriteOptions.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/PointInTimeRange.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/PointInTimeRange.java new file mode 100644 index 000000000000..084d7e646b23 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/PointInTimeRange.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Provides details for log ranges. + */ +@Immutable +public final class PointInTimeRange implements JsonSerializable { + /* + * Start time of the time range for log recovery. + */ + private OffsetDateTime startTime; + + /* + * End time of the time range for log recovery. + */ + private OffsetDateTime endTime; + + /** + * Creates an instance of PointInTimeRange class. + */ + private PointInTimeRange() { + } + + /** + * Get the startTime property: Start time of the time range for log recovery. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: End time of the time range for log recovery. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PointInTimeRange from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PointInTimeRange 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 PointInTimeRange. + */ + public static PointInTimeRange fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PointInTimeRange deserializedPointInTimeRange = new PointInTimeRange(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTime".equals(fieldName)) { + deserializedPointInTimeRange.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedPointInTimeRange.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedPointInTimeRange; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItem.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItem.java new file mode 100644 index 000000000000..b66cc0f4e098 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItem.java @@ -0,0 +1,540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Base class for backup items. + */ +@Immutable +public class ProtectedItem implements JsonSerializable { + /* + * backup item type. + */ + private String protectedItemType = "ProtectedItem"; + + /* + * Type of backup management for the backed up item. + */ + private BackupManagementType backupManagementType; + + /* + * Type of workload this item represents. + */ + private DataSourceType workloadType; + + /* + * Unique name of container + */ + private String containerName; + + /* + * ARM ID of the resource to be backed up. + */ + private String sourceResourceId; + + /* + * ID of the backup policy with which this item is backed up. + */ + private String policyId; + + /* + * Timestamp when the last (latest) backup copy was created for this backup item. + */ + private OffsetDateTime lastRecoveryPoint; + + /* + * Name of the backup set the backup item belongs to + */ + private String backupSetName; + + /* + * Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + */ + private CreateMode createMode; + + /* + * Time for deferred deletion in UTC + */ + private OffsetDateTime deferredDeleteTimeInUTC; + + /* + * Flag to identify whether the DS is scheduled for deferred delete + */ + private Boolean isScheduledForDeferredDelete; + + /* + * Time remaining before the DS marked for deferred delete is permanently deleted + */ + private String deferredDeleteTimeRemaining; + + /* + * Flag to identify whether the deferred deleted DS is to be purged soon + */ + private Boolean isDeferredDeleteScheduleUpcoming; + + /* + * Flag to identify that deferred deleted DS is to be moved into Pause state + */ + private Boolean isRehydrate; + + /* + * ResourceGuardOperationRequests on which LAC check will be performed + */ + private List resourceGuardOperationRequests; + + /** + * Creates an instance of ProtectedItem class. + */ + protected ProtectedItem() { + } + + /** + * Get the protectedItemType property: backup item type. + * + * @return the protectedItemType value. + */ + public String protectedItemType() { + return this.protectedItemType; + } + + /** + * Get the backupManagementType property: Type of backup management for the backed up item. + * + * @return the backupManagementType value. + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backupManagementType property: Type of backup management for the backed up item. + * + * @param backupManagementType the backupManagementType value to set. + * @return the ProtectedItem object itself. + */ + ProtectedItem withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the workloadType property: Type of workload this item represents. + * + * @return the workloadType value. + */ + public DataSourceType workloadType() { + return this.workloadType; + } + + /** + * Set the workloadType property: Type of workload this item represents. + * + * @param workloadType the workloadType value to set. + * @return the ProtectedItem object itself. + */ + ProtectedItem withWorkloadType(DataSourceType workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get the containerName property: Unique name of container. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Unique name of container. + * + * @param containerName the containerName value to set. + * @return the ProtectedItem object itself. + */ + ProtectedItem withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the sourceResourceId property: ARM ID of the resource to be backed up. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: ARM ID of the resource to be backed up. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the ProtectedItem object itself. + */ + ProtectedItem withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the policyId property: ID of the backup policy with which this item is backed up. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: ID of the backup policy with which this item is backed up. + * + * @param policyId the policyId value to set. + * @return the ProtectedItem object itself. + */ + ProtectedItem withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Get the lastRecoveryPoint property: Timestamp when the last (latest) backup copy was created for this backup + * item. + * + * @return the lastRecoveryPoint value. + */ + public OffsetDateTime lastRecoveryPoint() { + return this.lastRecoveryPoint; + } + + /** + * Set the lastRecoveryPoint property: Timestamp when the last (latest) backup copy was created for this backup + * item. + * + * @param lastRecoveryPoint the lastRecoveryPoint value to set. + * @return the ProtectedItem object itself. + */ + ProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + this.lastRecoveryPoint = lastRecoveryPoint; + return this; + } + + /** + * Get the backupSetName property: Name of the backup set the backup item belongs to. + * + * @return the backupSetName value. + */ + public String backupSetName() { + return this.backupSetName; + } + + /** + * Set the backupSetName property: Name of the backup set the backup item belongs to. + * + * @param backupSetName the backupSetName value to set. + * @return the ProtectedItem object itself. + */ + ProtectedItem withBackupSetName(String backupSetName) { + this.backupSetName = backupSetName; + return this; + } + + /** + * Get the createMode property: Create mode to indicate recovery of existing soft deleted data source or creation of + * new data source. + * + * @return the createMode value. + */ + public CreateMode createMode() { + return this.createMode; + } + + /** + * Set the createMode property: Create mode to indicate recovery of existing soft deleted data source or creation of + * new data source. + * + * @param createMode the createMode value to set. + * @return the ProtectedItem object itself. + */ + ProtectedItem withCreateMode(CreateMode createMode) { + this.createMode = createMode; + return this; + } + + /** + * Get the deferredDeleteTimeInUTC property: Time for deferred deletion in UTC. + * + * @return the deferredDeleteTimeInUTC value. + */ + public OffsetDateTime deferredDeleteTimeInUTC() { + return this.deferredDeleteTimeInUTC; + } + + /** + * Set the deferredDeleteTimeInUTC property: Time for deferred deletion in UTC. + * + * @param deferredDeleteTimeInUTC the deferredDeleteTimeInUTC value to set. + * @return the ProtectedItem object itself. + */ + ProtectedItem withDeferredDeleteTimeInUTC(OffsetDateTime deferredDeleteTimeInUTC) { + this.deferredDeleteTimeInUTC = deferredDeleteTimeInUTC; + return this; + } + + /** + * Get the isScheduledForDeferredDelete property: Flag to identify whether the DS is scheduled for deferred delete. + * + * @return the isScheduledForDeferredDelete value. + */ + public Boolean isScheduledForDeferredDelete() { + return this.isScheduledForDeferredDelete; + } + + /** + * Set the isScheduledForDeferredDelete property: Flag to identify whether the DS is scheduled for deferred delete. + * + * @param isScheduledForDeferredDelete the isScheduledForDeferredDelete value to set. + * @return the ProtectedItem object itself. + */ + ProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { + this.isScheduledForDeferredDelete = isScheduledForDeferredDelete; + return this; + } + + /** + * Get the deferredDeleteTimeRemaining property: Time remaining before the DS marked for deferred delete is + * permanently deleted. + * + * @return the deferredDeleteTimeRemaining value. + */ + public String deferredDeleteTimeRemaining() { + return this.deferredDeleteTimeRemaining; + } + + /** + * Set the deferredDeleteTimeRemaining property: Time remaining before the DS marked for deferred delete is + * permanently deleted. + * + * @param deferredDeleteTimeRemaining the deferredDeleteTimeRemaining value to set. + * @return the ProtectedItem object itself. + */ + ProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { + this.deferredDeleteTimeRemaining = deferredDeleteTimeRemaining; + return this; + } + + /** + * Get the isDeferredDeleteScheduleUpcoming property: Flag to identify whether the deferred deleted DS is to be + * purged soon. + * + * @return the isDeferredDeleteScheduleUpcoming value. + */ + public Boolean isDeferredDeleteScheduleUpcoming() { + return this.isDeferredDeleteScheduleUpcoming; + } + + /** + * Set the isDeferredDeleteScheduleUpcoming property: Flag to identify whether the deferred deleted DS is to be + * purged soon. + * + * @param isDeferredDeleteScheduleUpcoming the isDeferredDeleteScheduleUpcoming value to set. + * @return the ProtectedItem object itself. + */ + ProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { + this.isDeferredDeleteScheduleUpcoming = isDeferredDeleteScheduleUpcoming; + return this; + } + + /** + * Get the isRehydrate property: Flag to identify that deferred deleted DS is to be moved into Pause state. + * + * @return the isRehydrate value. + */ + public Boolean isRehydrate() { + return this.isRehydrate; + } + + /** + * Set the isRehydrate property: Flag to identify that deferred deleted DS is to be moved into Pause state. + * + * @param isRehydrate the isRehydrate value to set. + * @return the ProtectedItem object itself. + */ + ProtectedItem withIsRehydrate(Boolean isRehydrate) { + this.isRehydrate = isRehydrate; + return this; + } + + /** + * Get the resourceGuardOperationRequests property: ResourceGuardOperationRequests on which LAC check will be + * performed. + * + * @return the resourceGuardOperationRequests value. + */ + public List resourceGuardOperationRequests() { + return this.resourceGuardOperationRequests; + } + + /** + * Set the resourceGuardOperationRequests property: ResourceGuardOperationRequests on which LAC check will be + * performed. + * + * @param resourceGuardOperationRequests the resourceGuardOperationRequests value to set. + * @return the ProtectedItem object itself. + */ + ProtectedItem withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + this.resourceGuardOperationRequests = resourceGuardOperationRequests; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protectedItemType", this.protectedItemType); + jsonWriter.writeStringField("backupManagementType", + this.backupManagementType == null ? null : this.backupManagementType.toString()); + jsonWriter.writeStringField("workloadType", this.workloadType == null ? null : this.workloadType.toString()); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); + jsonWriter.writeStringField("policyId", this.policyId); + jsonWriter.writeStringField("lastRecoveryPoint", + this.lastRecoveryPoint == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastRecoveryPoint)); + jsonWriter.writeStringField("backupSetName", this.backupSetName); + jsonWriter.writeStringField("createMode", this.createMode == null ? null : this.createMode.toString()); + jsonWriter.writeStringField("deferredDeleteTimeInUTC", + this.deferredDeleteTimeInUTC == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.deferredDeleteTimeInUTC)); + jsonWriter.writeBooleanField("isScheduledForDeferredDelete", this.isScheduledForDeferredDelete); + jsonWriter.writeStringField("deferredDeleteTimeRemaining", this.deferredDeleteTimeRemaining); + jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", this.isDeferredDeleteScheduleUpcoming); + jsonWriter.writeBooleanField("isRehydrate", this.isRehydrate); + jsonWriter.writeArrayField("resourceGuardOperationRequests", this.resourceGuardOperationRequests, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProtectedItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProtectedItem 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 ProtectedItem. + */ + public static ProtectedItem 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 ("AzureFileShareProtectedItem".equals(discriminatorValue)) { + return AzureFileshareProtectedItem.fromJson(readerToUse.reset()); + } else if ("AzureIaaSVMProtectedItem".equals(discriminatorValue)) { + return AzureIaaSVMProtectedItem.fromJsonKnownDiscriminator(readerToUse.reset()); + } else if ("Microsoft.Compute/virtualMachines".equals(discriminatorValue)) { + return AzureIaaSComputeVMProtectedItem.fromJson(readerToUse.reset()); + } else if ("Microsoft.ClassicCompute/virtualMachines".equals(discriminatorValue)) { + return AzureIaaSClassicComputeVMProtectedItem.fromJson(readerToUse.reset()); + } else if ("Microsoft.Sql/servers/databases".equals(discriminatorValue)) { + return AzureSqlProtectedItem.fromJson(readerToUse.reset()); + } else if ("AzureVmWorkloadProtectedItem".equals(discriminatorValue)) { + return AzureVmWorkloadProtectedItem.fromJsonKnownDiscriminator(readerToUse.reset()); + } else if ("AzureVmWorkloadSAPAseDatabase".equals(discriminatorValue)) { + return AzureVmWorkloadSAPAseDatabaseProtectedItem.fromJson(readerToUse.reset()); + } else if ("AzureVmWorkloadSAPHanaDatabase".equals(discriminatorValue)) { + return AzureVmWorkloadSAPHanaDatabaseProtectedItem.fromJson(readerToUse.reset()); + } else if ("AzureVmWorkloadSQLDatabase".equals(discriminatorValue)) { + return AzureVmWorkloadSQLDatabaseProtectedItem.fromJson(readerToUse.reset()); + } else if ("DPMProtectedItem".equals(discriminatorValue)) { + return DPMProtectedItem.fromJson(readerToUse.reset()); + } else if ("GenericProtectedItem".equals(discriminatorValue)) { + return GenericProtectedItem.fromJson(readerToUse.reset()); + } else if ("MabFileFolderProtectedItem".equals(discriminatorValue)) { + return MabFileFolderProtectedItem.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ProtectedItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProtectedItem deserializedProtectedItem = new ProtectedItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protectedItemType".equals(fieldName)) { + deserializedProtectedItem.protectedItemType = reader.getString(); + } else if ("backupManagementType".equals(fieldName)) { + deserializedProtectedItem.backupManagementType + = BackupManagementType.fromString(reader.getString()); + } else if ("workloadType".equals(fieldName)) { + deserializedProtectedItem.workloadType = DataSourceType.fromString(reader.getString()); + } else if ("containerName".equals(fieldName)) { + deserializedProtectedItem.containerName = reader.getString(); + } else if ("sourceResourceId".equals(fieldName)) { + deserializedProtectedItem.sourceResourceId = reader.getString(); + } else if ("policyId".equals(fieldName)) { + deserializedProtectedItem.policyId = reader.getString(); + } else if ("lastRecoveryPoint".equals(fieldName)) { + deserializedProtectedItem.lastRecoveryPoint = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("backupSetName".equals(fieldName)) { + deserializedProtectedItem.backupSetName = reader.getString(); + } else if ("createMode".equals(fieldName)) { + deserializedProtectedItem.createMode = CreateMode.fromString(reader.getString()); + } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { + deserializedProtectedItem.deferredDeleteTimeInUTC = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("isScheduledForDeferredDelete".equals(fieldName)) { + deserializedProtectedItem.isScheduledForDeferredDelete = reader.getNullable(JsonReader::getBoolean); + } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { + deserializedProtectedItem.deferredDeleteTimeRemaining = reader.getString(); + } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { + deserializedProtectedItem.isDeferredDeleteScheduleUpcoming + = reader.getNullable(JsonReader::getBoolean); + } else if ("isRehydrate".equals(fieldName)) { + deserializedProtectedItem.isRehydrate = reader.getNullable(JsonReader::getBoolean); + } else if ("resourceGuardOperationRequests".equals(fieldName)) { + List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); + deserializedProtectedItem.resourceGuardOperationRequests = resourceGuardOperationRequests; + } else { + reader.skipChildren(); + } + } + + return deserializedProtectedItem; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemHealthStatus.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemHealthStatus.java new file mode 100644 index 000000000000..be6ee49c80b0 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemHealthStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Health status of the backup item, evaluated based on last heartbeat received. + */ +public final class ProtectedItemHealthStatus extends ExpandableStringEnum { + /** + * Static value Invalid for ProtectedItemHealthStatus. + */ + public static final ProtectedItemHealthStatus INVALID = fromString("Invalid"); + + /** + * Static value Healthy for ProtectedItemHealthStatus. + */ + public static final ProtectedItemHealthStatus HEALTHY = fromString("Healthy"); + + /** + * Static value Unhealthy for ProtectedItemHealthStatus. + */ + public static final ProtectedItemHealthStatus UNHEALTHY = fromString("Unhealthy"); + + /** + * Static value NotReachable for ProtectedItemHealthStatus. + */ + public static final ProtectedItemHealthStatus NOT_REACHABLE = fromString("NotReachable"); + + /** + * Static value IRPending for ProtectedItemHealthStatus. + */ + public static final ProtectedItemHealthStatus IRPENDING = fromString("IRPending"); + + /** + * Creates a new instance of ProtectedItemHealthStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProtectedItemHealthStatus() { + } + + /** + * Creates or finds a ProtectedItemHealthStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtectedItemHealthStatus. + */ + public static ProtectedItemHealthStatus fromString(String name) { + return fromString(name, ProtectedItemHealthStatus.class); + } + + /** + * Gets known ProtectedItemHealthStatus values. + * + * @return known ProtectedItemHealthStatus values. + */ + public static Collection values() { + return values(ProtectedItemHealthStatus.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemResource.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemResource.java new file mode 100644 index 000000000000..ae299f3a5355 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemResource.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Base class for backup items. + */ +@Immutable +public final class ProtectedItemResource extends Resource { + /* + * ProtectedItemResource properties + */ + private ProtectedItem properties; + + /* + * Optional 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 ProtectedItemResource class. + */ + private ProtectedItemResource() { + } + + /** + * Get the properties property: ProtectedItemResource properties. + * + * @return the properties value. + */ + public ProtectedItem properties() { + return this.properties; + } + + /** + * Get the eTag property: Optional ETag. + * + * @return the eTag value. + */ + public String eTag() { + return this.eTag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public 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 ProtectedItemResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProtectedItemResource 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 ProtectedItemResource. + */ + public static ProtectedItemResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProtectedItemResource deserializedProtectedItemResource = new ProtectedItemResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedProtectedItemResource.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedProtectedItemResource.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProtectedItemResource.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedProtectedItemResource.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedProtectedItemResource.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedProtectedItemResource.properties = ProtectedItem.fromJson(reader); + } else if ("eTag".equals(fieldName)) { + deserializedProtectedItemResource.eTag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProtectedItemResource; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemResourceList.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemResourceList.java new file mode 100644 index 000000000000..fa973b234b48 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemResourceList.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.ProtectedItemResourceListInner; +import java.util.List; + +/** + * An immutable client-side representation of ProtectedItemResourceList. + */ +public interface ProtectedItemResourceList { + /** + * Gets the nextLink property: The uri to fetch the next page of resources. Call ListNext() fetches next page of + * resources. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the value property: List of resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.ProtectedItemResourceListInner + * object. + * + * @return the inner object. + */ + ProtectedItemResourceListInner innerModel(); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemState.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemState.java new file mode 100644 index 000000000000..76cde7eb9add --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Backup state of the backed up item. + */ +public final class ProtectedItemState extends ExpandableStringEnum { + /** + * Static value Invalid for ProtectedItemState. + */ + public static final ProtectedItemState INVALID = fromString("Invalid"); + + /** + * Static value IRPending for ProtectedItemState. + */ + public static final ProtectedItemState IRPENDING = fromString("IRPending"); + + /** + * Static value Protected for ProtectedItemState. + */ + public static final ProtectedItemState PROTECTED = fromString("Protected"); + + /** + * Static value ProtectionError for ProtectedItemState. + */ + public static final ProtectedItemState PROTECTION_ERROR = fromString("ProtectionError"); + + /** + * Static value ProtectionStopped for ProtectedItemState. + */ + public static final ProtectedItemState PROTECTION_STOPPED = fromString("ProtectionStopped"); + + /** + * Static value ProtectionPaused for ProtectedItemState. + */ + public static final ProtectedItemState PROTECTION_PAUSED = fromString("ProtectionPaused"); + + /** + * Creates a new instance of ProtectedItemState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProtectedItemState() { + } + + /** + * Creates or finds a ProtectedItemState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtectedItemState. + */ + public static ProtectedItemState fromString(String name) { + return fromString(name, ProtectedItemState.class); + } + + /** + * Gets known ProtectedItemState values. + * + * @return known ProtectedItemState values. + */ + public static Collection values() { + return values(ProtectedItemState.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectionState.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectionState.java new file mode 100644 index 000000000000..968ae05ef807 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectionState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Backup state of this backup item. + */ +public final class ProtectionState extends ExpandableStringEnum { + /** + * Static value Invalid for ProtectionState. + */ + public static final ProtectionState INVALID = fromString("Invalid"); + + /** + * Static value IRPending for ProtectionState. + */ + public static final ProtectionState IRPENDING = fromString("IRPending"); + + /** + * Static value Protected for ProtectionState. + */ + public static final ProtectionState PROTECTED = fromString("Protected"); + + /** + * Static value ProtectionError for ProtectionState. + */ + public static final ProtectionState PROTECTION_ERROR = fromString("ProtectionError"); + + /** + * Static value ProtectionStopped for ProtectionState. + */ + public static final ProtectionState PROTECTION_STOPPED = fromString("ProtectionStopped"); + + /** + * Static value ProtectionPaused for ProtectionState. + */ + public static final ProtectionState PROTECTION_PAUSED = fromString("ProtectionPaused"); + + /** + * Creates a new instance of ProtectionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProtectionState() { + } + + /** + * Creates or finds a ProtectionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtectionState. + */ + public static ProtectionState fromString(String name) { + return fromString(name, ProtectionState.class); + } + + /** + * Gets known ProtectionState values. + * + * @return known ProtectionState values. + */ + public static Collection values() { + return values(ProtectionState.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryMode.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryMode.java new file mode 100644 index 000000000000..50b5f991899b --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines whether the current recovery mode is file restore or database restore. + */ +public final class RecoveryMode extends ExpandableStringEnum { + /** + * Static value Invalid for RecoveryMode. + */ + public static final RecoveryMode INVALID = fromString("Invalid"); + + /** + * Static value FileRecovery for RecoveryMode. + */ + public static final RecoveryMode FILE_RECOVERY = fromString("FileRecovery"); + + /** + * Static value WorkloadRecovery for RecoveryMode. + */ + public static final RecoveryMode WORKLOAD_RECOVERY = fromString("WorkloadRecovery"); + + /** + * Creates a new instance of RecoveryMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecoveryMode() { + } + + /** + * Creates or finds a RecoveryMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryMode. + */ + public static RecoveryMode fromString(String name) { + return fromString(name, RecoveryMode.class); + } + + /** + * Gets known RecoveryMode values. + * + * @return known RecoveryMode values. + */ + public static Collection values() { + return values(RecoveryMode.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPoint.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPoint.java new file mode 100644 index 000000000000..62d00d92055a --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPoint.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base class for backup copies. Workload-specific backup copies are derived from this class. + */ +@Immutable +public class RecoveryPoint implements JsonSerializable { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "RecoveryPoint"; + + /** + * Creates an instance of RecoveryPoint class. + */ + protected RecoveryPoint() { + } + + /** + * 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. + */ + public String objectType() { + return this.objectType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryPoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryPoint 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 RecoveryPoint. + */ + public static RecoveryPoint 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 ("AzureFileShareRecoveryPoint".equals(discriminatorValue)) { + return AzureFileShareRecoveryPoint.fromJson(readerToUse.reset()); + } else if ("AzureWorkloadRecoveryPoint".equals(discriminatorValue)) { + return AzureWorkloadRecoveryPoint.fromJsonKnownDiscriminator(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 if ("AzureWorkloadPointInTimeRecoveryPoint".equals(discriminatorValue)) { + return AzureWorkloadPointInTimeRecoveryPoint.fromJsonKnownDiscriminator(readerToUse.reset()); + } else if ("AzureWorkloadSAPHanaPointInTimeRecoveryPoint".equals(discriminatorValue)) { + return AzureWorkloadSAPHanaPointInTimeRecoveryPoint.fromJson(readerToUse.reset()); + } else if ("GenericRecoveryPoint".equals(discriminatorValue)) { + return GenericRecoveryPoint.fromJson(readerToUse.reset()); + } else if ("IaasVMRecoveryPoint".equals(discriminatorValue)) { + return IaasVMRecoveryPoint.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static RecoveryPoint fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryPoint deserializedRecoveryPoint = new RecoveryPoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedRecoveryPoint.objectType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPoint; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointDiskConfiguration.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointDiskConfiguration.java new file mode 100644 index 000000000000..d471daac93d4 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointDiskConfiguration.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Disk configuration. + */ +@Immutable +public final class RecoveryPointDiskConfiguration implements JsonSerializable { + /* + * Number of disks included in backup + */ + private Integer numberOfDisksIncludedInBackup; + + /* + * Number of disks attached to the VM + */ + private Integer numberOfDisksAttachedToVm; + + /* + * Information of disks included in backup + */ + private List includedDiskList; + + /* + * Information of disks excluded from backup + */ + private List excludedDiskList; + + /** + * Creates an instance of RecoveryPointDiskConfiguration class. + */ + private RecoveryPointDiskConfiguration() { + } + + /** + * Get the numberOfDisksIncludedInBackup property: Number of disks included in backup. + * + * @return the numberOfDisksIncludedInBackup value. + */ + public Integer numberOfDisksIncludedInBackup() { + return this.numberOfDisksIncludedInBackup; + } + + /** + * Get the numberOfDisksAttachedToVm property: Number of disks attached to the VM. + * + * @return the numberOfDisksAttachedToVm value. + */ + public Integer numberOfDisksAttachedToVm() { + return this.numberOfDisksAttachedToVm; + } + + /** + * Get the includedDiskList property: Information of disks included in backup. + * + * @return the includedDiskList value. + */ + public List includedDiskList() { + return this.includedDiskList; + } + + /** + * Get the excludedDiskList property: Information of disks excluded from backup. + * + * @return the excludedDiskList value. + */ + public List excludedDiskList() { + return this.excludedDiskList; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("numberOfDisksIncludedInBackup", this.numberOfDisksIncludedInBackup); + jsonWriter.writeNumberField("numberOfDisksAttachedToVm", this.numberOfDisksAttachedToVm); + jsonWriter.writeArrayField("includedDiskList", this.includedDiskList, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("excludedDiskList", this.excludedDiskList, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryPointDiskConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryPointDiskConfiguration 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 RecoveryPointDiskConfiguration. + */ + public static RecoveryPointDiskConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryPointDiskConfiguration deserializedRecoveryPointDiskConfiguration + = new RecoveryPointDiskConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("numberOfDisksIncludedInBackup".equals(fieldName)) { + deserializedRecoveryPointDiskConfiguration.numberOfDisksIncludedInBackup + = reader.getNullable(JsonReader::getInt); + } else if ("numberOfDisksAttachedToVm".equals(fieldName)) { + deserializedRecoveryPointDiskConfiguration.numberOfDisksAttachedToVm + = reader.getNullable(JsonReader::getInt); + } else if ("includedDiskList".equals(fieldName)) { + List includedDiskList + = reader.readArray(reader1 -> DiskInformation.fromJson(reader1)); + deserializedRecoveryPointDiskConfiguration.includedDiskList = includedDiskList; + } else if ("excludedDiskList".equals(fieldName)) { + List excludedDiskList + = reader.readArray(reader1 -> DiskInformation.fromJson(reader1)); + deserializedRecoveryPointDiskConfiguration.excludedDiskList = excludedDiskList; + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPointDiskConfiguration; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointMoveReadinessInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointMoveReadinessInfo.java new file mode 100644 index 000000000000..8341a53f9881 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointMoveReadinessInfo.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The RecoveryPointMoveReadinessInfo model. + */ +@Immutable +public final class RecoveryPointMoveReadinessInfo implements JsonSerializable { + /* + * The isReadyForMove property. + */ + private Boolean isReadyForMove; + + /* + * The additionalInfo property. + */ + private String additionalInfo; + + /** + * Creates an instance of RecoveryPointMoveReadinessInfo class. + */ + private RecoveryPointMoveReadinessInfo() { + } + + /** + * Get the isReadyForMove property: The isReadyForMove property. + * + * @return the isReadyForMove value. + */ + public Boolean isReadyForMove() { + return this.isReadyForMove; + } + + /** + * Get the additionalInfo property: The additionalInfo property. + * + * @return the additionalInfo value. + */ + public String additionalInfo() { + return this.additionalInfo; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isReadyForMove", this.isReadyForMove); + jsonWriter.writeStringField("additionalInfo", this.additionalInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryPointMoveReadinessInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryPointMoveReadinessInfo 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 RecoveryPointMoveReadinessInfo. + */ + public static RecoveryPointMoveReadinessInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryPointMoveReadinessInfo deserializedRecoveryPointMoveReadinessInfo + = new RecoveryPointMoveReadinessInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isReadyForMove".equals(fieldName)) { + deserializedRecoveryPointMoveReadinessInfo.isReadyForMove + = reader.getNullable(JsonReader::getBoolean); + } else if ("additionalInfo".equals(fieldName)) { + deserializedRecoveryPointMoveReadinessInfo.additionalInfo = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPointMoveReadinessInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointProperties.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointProperties.java new file mode 100644 index 000000000000..e66f438cbb9d --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointProperties.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of Recovery Point. + */ +@Immutable +public final class RecoveryPointProperties implements JsonSerializable { + /* + * Expiry time of Recovery Point in UTC. + */ + private String expiryTime; + + /* + * Rule name tagged on Recovery Point that governs life cycle + */ + private String ruleName; + + /* + * Bool to indicate whether RP is in soft delete state or not + */ + private Boolean isSoftDeleted; + + /** + * Creates an instance of RecoveryPointProperties class. + */ + private RecoveryPointProperties() { + } + + /** + * Get the expiryTime property: Expiry time of Recovery Point in UTC. + * + * @return the expiryTime value. + */ + public String expiryTime() { + return this.expiryTime; + } + + /** + * Get the ruleName property: Rule name tagged on Recovery Point that governs life cycle. + * + * @return the ruleName value. + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Get the isSoftDeleted property: Bool to indicate whether RP is in soft delete state or not. + * + * @return the isSoftDeleted value. + */ + public Boolean isSoftDeleted() { + return this.isSoftDeleted; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expiryTime", this.expiryTime); + jsonWriter.writeStringField("ruleName", this.ruleName); + jsonWriter.writeBooleanField("isSoftDeleted", this.isSoftDeleted); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryPointProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryPointProperties 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 RecoveryPointProperties. + */ + public static RecoveryPointProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryPointProperties deserializedRecoveryPointProperties = new RecoveryPointProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expiryTime".equals(fieldName)) { + deserializedRecoveryPointProperties.expiryTime = reader.getString(); + } else if ("ruleName".equals(fieldName)) { + deserializedRecoveryPointProperties.ruleName = reader.getString(); + } else if ("isSoftDeleted".equals(fieldName)) { + deserializedRecoveryPointProperties.isSoftDeleted = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPointProperties; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointResource.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointResource.java new file mode 100644 index 000000000000..ee3ac04f85f3 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointResource.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.RecoveryPointResourceInner; +import java.util.Map; + +/** + * An immutable client-side representation of RecoveryPointResource. + */ +public interface RecoveryPointResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: RecoveryPointResource properties. + * + * @return the properties value. + */ + RecoveryPoint properties(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the eTag property: Optional ETag. + * + * @return the eTag value. + */ + String eTag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.RecoveryPointResourceInner + * object. + * + * @return the inner object. + */ + RecoveryPointResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierInformation.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierInformation.java new file mode 100644 index 000000000000..4ef735d648d3 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierInformation.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Recovery point tier information. + */ +@Immutable +public final class RecoveryPointTierInformation implements JsonSerializable { + /* + * Recovery point tier type. + */ + private RecoveryPointTierType type; + + /* + * Recovery point tier status. + */ + private RecoveryPointTierStatus status; + + /* + * Recovery point tier status. + */ + private Map extendedInfo; + + /** + * Creates an instance of RecoveryPointTierInformation class. + */ + private RecoveryPointTierInformation() { + } + + /** + * Get the type property: Recovery point tier type. + * + * @return the type value. + */ + public RecoveryPointTierType type() { + return this.type; + } + + /** + * Get the status property: Recovery point tier status. + * + * @return the status value. + */ + public RecoveryPointTierStatus status() { + return this.status; + } + + /** + * Get the extendedInfo property: Recovery point tier status. + * + * @return the extendedInfo value. + */ + public Map extendedInfo() { + return this.extendedInfo; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeMapField("extendedInfo", this.extendedInfo, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryPointTierInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryPointTierInformation 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 RecoveryPointTierInformation. + */ + public static RecoveryPointTierInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryPointTierInformation deserializedRecoveryPointTierInformation = new RecoveryPointTierInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedRecoveryPointTierInformation.type + = RecoveryPointTierType.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedRecoveryPointTierInformation.status + = RecoveryPointTierStatus.fromString(reader.getString()); + } else if ("extendedInfo".equals(fieldName)) { + Map extendedInfo = reader.readMap(reader1 -> reader1.getString()); + deserializedRecoveryPointTierInformation.extendedInfo = extendedInfo; + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPointTierInformation; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierStatus.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierStatus.java new file mode 100644 index 000000000000..8c000cc7b823 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierStatus.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +/** + * Recovery point tier status. + */ +public enum RecoveryPointTierStatus { + /** + * Enum value Invalid. + */ + INVALID("Invalid"), + + /** + * Enum value Valid. + */ + VALID("Valid"), + + /** + * Enum value Disabled. + */ + DISABLED("Disabled"), + + /** + * Enum value Deleted. + */ + DELETED("Deleted"), + + /** + * Enum value Rehydrated. + */ + REHYDRATED("Rehydrated"); + + /** + * The actual serialized value for a RecoveryPointTierStatus instance. + */ + private final String value; + + RecoveryPointTierStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RecoveryPointTierStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed RecoveryPointTierStatus object, or null if unable to parse. + */ + public static RecoveryPointTierStatus fromString(String value) { + if (value == null) { + return null; + } + RecoveryPointTierStatus[] items = RecoveryPointTierStatus.values(); + for (RecoveryPointTierStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierType.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierType.java new file mode 100644 index 000000000000..6cedb93a0ee6 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +/** + * Recovery point tier type. + */ +public enum RecoveryPointTierType { + /** + * Enum value Invalid. + */ + INVALID("Invalid"), + + /** + * Enum value InstantRP. + */ + INSTANT_RP("InstantRP"), + + /** + * Enum value HardenedRP. + */ + HARDENED_RP("HardenedRP"), + + /** + * Enum value ArchivedRP. + */ + ARCHIVED_RP("ArchivedRP"); + + /** + * The actual serialized value for a RecoveryPointTierType instance. + */ + private final String value; + + RecoveryPointTierType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RecoveryPointTierType instance. + * + * @param value the serialized value to parse. + * @return the parsed RecoveryPointTierType object, or null if unable to parse. + */ + public static RecoveryPointTierType fromString(String value) { + if (value == null) { + return null; + } + RecoveryPointTierType[] items = RecoveryPointTierType.values(); + for (RecoveryPointTierType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPoints.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPoints.java new file mode 100644 index 000000000000..109a9b079f75 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPoints.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.AADPropertiesResourceInner; + +/** + * Resource collection API of RecoveryPoints. + */ +public interface RecoveryPoints { + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response getAccessTokenWithResponse(String resourceGroupName, String vaultName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId, + AADPropertiesResourceInner parameters, Context context); + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + CrrAccessTokenResource getAccessToken(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName, String recoveryPointId, AADPropertiesResourceInner parameters); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointsCrrs.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointsCrrs.java new file mode 100644 index 000000000000..b1f2b07ebaee --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointsCrrs.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RecoveryPointsCrrs. + */ +public interface RecoveryPointsCrrs { + /** + * Provides the information of the backed up data identified using 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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName, String recoveryPointId, Context context); + + /** + * Provides the information of the backed up data identified using 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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies. + */ + RecoveryPointResource get(String resourceGroupName, String vaultName, String fabricName, String containerName, + String protectedItemName, String recoveryPointId); + + /** + * Lists the backup copies for the backed up item. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 list of RecoveryPoint resources as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName); + + /** + * Lists the backup copies for the backed up item. + * + * @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 the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param filter OData filter options. + * @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 list of RecoveryPoint resources as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, String fabricName, + String containerName, String protectedItemName, String filter, Context context); +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryType.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryType.java new file mode 100644 index 000000000000..2d65acb0f966 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of this recovery. + */ +public final class RecoveryType extends ExpandableStringEnum { + /** + * Static value Invalid for RecoveryType. + */ + public static final RecoveryType INVALID = fromString("Invalid"); + + /** + * Static value OriginalLocation for RecoveryType. + */ + public static final RecoveryType ORIGINAL_LOCATION = fromString("OriginalLocation"); + + /** + * Static value AlternateLocation for RecoveryType. + */ + public static final RecoveryType ALTERNATE_LOCATION = fromString("AlternateLocation"); + + /** + * Static value RestoreDisks for RecoveryType. + */ + public static final RecoveryType RESTORE_DISKS = fromString("RestoreDisks"); + + /** + * Static value Offline for RecoveryType. + */ + public static final RecoveryType OFFLINE = fromString("Offline"); + + /** + * Creates a new instance of RecoveryType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecoveryType() { + } + + /** + * Creates or finds a RecoveryType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryType. + */ + public static RecoveryType fromString(String name) { + return fromString(name, RecoveryType.class); + } + + /** + * Gets known RecoveryType values. + * + * @return known RecoveryType values. + */ + public static Collection values() { + return values(RecoveryType.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceHealthDetails.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceHealthDetails.java new file mode 100644 index 000000000000..9421c149fb26 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceHealthDetails.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Health Details for backup items. + */ +@Immutable +public class ResourceHealthDetails implements JsonSerializable { + /* + * Health Code + */ + private Integer code; + + /* + * Health Title + */ + private String title; + + /* + * Health Message + */ + private String message; + + /* + * Health Recommended Actions + */ + private List recommendations; + + /** + * Creates an instance of ResourceHealthDetails class. + */ + protected ResourceHealthDetails() { + } + + /** + * Get the code property: Health Code. + * + * @return the code value. + */ + public Integer code() { + return this.code; + } + + /** + * Set the code property: Health Code. + * + * @param code the code value to set. + * @return the ResourceHealthDetails object itself. + */ + ResourceHealthDetails withCode(Integer code) { + this.code = code; + return this; + } + + /** + * Get the title property: Health Title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Health Title. + * + * @param title the title value to set. + * @return the ResourceHealthDetails object itself. + */ + ResourceHealthDetails withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the message property: Health Message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Health Message. + * + * @param message the message value to set. + * @return the ResourceHealthDetails object itself. + */ + ResourceHealthDetails withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the recommendations property: Health Recommended Actions. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Set the recommendations property: Health Recommended Actions. + * + * @param recommendations the recommendations value to set. + * @return the ResourceHealthDetails object itself. + */ + ResourceHealthDetails withRecommendations(List recommendations) { + this.recommendations = recommendations; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceHealthDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceHealthDetails 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 ResourceHealthDetails. + */ + public static ResourceHealthDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceHealthDetails deserializedResourceHealthDetails = new ResourceHealthDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedResourceHealthDetails.code = reader.getNullable(JsonReader::getInt); + } else if ("title".equals(fieldName)) { + deserializedResourceHealthDetails.title = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedResourceHealthDetails.message = reader.getString(); + } else if ("recommendations".equals(fieldName)) { + List recommendations = reader.readArray(reader1 -> reader1.getString()); + deserializedResourceHealthDetails.recommendations = recommendations; + } else { + reader.skipChildren(); + } + } + + return deserializedResourceHealthDetails; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceHealthStatus.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceHealthStatus.java new file mode 100644 index 000000000000..71769e594fa8 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceHealthStatus.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Resource Health Status. + */ +public final class ResourceHealthStatus extends ExpandableStringEnum { + /** + * Static value Healthy for ResourceHealthStatus. + */ + public static final ResourceHealthStatus HEALTHY = fromString("Healthy"); + + /** + * Static value TransientDegraded for ResourceHealthStatus. + */ + public static final ResourceHealthStatus TRANSIENT_DEGRADED = fromString("TransientDegraded"); + + /** + * Static value PersistentDegraded for ResourceHealthStatus. + */ + public static final ResourceHealthStatus PERSISTENT_DEGRADED = fromString("PersistentDegraded"); + + /** + * Static value TransientUnhealthy for ResourceHealthStatus. + */ + public static final ResourceHealthStatus TRANSIENT_UNHEALTHY = fromString("TransientUnhealthy"); + + /** + * Static value PersistentUnhealthy for ResourceHealthStatus. + */ + public static final ResourceHealthStatus PERSISTENT_UNHEALTHY = fromString("PersistentUnhealthy"); + + /** + * Static value Invalid for ResourceHealthStatus. + */ + public static final ResourceHealthStatus INVALID = fromString("Invalid"); + + /** + * Creates a new instance of ResourceHealthStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceHealthStatus() { + } + + /** + * Creates or finds a ResourceHealthStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceHealthStatus. + */ + public static ResourceHealthStatus fromString(String name) { + return fromString(name, ResourceHealthStatus.class); + } + + /** + * Gets known ResourceHealthStatus values. + * + * @return known ResourceHealthStatus values. + */ + public static Collection values() { + return values(ResourceHealthStatus.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceList.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceList.java new file mode 100644 index 000000000000..bd8659cd22e3 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceList.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base for all lists of resources. + */ +@Immutable +public class ResourceList implements JsonSerializable { + /* + * The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of ResourceList class. + */ + protected ResourceList() { + } + + /** + * Get the nextLink property: The uri to fetch the next page of resources. Call ListNext() fetches next page of + * resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of resources. Call ListNext() fetches next page of + * resources. + * + * @param nextLink the nextLink value to set. + * @return the ResourceList object itself. + */ + ResourceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceList 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 ResourceList. + */ + public static ResourceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceList deserializedResourceList = new ResourceList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedResourceList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceList; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreFileSpecs.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreFileSpecs.java new file mode 100644 index 000000000000..6eca4a07b11e --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreFileSpecs.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Restore file specs like file path, type and target folder path info. + */ +@Fluent +public final class RestoreFileSpecs implements JsonSerializable { + /* + * Source File/Folder path + */ + private String path; + + /* + * Indicates what the Path variable stands for + */ + private String fileSpecType; + + /* + * Destination folder path in target FileShare + */ + private String targetFolderPath; + + /** + * Creates an instance of RestoreFileSpecs class. + */ + public RestoreFileSpecs() { + } + + /** + * Get the path property: Source File/Folder path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Source File/Folder path. + * + * @param path the path value to set. + * @return the RestoreFileSpecs object itself. + */ + public RestoreFileSpecs withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the fileSpecType property: Indicates what the Path variable stands for. + * + * @return the fileSpecType value. + */ + public String fileSpecType() { + return this.fileSpecType; + } + + /** + * Set the fileSpecType property: Indicates what the Path variable stands for. + * + * @param fileSpecType the fileSpecType value to set. + * @return the RestoreFileSpecs object itself. + */ + public RestoreFileSpecs withFileSpecType(String fileSpecType) { + this.fileSpecType = fileSpecType; + return this; + } + + /** + * Get the targetFolderPath property: Destination folder path in target FileShare. + * + * @return the targetFolderPath value. + */ + public String targetFolderPath() { + return this.targetFolderPath; + } + + /** + * Set the targetFolderPath property: Destination folder path in target FileShare. + * + * @param targetFolderPath the targetFolderPath value to set. + * @return the RestoreFileSpecs object itself. + */ + public RestoreFileSpecs withTargetFolderPath(String targetFolderPath) { + this.targetFolderPath = targetFolderPath; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("fileSpecType", this.fileSpecType); + jsonWriter.writeStringField("targetFolderPath", this.targetFolderPath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RestoreFileSpecs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RestoreFileSpecs 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 RestoreFileSpecs. + */ + public static RestoreFileSpecs fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RestoreFileSpecs deserializedRestoreFileSpecs = new RestoreFileSpecs(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedRestoreFileSpecs.path = reader.getString(); + } else if ("fileSpecType".equals(fieldName)) { + deserializedRestoreFileSpecs.fileSpecType = reader.getString(); + } else if ("targetFolderPath".equals(fieldName)) { + deserializedRestoreFileSpecs.targetFolderPath = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRestoreFileSpecs; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestorePointType.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestorePointType.java new file mode 100644 index 000000000000..544b163be605 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestorePointType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of restore point. + */ +public final class RestorePointType extends ExpandableStringEnum { + /** + * Static value Invalid for RestorePointType. + */ + public static final RestorePointType INVALID = fromString("Invalid"); + + /** + * Static value Full for RestorePointType. + */ + public static final RestorePointType FULL = fromString("Full"); + + /** + * Static value Log for RestorePointType. + */ + public static final RestorePointType LOG = fromString("Log"); + + /** + * Static value Differential for RestorePointType. + */ + public static final RestorePointType DIFFERENTIAL = fromString("Differential"); + + /** + * Static value Incremental for RestorePointType. + */ + public static final RestorePointType INCREMENTAL = fromString("Incremental"); + + /** + * Creates a new instance of RestorePointType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RestorePointType() { + } + + /** + * Creates or finds a RestorePointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RestorePointType. + */ + public static RestorePointType fromString(String name) { + return fromString(name, RestorePointType.class); + } + + /** + * Gets known RestorePointType values. + * + * @return known RestorePointType values. + */ + public static Collection values() { + return values(RestorePointType.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreRequest.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreRequest.java new file mode 100644 index 000000000000..2ad905f18ada --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreRequest.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base class for restore request. Workload-specific restore requests are derived from this class. + */ +@Immutable +public class RestoreRequest implements JsonSerializable { + /* + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. + */ + private String objectType = "RestoreRequest"; + + /** + * Creates an instance of RestoreRequest class. + */ + public RestoreRequest() { + } + + /** + * 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. + */ + public String objectType() { + return this.objectType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RestoreRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RestoreRequest 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 RestoreRequest. + */ + public static RestoreRequest 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 ("AzureFileShareRestoreRequest".equals(discriminatorValue)) { + return AzureFileShareRestoreRequest.fromJson(readerToUse.reset()); + } else if ("AzureWorkloadRestoreRequest".equals(discriminatorValue)) { + return AzureWorkloadRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); + } else if ("AzureWorkloadSAPHanaRestoreRequest".equals(discriminatorValue)) { + return AzureWorkloadSAPHanaRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); + } else if ("AzureWorkloadSAPHanaPointInTimeRestoreRequest".equals(discriminatorValue)) { + return AzureWorkloadSAPHanaPointInTimeRestoreRequest.fromJson(readerToUse.reset()); + } else if ("AzureWorkloadSQLRestoreRequest".equals(discriminatorValue)) { + return AzureWorkloadSQLRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); + } else if ("AzureWorkloadSQLPointInTimeRestoreRequest".equals(discriminatorValue)) { + return AzureWorkloadSQLPointInTimeRestoreRequest.fromJson(readerToUse.reset()); + } else if ("AzureWorkloadPointInTimeRestoreRequest".equals(discriminatorValue)) { + return AzureWorkloadPointInTimeRestoreRequest.fromJson(readerToUse.reset()); + } else if ("IaasVMRestoreRequest".equals(discriminatorValue)) { + return IaasVMRestoreRequest.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static RestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RestoreRequest deserializedRestoreRequest = new RestoreRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedRestoreRequest.objectType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRestoreRequest; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreRequestType.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreRequestType.java new file mode 100644 index 000000000000..d75662df6d64 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreRequestType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Restore Type (FullShareRestore or ItemLevelRestore). + */ +public final class RestoreRequestType extends ExpandableStringEnum { + /** + * Static value Invalid for RestoreRequestType. + */ + public static final RestoreRequestType INVALID = fromString("Invalid"); + + /** + * Static value FullShareRestore for RestoreRequestType. + */ + public static final RestoreRequestType FULL_SHARE_RESTORE = fromString("FullShareRestore"); + + /** + * Static value ItemLevelRestore for RestoreRequestType. + */ + public static final RestoreRequestType ITEM_LEVEL_RESTORE = fromString("ItemLevelRestore"); + + /** + * Creates a new instance of RestoreRequestType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RestoreRequestType() { + } + + /** + * Creates or finds a RestoreRequestType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RestoreRequestType. + */ + public static RestoreRequestType fromString(String name) { + return fromString(name, RestoreRequestType.class); + } + + /** + * Gets known RestoreRequestType values. + * + * @return known RestoreRequestType values. + */ + public static Collection values() { + return values(RestoreRequestType.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectory.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectory.java new file mode 100644 index 000000000000..dbfb10d609b6 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectory.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SQLDataDirectory info. + */ +@Immutable +public final class SQLDataDirectory implements JsonSerializable { + /* + * Type of data directory mapping + */ + private SQLDataDirectoryType type; + + /* + * File path + */ + private String path; + + /* + * Logical name of the file + */ + private String logicalName; + + /** + * Creates an instance of SQLDataDirectory class. + */ + private SQLDataDirectory() { + } + + /** + * Get the type property: Type of data directory mapping. + * + * @return the type value. + */ + public SQLDataDirectoryType type() { + return this.type; + } + + /** + * Get the path property: File path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Get the logicalName property: Logical name of the file. + * + * @return the logicalName value. + */ + public String logicalName() { + return this.logicalName; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("logicalName", this.logicalName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SQLDataDirectory from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SQLDataDirectory 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 SQLDataDirectory. + */ + public static SQLDataDirectory fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SQLDataDirectory deserializedSQLDataDirectory = new SQLDataDirectory(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedSQLDataDirectory.type = SQLDataDirectoryType.fromString(reader.getString()); + } else if ("path".equals(fieldName)) { + deserializedSQLDataDirectory.path = reader.getString(); + } else if ("logicalName".equals(fieldName)) { + deserializedSQLDataDirectory.logicalName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSQLDataDirectory; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectoryMapping.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectoryMapping.java new file mode 100644 index 000000000000..d9879f9c16d1 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectoryMapping.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Encapsulates information regarding data directory. + */ +@Fluent +public final class SQLDataDirectoryMapping implements JsonSerializable { + /* + * Type of data directory mapping + */ + private SQLDataDirectoryType mappingType; + + /* + * Restore source logical name path + */ + private String sourceLogicalName; + + /* + * Restore source path + */ + private String sourcePath; + + /* + * Target path + */ + private String targetPath; + + /** + * Creates an instance of SQLDataDirectoryMapping class. + */ + public SQLDataDirectoryMapping() { + } + + /** + * Get the mappingType property: Type of data directory mapping. + * + * @return the mappingType value. + */ + public SQLDataDirectoryType mappingType() { + return this.mappingType; + } + + /** + * Set the mappingType property: Type of data directory mapping. + * + * @param mappingType the mappingType value to set. + * @return the SQLDataDirectoryMapping object itself. + */ + public SQLDataDirectoryMapping withMappingType(SQLDataDirectoryType mappingType) { + this.mappingType = mappingType; + return this; + } + + /** + * Get the sourceLogicalName property: Restore source logical name path. + * + * @return the sourceLogicalName value. + */ + public String sourceLogicalName() { + return this.sourceLogicalName; + } + + /** + * Set the sourceLogicalName property: Restore source logical name path. + * + * @param sourceLogicalName the sourceLogicalName value to set. + * @return the SQLDataDirectoryMapping object itself. + */ + public SQLDataDirectoryMapping withSourceLogicalName(String sourceLogicalName) { + this.sourceLogicalName = sourceLogicalName; + return this; + } + + /** + * Get the sourcePath property: Restore source path. + * + * @return the sourcePath value. + */ + public String sourcePath() { + return this.sourcePath; + } + + /** + * Set the sourcePath property: Restore source path. + * + * @param sourcePath the sourcePath value to set. + * @return the SQLDataDirectoryMapping object itself. + */ + public SQLDataDirectoryMapping withSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + return this; + } + + /** + * Get the targetPath property: Target path. + * + * @return the targetPath value. + */ + public String targetPath() { + return this.targetPath; + } + + /** + * Set the targetPath property: Target path. + * + * @param targetPath the targetPath value to set. + * @return the SQLDataDirectoryMapping object itself. + */ + public SQLDataDirectoryMapping withTargetPath(String targetPath) { + this.targetPath = targetPath; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mappingType", this.mappingType == null ? null : this.mappingType.toString()); + jsonWriter.writeStringField("sourceLogicalName", this.sourceLogicalName); + jsonWriter.writeStringField("sourcePath", this.sourcePath); + jsonWriter.writeStringField("targetPath", this.targetPath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SQLDataDirectoryMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SQLDataDirectoryMapping 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 SQLDataDirectoryMapping. + */ + public static SQLDataDirectoryMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SQLDataDirectoryMapping deserializedSQLDataDirectoryMapping = new SQLDataDirectoryMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mappingType".equals(fieldName)) { + deserializedSQLDataDirectoryMapping.mappingType + = SQLDataDirectoryType.fromString(reader.getString()); + } else if ("sourceLogicalName".equals(fieldName)) { + deserializedSQLDataDirectoryMapping.sourceLogicalName = reader.getString(); + } else if ("sourcePath".equals(fieldName)) { + deserializedSQLDataDirectoryMapping.sourcePath = reader.getString(); + } else if ("targetPath".equals(fieldName)) { + deserializedSQLDataDirectoryMapping.targetPath = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSQLDataDirectoryMapping; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectoryType.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectoryType.java new file mode 100644 index 000000000000..db18457fc225 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectoryType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of data directory mapping. + */ +public final class SQLDataDirectoryType extends ExpandableStringEnum { + /** + * Static value Invalid for SQLDataDirectoryType. + */ + public static final SQLDataDirectoryType INVALID = fromString("Invalid"); + + /** + * Static value Data for SQLDataDirectoryType. + */ + public static final SQLDataDirectoryType DATA = fromString("Data"); + + /** + * Static value Log for SQLDataDirectoryType. + */ + public static final SQLDataDirectoryType LOG = fromString("Log"); + + /** + * Creates a new instance of SQLDataDirectoryType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SQLDataDirectoryType() { + } + + /** + * Creates or finds a SQLDataDirectoryType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SQLDataDirectoryType. + */ + public static SQLDataDirectoryType fromString(String name) { + return fromString(name, SQLDataDirectoryType.class); + } + + /** + * Gets known SQLDataDirectoryType values. + * + * @return known SQLDataDirectoryType values. + */ + public static Collection values() { + return values(SQLDataDirectoryType.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/StorageType.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/StorageType.java new file mode 100644 index 000000000000..c78626c68de0 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/StorageType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Storage type. + */ +public final class StorageType extends ExpandableStringEnum { + /** + * Static value Invalid for StorageType. + */ + public static final StorageType INVALID = fromString("Invalid"); + + /** + * Static value GeoRedundant for StorageType. + */ + public static final StorageType GEO_REDUNDANT = fromString("GeoRedundant"); + + /** + * Static value LocallyRedundant for StorageType. + */ + public static final StorageType LOCALLY_REDUNDANT = fromString("LocallyRedundant"); + + /** + * Static value ZoneRedundant for StorageType. + */ + public static final StorageType ZONE_REDUNDANT = fromString("ZoneRedundant"); + + /** + * Static value ReadAccessGeoZoneRedundant for StorageType. + */ + public static final StorageType READ_ACCESS_GEO_ZONE_REDUNDANT = fromString("ReadAccessGeoZoneRedundant"); + + /** + * Creates a new instance of StorageType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageType() { + } + + /** + * Creates or finds a StorageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageType. + */ + public static StorageType fromString(String name) { + return fromString(name, StorageType.class); + } + + /** + * Gets known StorageType values. + * + * @return known StorageType values. + */ + public static Collection values() { + return values(StorageType.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/StorageTypeState.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/StorageTypeState.java new file mode 100644 index 000000000000..ca02592a4fbd --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/StorageTypeState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + */ +public final class StorageTypeState extends ExpandableStringEnum { + /** + * Static value Invalid for StorageTypeState. + */ + public static final StorageTypeState INVALID = fromString("Invalid"); + + /** + * Static value Locked for StorageTypeState. + */ + public static final StorageTypeState LOCKED = fromString("Locked"); + + /** + * Static value Unlocked for StorageTypeState. + */ + public static final StorageTypeState UNLOCKED = fromString("Unlocked"); + + /** + * Creates a new instance of StorageTypeState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageTypeState() { + } + + /** + * Creates or finds a StorageTypeState from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageTypeState. + */ + public static StorageTypeState fromString(String name) { + return fromString(name, StorageTypeState.class); + } + + /** + * Gets known StorageTypeState values. + * + * @return known StorageTypeState values. + */ + public static Collection values() { + return values(StorageTypeState.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/TargetAFSRestoreInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/TargetAFSRestoreInfo.java new file mode 100644 index 000000000000..beab69aca376 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/TargetAFSRestoreInfo.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Target Azure File Share Info. + */ +@Fluent +public final class TargetAFSRestoreInfo implements JsonSerializable { + /* + * File share name + */ + private String name; + + /* + * Target file share resource ARM ID + */ + private String targetResourceId; + + /** + * Creates an instance of TargetAFSRestoreInfo class. + */ + public TargetAFSRestoreInfo() { + } + + /** + * Get the name property: File share name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: File share name. + * + * @param name the name value to set. + * @return the TargetAFSRestoreInfo object itself. + */ + public TargetAFSRestoreInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the targetResourceId property: Target file share resource ARM ID. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: Target file share resource ARM ID. + * + * @param targetResourceId the targetResourceId value to set. + * @return the TargetAFSRestoreInfo object itself. + */ + public TargetAFSRestoreInfo withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("targetResourceId", this.targetResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetAFSRestoreInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetAFSRestoreInfo 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 TargetAFSRestoreInfo. + */ + public static TargetAFSRestoreInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetAFSRestoreInfo deserializedTargetAFSRestoreInfo = new TargetAFSRestoreInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedTargetAFSRestoreInfo.name = reader.getString(); + } else if ("targetResourceId".equals(fieldName)) { + deserializedTargetAFSRestoreInfo.targetResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetAFSRestoreInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/TargetRestoreInfo.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/TargetRestoreInfo.java new file mode 100644 index 000000000000..764fdc5384b8 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/TargetRestoreInfo.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details about target workload during restore operation. + */ +@Fluent +public final class TargetRestoreInfo implements JsonSerializable { + /* + * Can Overwrite if Target DataBase already exists + */ + private OverwriteOptions overwriteOption; + + /* + * Resource Id name of the container in which Target DataBase resides + */ + private String containerId; + + /* + * Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + */ + private String databaseName; + + /* + * Target directory location for restore as files. + */ + private String targetDirectoryForFileRestore; + + /** + * Creates an instance of TargetRestoreInfo class. + */ + public TargetRestoreInfo() { + } + + /** + * Get the overwriteOption property: Can Overwrite if Target DataBase already exists. + * + * @return the overwriteOption value. + */ + public OverwriteOptions overwriteOption() { + return this.overwriteOption; + } + + /** + * Set the overwriteOption property: Can Overwrite if Target DataBase already exists. + * + * @param overwriteOption the overwriteOption value to set. + * @return the TargetRestoreInfo object itself. + */ + public TargetRestoreInfo withOverwriteOption(OverwriteOptions overwriteOption) { + this.overwriteOption = overwriteOption; + return this; + } + + /** + * Get the containerId property: Resource Id name of the container in which Target DataBase resides. + * + * @return the containerId value. + */ + public String containerId() { + return this.containerId; + } + + /** + * Set the containerId property: Resource Id name of the container in which Target DataBase resides. + * + * @param containerId the containerId value to set. + * @return the TargetRestoreInfo object itself. + */ + public TargetRestoreInfo withContainerId(String containerId) { + this.containerId = containerId; + return this; + } + + /** + * Get the databaseName property: Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana. + * + * @param databaseName the databaseName value to set. + * @return the TargetRestoreInfo object itself. + */ + public TargetRestoreInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the targetDirectoryForFileRestore property: Target directory location for restore as files. + * + * @return the targetDirectoryForFileRestore value. + */ + public String targetDirectoryForFileRestore() { + return this.targetDirectoryForFileRestore; + } + + /** + * Set the targetDirectoryForFileRestore property: Target directory location for restore as files. + * + * @param targetDirectoryForFileRestore the targetDirectoryForFileRestore value to set. + * @return the TargetRestoreInfo object itself. + */ + public TargetRestoreInfo withTargetDirectoryForFileRestore(String targetDirectoryForFileRestore) { + this.targetDirectoryForFileRestore = targetDirectoryForFileRestore; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("overwriteOption", + this.overwriteOption == null ? null : this.overwriteOption.toString()); + jsonWriter.writeStringField("containerId", this.containerId); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("targetDirectoryForFileRestore", this.targetDirectoryForFileRestore); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetRestoreInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetRestoreInfo 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 TargetRestoreInfo. + */ + public static TargetRestoreInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetRestoreInfo deserializedTargetRestoreInfo = new TargetRestoreInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("overwriteOption".equals(fieldName)) { + deserializedTargetRestoreInfo.overwriteOption = OverwriteOptions.fromString(reader.getString()); + } else if ("containerId".equals(fieldName)) { + deserializedTargetRestoreInfo.containerId = reader.getString(); + } else if ("databaseName".equals(fieldName)) { + deserializedTargetRestoreInfo.databaseName = reader.getString(); + } else if ("targetDirectoryForFileRestore".equals(fieldName)) { + deserializedTargetRestoreInfo.targetDirectoryForFileRestore = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetRestoreInfo; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/UsagesUnit.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/UsagesUnit.java new file mode 100644 index 000000000000..aeef13f82653 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/UsagesUnit.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Unit of the usage. + */ +public final class UsagesUnit extends ExpandableStringEnum { + /** + * Static value Count for UsagesUnit. + */ + public static final UsagesUnit COUNT = fromString("Count"); + + /** + * Static value Bytes for UsagesUnit. + */ + public static final UsagesUnit BYTES = fromString("Bytes"); + + /** + * Static value Seconds for UsagesUnit. + */ + public static final UsagesUnit SECONDS = fromString("Seconds"); + + /** + * Static value Percent for UsagesUnit. + */ + public static final UsagesUnit PERCENT = fromString("Percent"); + + /** + * Static value CountPerSecond for UsagesUnit. + */ + public static final UsagesUnit COUNT_PER_SECOND = fromString("CountPerSecond"); + + /** + * Static value BytesPerSecond for UsagesUnit. + */ + public static final UsagesUnit BYTES_PER_SECOND = fromString("BytesPerSecond"); + + /** + * Creates a new instance of UsagesUnit value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UsagesUnit() { + } + + /** + * Creates or finds a UsagesUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding UsagesUnit. + */ + public static UsagesUnit fromString(String name) { + return fromString(name, UsagesUnit.class); + } + + /** + * Gets known UsagesUnit values. + * + * @return known UsagesUnit values. + */ + public static Collection values() { + return values(UsagesUnit.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/WorkloadCrrAccessToken.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/WorkloadCrrAccessToken.java new file mode 100644 index 000000000000..9e7473b2f1e4 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/WorkloadCrrAccessToken.java @@ -0,0 +1,637 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.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.Map; + +/** + * The WorkloadCrrAccessToken model. + */ +@Fluent +public final class WorkloadCrrAccessToken extends CrrAccessToken { + /* + * Type of the specific object - used for deserializing + */ + private String objectType = "WorkloadCrrAccessToken"; + + /* + * The protectableObjectUniqueName property. + */ + private String protectableObjectUniqueName; + + /* + * The protectableObjectFriendlyName property. + */ + private String protectableObjectFriendlyName; + + /* + * The protectableObjectWorkloadType property. + */ + private String protectableObjectWorkloadType; + + /* + * The protectableObjectProtectionState property. + */ + private String protectableObjectProtectionState; + + /* + * The protectableObjectContainerHostOsName property. + */ + private String protectableObjectContainerHostOsName; + + /* + * The protectableObjectParentLogicalContainerName property. + */ + private String protectableObjectParentLogicalContainerName; + + /* + * Container Id + */ + private String containerId; + + /* + * Policy Name + */ + private String policyName; + + /* + * Policy Id + */ + private String policyId; + + /** + * Creates an instance of WorkloadCrrAccessToken class. + */ + public WorkloadCrrAccessToken() { + } + + /** + * Get the objectType property: Type of the specific object - used for deserializing. + * + * @return the objectType value. + */ + @Override + public String objectType() { + return this.objectType; + } + + /** + * Get the protectableObjectUniqueName property: The protectableObjectUniqueName property. + * + * @return the protectableObjectUniqueName value. + */ + public String protectableObjectUniqueName() { + return this.protectableObjectUniqueName; + } + + /** + * Set the protectableObjectUniqueName property: The protectableObjectUniqueName property. + * + * @param protectableObjectUniqueName the protectableObjectUniqueName value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withProtectableObjectUniqueName(String protectableObjectUniqueName) { + this.protectableObjectUniqueName = protectableObjectUniqueName; + return this; + } + + /** + * Get the protectableObjectFriendlyName property: The protectableObjectFriendlyName property. + * + * @return the protectableObjectFriendlyName value. + */ + public String protectableObjectFriendlyName() { + return this.protectableObjectFriendlyName; + } + + /** + * Set the protectableObjectFriendlyName property: The protectableObjectFriendlyName property. + * + * @param protectableObjectFriendlyName the protectableObjectFriendlyName value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withProtectableObjectFriendlyName(String protectableObjectFriendlyName) { + this.protectableObjectFriendlyName = protectableObjectFriendlyName; + return this; + } + + /** + * Get the protectableObjectWorkloadType property: The protectableObjectWorkloadType property. + * + * @return the protectableObjectWorkloadType value. + */ + public String protectableObjectWorkloadType() { + return this.protectableObjectWorkloadType; + } + + /** + * Set the protectableObjectWorkloadType property: The protectableObjectWorkloadType property. + * + * @param protectableObjectWorkloadType the protectableObjectWorkloadType value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withProtectableObjectWorkloadType(String protectableObjectWorkloadType) { + this.protectableObjectWorkloadType = protectableObjectWorkloadType; + return this; + } + + /** + * Get the protectableObjectProtectionState property: The protectableObjectProtectionState property. + * + * @return the protectableObjectProtectionState value. + */ + public String protectableObjectProtectionState() { + return this.protectableObjectProtectionState; + } + + /** + * Set the protectableObjectProtectionState property: The protectableObjectProtectionState property. + * + * @param protectableObjectProtectionState the protectableObjectProtectionState value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withProtectableObjectProtectionState(String protectableObjectProtectionState) { + this.protectableObjectProtectionState = protectableObjectProtectionState; + return this; + } + + /** + * Get the protectableObjectContainerHostOsName property: The protectableObjectContainerHostOsName property. + * + * @return the protectableObjectContainerHostOsName value. + */ + public String protectableObjectContainerHostOsName() { + return this.protectableObjectContainerHostOsName; + } + + /** + * Set the protectableObjectContainerHostOsName property: The protectableObjectContainerHostOsName property. + * + * @param protectableObjectContainerHostOsName the protectableObjectContainerHostOsName value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken + withProtectableObjectContainerHostOsName(String protectableObjectContainerHostOsName) { + this.protectableObjectContainerHostOsName = protectableObjectContainerHostOsName; + return this; + } + + /** + * Get the protectableObjectParentLogicalContainerName property: The protectableObjectParentLogicalContainerName + * property. + * + * @return the protectableObjectParentLogicalContainerName value. + */ + public String protectableObjectParentLogicalContainerName() { + return this.protectableObjectParentLogicalContainerName; + } + + /** + * Set the protectableObjectParentLogicalContainerName property: The protectableObjectParentLogicalContainerName + * property. + * + * @param protectableObjectParentLogicalContainerName the protectableObjectParentLogicalContainerName value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken + withProtectableObjectParentLogicalContainerName(String protectableObjectParentLogicalContainerName) { + this.protectableObjectParentLogicalContainerName = protectableObjectParentLogicalContainerName; + return this; + } + + /** + * Get the containerId property: Container Id. + * + * @return the containerId value. + */ + public String containerId() { + return this.containerId; + } + + /** + * Set the containerId property: Container Id. + * + * @param containerId the containerId value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withContainerId(String containerId) { + this.containerId = containerId; + return this; + } + + /** + * Get the policyName property: Policy Name. + * + * @return the policyName value. + */ + public String policyName() { + return this.policyName; + } + + /** + * Set the policyName property: Policy Name. + * + * @param policyName the policyName value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get the policyId property: Policy Id. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: Policy Id. + * + * @param policyId the policyId value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withAccessTokenString(String accessTokenString) { + super.withAccessTokenString(accessTokenString); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withSubscriptionId(String subscriptionId) { + super.withSubscriptionId(subscriptionId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withResourceGroupName(String resourceGroupName) { + super.withResourceGroupName(resourceGroupName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withResourceName(String resourceName) { + super.withResourceName(resourceName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withResourceId(String resourceId) { + super.withResourceId(resourceId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withProtectionContainerId(Long protectionContainerId) { + super.withProtectionContainerId(protectionContainerId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withRecoveryPointId(String recoveryPointId) { + super.withRecoveryPointId(recoveryPointId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withRecoveryPointTime(String recoveryPointTime) { + super.withRecoveryPointTime(recoveryPointTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withContainerType(String containerType) { + super.withContainerType(containerType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withDatasourceType(String datasourceType) { + super.withDatasourceType(datasourceType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withDatasourceName(String datasourceName) { + super.withDatasourceName(datasourceName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withDatasourceId(String datasourceId) { + super.withDatasourceId(datasourceId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withDatasourceContainerName(String datasourceContainerName) { + super.withDatasourceContainerName(datasourceContainerName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withCoordinatorServiceStampId(String coordinatorServiceStampId) { + super.withCoordinatorServiceStampId(coordinatorServiceStampId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withCoordinatorServiceStampUri(String coordinatorServiceStampUri) { + super.withCoordinatorServiceStampUri(coordinatorServiceStampUri); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withProtectionServiceStampId(String protectionServiceStampId) { + super.withProtectionServiceStampId(protectionServiceStampId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withProtectionServiceStampUri(String protectionServiceStampUri) { + super.withProtectionServiceStampUri(protectionServiceStampUri); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withTokenExtendedInformation(String tokenExtendedInformation) { + super.withTokenExtendedInformation(tokenExtendedInformation); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withRpTierInformation(Map rpTierInformation) { + super.withRpTierInformation(rpTierInformation); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withRpOriginalSAOption(Boolean rpOriginalSAOption) { + super.withRpOriginalSAOption(rpOriginalSAOption); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withRpIsManagedVirtualMachine(Boolean rpIsManagedVirtualMachine) { + super.withRpIsManagedVirtualMachine(rpIsManagedVirtualMachine); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withRpVMSizeDescription(String rpVMSizeDescription) { + super.withRpVMSizeDescription(rpVMSizeDescription); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WorkloadCrrAccessToken withBMSActiveRegion(String bMSActiveRegion) { + super.withBMSActiveRegion(bMSActiveRegion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accessTokenString", accessTokenString()); + jsonWriter.writeStringField("subscriptionId", subscriptionId()); + jsonWriter.writeStringField("resourceGroupName", resourceGroupName()); + jsonWriter.writeStringField("resourceName", resourceName()); + jsonWriter.writeStringField("resourceId", resourceId()); + jsonWriter.writeNumberField("protectionContainerId", protectionContainerId()); + jsonWriter.writeStringField("recoveryPointId", recoveryPointId()); + jsonWriter.writeStringField("recoveryPointTime", recoveryPointTime()); + jsonWriter.writeStringField("containerName", containerName()); + jsonWriter.writeStringField("containerType", containerType()); + jsonWriter.writeStringField("backupManagementType", backupManagementType()); + jsonWriter.writeStringField("datasourceType", datasourceType()); + jsonWriter.writeStringField("datasourceName", datasourceName()); + jsonWriter.writeStringField("datasourceId", datasourceId()); + jsonWriter.writeStringField("datasourceContainerName", datasourceContainerName()); + jsonWriter.writeStringField("coordinatorServiceStampId", coordinatorServiceStampId()); + jsonWriter.writeStringField("coordinatorServiceStampUri", coordinatorServiceStampUri()); + jsonWriter.writeStringField("protectionServiceStampId", protectionServiceStampId()); + jsonWriter.writeStringField("protectionServiceStampUri", protectionServiceStampUri()); + jsonWriter.writeStringField("tokenExtendedInformation", tokenExtendedInformation()); + jsonWriter.writeMapField("rpTierInformation", rpTierInformation(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("rpOriginalSAOption", rpOriginalSAOption()); + jsonWriter.writeBooleanField("rpIsManagedVirtualMachine", rpIsManagedVirtualMachine()); + jsonWriter.writeStringField("rpVMSizeDescription", rpVMSizeDescription()); + jsonWriter.writeStringField("bMSActiveRegion", bMSActiveRegion()); + jsonWriter.writeStringField("objectType", this.objectType); + jsonWriter.writeStringField("protectableObjectUniqueName", this.protectableObjectUniqueName); + jsonWriter.writeStringField("protectableObjectFriendlyName", this.protectableObjectFriendlyName); + jsonWriter.writeStringField("protectableObjectWorkloadType", this.protectableObjectWorkloadType); + jsonWriter.writeStringField("protectableObjectProtectionState", this.protectableObjectProtectionState); + jsonWriter.writeStringField("protectableObjectContainerHostOsName", this.protectableObjectContainerHostOsName); + jsonWriter.writeStringField("protectableObjectParentLogicalContainerName", + this.protectableObjectParentLogicalContainerName); + jsonWriter.writeStringField("containerId", this.containerId); + jsonWriter.writeStringField("policyName", this.policyName); + jsonWriter.writeStringField("policyId", this.policyId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkloadCrrAccessToken from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkloadCrrAccessToken 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 WorkloadCrrAccessToken. + */ + public static WorkloadCrrAccessToken fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkloadCrrAccessToken deserializedWorkloadCrrAccessToken = new WorkloadCrrAccessToken(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessTokenString".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withAccessTokenString(reader.getString()); + } else if ("subscriptionId".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withSubscriptionId(reader.getString()); + } else if ("resourceGroupName".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withResourceGroupName(reader.getString()); + } else if ("resourceName".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withResourceName(reader.getString()); + } else if ("resourceId".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withResourceId(reader.getString()); + } else if ("protectionContainerId".equals(fieldName)) { + deserializedWorkloadCrrAccessToken + .withProtectionContainerId(reader.getNullable(JsonReader::getLong)); + } else if ("recoveryPointId".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withRecoveryPointId(reader.getString()); + } else if ("recoveryPointTime".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withRecoveryPointTime(reader.getString()); + } else if ("containerName".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withContainerName(reader.getString()); + } else if ("containerType".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withContainerType(reader.getString()); + } else if ("backupManagementType".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withBackupManagementType(reader.getString()); + } else if ("datasourceType".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withDatasourceType(reader.getString()); + } else if ("datasourceName".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withDatasourceName(reader.getString()); + } else if ("datasourceId".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withDatasourceId(reader.getString()); + } else if ("datasourceContainerName".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withDatasourceContainerName(reader.getString()); + } else if ("coordinatorServiceStampId".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withCoordinatorServiceStampId(reader.getString()); + } else if ("coordinatorServiceStampUri".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withCoordinatorServiceStampUri(reader.getString()); + } else if ("protectionServiceStampId".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withProtectionServiceStampId(reader.getString()); + } else if ("protectionServiceStampUri".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withProtectionServiceStampUri(reader.getString()); + } else if ("tokenExtendedInformation".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withTokenExtendedInformation(reader.getString()); + } else if ("rpTierInformation".equals(fieldName)) { + Map rpTierInformation = reader.readMap(reader1 -> reader1.getString()); + deserializedWorkloadCrrAccessToken.withRpTierInformation(rpTierInformation); + } else if ("rpOriginalSAOption".equals(fieldName)) { + deserializedWorkloadCrrAccessToken + .withRpOriginalSAOption(reader.getNullable(JsonReader::getBoolean)); + } else if ("rpIsManagedVirtualMachine".equals(fieldName)) { + deserializedWorkloadCrrAccessToken + .withRpIsManagedVirtualMachine(reader.getNullable(JsonReader::getBoolean)); + } else if ("rpVMSizeDescription".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withRpVMSizeDescription(reader.getString()); + } else if ("bMSActiveRegion".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.withBMSActiveRegion(reader.getString()); + } else if ("objectType".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.objectType = reader.getString(); + } else if ("protectableObjectUniqueName".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.protectableObjectUniqueName = reader.getString(); + } else if ("protectableObjectFriendlyName".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.protectableObjectFriendlyName = reader.getString(); + } else if ("protectableObjectWorkloadType".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.protectableObjectWorkloadType = reader.getString(); + } else if ("protectableObjectProtectionState".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.protectableObjectProtectionState = reader.getString(); + } else if ("protectableObjectContainerHostOsName".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.protectableObjectContainerHostOsName = reader.getString(); + } else if ("protectableObjectParentLogicalContainerName".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.protectableObjectParentLogicalContainerName = reader.getString(); + } else if ("containerId".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.containerId = reader.getString(); + } else if ("policyName".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.policyName = reader.getString(); + } else if ("policyId".equals(fieldName)) { + deserializedWorkloadCrrAccessToken.policyId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkloadCrrAccessToken; + }); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/WorkloadType.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/WorkloadType.java new file mode 100644 index 000000000000..9f6b59829537 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/WorkloadType.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Workload type of backup item. + */ +public final class WorkloadType extends ExpandableStringEnum { + /** + * Static value Invalid for WorkloadType. + */ + public static final WorkloadType INVALID = fromString("Invalid"); + + /** + * Static value VM for WorkloadType. + */ + public static final WorkloadType VM = fromString("VM"); + + /** + * Static value FileFolder for WorkloadType. + */ + public static final WorkloadType FILE_FOLDER = fromString("FileFolder"); + + /** + * Static value AzureSqlDb for WorkloadType. + */ + public static final WorkloadType AZURE_SQL_DB = fromString("AzureSqlDb"); + + /** + * Static value SQLDB for WorkloadType. + */ + public static final WorkloadType SQLDB = fromString("SQLDB"); + + /** + * Static value Exchange for WorkloadType. + */ + public static final WorkloadType EXCHANGE = fromString("Exchange"); + + /** + * Static value Sharepoint for WorkloadType. + */ + public static final WorkloadType SHAREPOINT = fromString("Sharepoint"); + + /** + * Static value VMwareVM for WorkloadType. + */ + public static final WorkloadType VMWARE_VM = fromString("VMwareVM"); + + /** + * Static value SystemState for WorkloadType. + */ + public static final WorkloadType SYSTEM_STATE = fromString("SystemState"); + + /** + * Static value Client for WorkloadType. + */ + public static final WorkloadType CLIENT = fromString("Client"); + + /** + * Static value GenericDataSource for WorkloadType. + */ + public static final WorkloadType GENERIC_DATA_SOURCE = fromString("GenericDataSource"); + + /** + * Static value SQLDataBase for WorkloadType. + */ + public static final WorkloadType SQLDATA_BASE = fromString("SQLDataBase"); + + /** + * Static value AzureFileShare for WorkloadType. + */ + public static final WorkloadType AZURE_FILE_SHARE = fromString("AzureFileShare"); + + /** + * Static value SAPHanaDatabase for WorkloadType. + */ + public static final WorkloadType SAPHANA_DATABASE = fromString("SAPHanaDatabase"); + + /** + * Static value SAPAseDatabase for WorkloadType. + */ + public static final WorkloadType SAPASE_DATABASE = fromString("SAPAseDatabase"); + + /** + * Creates a new instance of WorkloadType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkloadType() { + } + + /** + * Creates or finds a WorkloadType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadType. + */ + public static WorkloadType fromString(String name) { + return fromString(name, WorkloadType.class); + } + + /** + * Gets known WorkloadType values. + * + * @return known WorkloadType values. + */ + public static Collection values() { + return values(WorkloadType.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/package-info.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/package-info.java new file mode 100644 index 000000000000..4a008fbc5e42 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for RecoveryServicesBackupCrr. + * Open API 2.0 Specs for Azure Recovery Services Backup CRR (Cross Region Restore) service. + */ +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/package-info.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/package-info.java new file mode 100644 index 000000000000..0d282b56915b --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for RecoveryServicesBackupCrr. + * Open API 2.0 Specs for Azure Recovery Services Backup CRR (Cross Region Restore) service. + */ +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore; diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/module-info.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/module-info.java new file mode 100644 index 000000000000..b3b982efdfbb --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/java/module-info.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore; + exports com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent; + exports com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models; + exports com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models; + + opens com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models to com.azure.core; + opens com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models to com.azure.core; + opens com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.models to com.azure.core; +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/META-INF/azure-resourcemanager-recoveryservicesbackupcrossregionrestore_metadata.json b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/META-INF/azure-resourcemanager-recoveryservicesbackupcrossregionrestore_metadata.json new file mode 100644 index 000000000000..609d0e52a886 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/META-INF/azure-resourcemanager-recoveryservicesbackupcrossregionrestore_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.RecoveryServices":"2026-07-15"},"crossLanguagePackageId":"Microsoft.RecoveryServices","crossLanguageVersion":"f755ab43fd38","crossLanguageDefinitions":{"com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.AadPropertiesOperationsClient":"Microsoft.RecoveryServices","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.AadPropertiesOperationsClient.get":"Microsoft.RecoveryServices.AadPropertiesOperationGroup.get","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.AadPropertiesOperationsClient.getWithResponse":"Microsoft.RecoveryServices.AadPropertiesOperationGroup.get","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupCrrJobDetailsClient":"Microsoft.RecoveryServices","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupCrrJobDetailsClient.get":"Microsoft.RecoveryServices.BackupCrrJobDetailsOperationGroup.get","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupCrrJobDetailsClient.getWithResponse":"Microsoft.RecoveryServices.BackupCrrJobDetailsOperationGroup.get","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupCrrJobsClient":"Microsoft.RecoveryServices","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupCrrJobsClient.list":"Microsoft.RecoveryServices.BackupCrrJobsOperationGroup.list","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupCrrJobsClient.listWithResponse":"Microsoft.RecoveryServices.BackupCrrJobsOperationGroup.list","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupProtectedItemsCrrsClient":"Microsoft.RecoveryServices","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupProtectedItemsCrrsClient.list":"Microsoft.RecoveryServices.BackupProtectedItemsCrrOperationGroup.list","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupProtectedItemsCrrsClient.listWithResponse":"Microsoft.RecoveryServices.BackupProtectedItemsCrrOperationGroup.list","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupResourceStorageConfigsClient":"Microsoft.RecoveryServices","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupResourceStorageConfigsClient.get":"Microsoft.RecoveryServices.BackupResourceConfigResources.get","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupResourceStorageConfigsClient.getWithResponse":"Microsoft.RecoveryServices.BackupResourceConfigResources.get","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupResourceStorageConfigsClient.patch":"Microsoft.RecoveryServices.BackupResourceConfigResources.patch","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupResourceStorageConfigsClient.patchWithResponse":"Microsoft.RecoveryServices.BackupResourceConfigResources.patch","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupResourceStorageConfigsClient.update":"Microsoft.RecoveryServices.BackupResourceConfigResources.update","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupResourceStorageConfigsClient.updateWithResponse":"Microsoft.RecoveryServices.BackupResourceConfigResources.update","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupUsageSummariesCRRsClient":"Microsoft.RecoveryServices","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupUsageSummariesCRRsClient.list":"Microsoft.RecoveryServices.BackupUsageSummariesCRROperationGroup.list","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.BackupUsageSummariesCRRsClient.listWithResponse":"Microsoft.RecoveryServices.BackupUsageSummariesCRROperationGroup.list","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrossRegionRestoresClient":"Microsoft.RecoveryServices","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrossRegionRestoresClient.trigger":"Microsoft.RecoveryServices.CrossRegionRestoreOperationGroup.trigger","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrossRegionRestoresClient.triggerWithResponse":"Microsoft.RecoveryServices.CrossRegionRestoreOperationGroup.trigger","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrrOperationResultsClient":"Microsoft.RecoveryServices","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrrOperationResultsClient.get":"Microsoft.RecoveryServices.CrrOperationResultsOperationGroup.get","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrrOperationResultsClient.getWithResponse":"Microsoft.RecoveryServices.CrrOperationResultsOperationGroup.get","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrrOperationStatusClient":"Microsoft.RecoveryServices","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrrOperationStatusClient.get":"Microsoft.RecoveryServices.CrrOperationStatusOperationGroup.get","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.CrrOperationStatusClient.getWithResponse":"Microsoft.RecoveryServices.CrrOperationStatusOperationGroup.get","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryPointsClient":"Microsoft.RecoveryServices","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryPointsClient.getAccessToken":"Microsoft.RecoveryServices.RecoveryPointGetAccessToken.getAccessToken","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryPointsClient.getAccessTokenWithResponse":"Microsoft.RecoveryServices.RecoveryPointGetAccessToken.getAccessToken","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryPointsCrrsClient":"Microsoft.RecoveryServices","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryPointsCrrsClient.get":"Microsoft.RecoveryServices.RecoveryPointResources.get","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryPointsCrrsClient.getWithResponse":"Microsoft.RecoveryServices.RecoveryPointResources.get","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryPointsCrrsClient.list":"Microsoft.RecoveryServices.RecoveryPointResources.list","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.RecoveryServicesBackupCrrManagementClient":"Microsoft.RecoveryServices","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.AADPropertiesResourceInner":"Microsoft.RecoveryServices.AADPropertiesResource","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupManagementUsageListInner":"Microsoft.RecoveryServices.BackupManagementUsageList","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupResourceConfigResourceInner":"Microsoft.RecoveryServices.BackupResourceConfigResource","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.CrrAccessTokenResourceInner":"Microsoft.RecoveryServices.CrrAccessTokenResource","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceInner":"Microsoft.RecoveryServices.JobResource","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceListInner":"Microsoft.RecoveryServices.JobResourceList","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.OperationStatusInner":"Microsoft.RecoveryServices.OperationStatus","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.ProtectedItemResourceListInner":"Microsoft.RecoveryServices.ProtectedItemResourceList","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.RecoveryPointResourceInner":"Microsoft.RecoveryServices.RecoveryPointResource","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.RecoveryServicesBackupCrrManagementClientBuilder":"Microsoft.RecoveryServices","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.models.RecoveryPointResourceList":"Microsoft.RecoveryServices.RecoveryPointResourceList","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AADProperties":"Microsoft.RecoveryServices.AADProperties","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ArmResource":"Azure.ResourceManager.CommonTypes.Resource","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureFileShareRecoveryPoint":"Microsoft.RecoveryServices.AzureFileShareRecoveryPoint","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureFileShareRestoreRequest":"Microsoft.RecoveryServices.AzureFileShareRestoreRequest","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureFileshareProtectedItem":"Microsoft.RecoveryServices.AzureFileshareProtectedItem","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureFileshareProtectedItemExtendedInfo":"Microsoft.RecoveryServices.AzureFileshareProtectedItemExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureIaaSClassicComputeVMProtectedItem":"Microsoft.RecoveryServices.AzureIaaSClassicComputeVMProtectedItem","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureIaaSComputeVMProtectedItem":"Microsoft.RecoveryServices.AzureIaaSComputeVMProtectedItem","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureIaaSVMErrorInfo":"Microsoft.RecoveryServices.AzureIaaSVMErrorInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureIaaSVMHealthDetails":"Microsoft.RecoveryServices.AzureIaaSVMHealthDetails","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureIaaSVMJob":"Microsoft.RecoveryServices.AzureIaaSVMJob","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureIaaSVMJobExtendedInfo":"Microsoft.RecoveryServices.AzureIaaSVMJobExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureIaaSVMJobTaskDetails":"Microsoft.RecoveryServices.AzureIaaSVMJobTaskDetails","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureIaaSVMProtectedItem":"Microsoft.RecoveryServices.AzureIaaSVMProtectedItem","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureIaaSVMProtectedItemExtendedInfo":"Microsoft.RecoveryServices.AzureIaaSVMProtectedItemExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureSqlProtectedItem":"Microsoft.RecoveryServices.AzureSqlProtectedItem","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureSqlProtectedItemExtendedInfo":"Microsoft.RecoveryServices.AzureSqlProtectedItemExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureStorageErrorInfo":"Microsoft.RecoveryServices.AzureStorageErrorInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureStorageJob":"Microsoft.RecoveryServices.AzureStorageJob","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureStorageJobExtendedInfo":"Microsoft.RecoveryServices.AzureStorageJobExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureStorageJobTaskDetails":"Microsoft.RecoveryServices.AzureStorageJobTaskDetails","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureVmWorkloadProtectedItem":"Microsoft.RecoveryServices.AzureVmWorkloadProtectedItem","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureVmWorkloadProtectedItemExtendedInfo":"Microsoft.RecoveryServices.AzureVmWorkloadProtectedItemExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureVmWorkloadSAPAseDatabaseProtectedItem":"Microsoft.RecoveryServices.AzureVmWorkloadSAPAseDatabaseProtectedItem","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureVmWorkloadSAPHanaDatabaseProtectedItem":"Microsoft.RecoveryServices.AzureVmWorkloadSAPHanaDatabaseProtectedItem","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureVmWorkloadSQLDatabaseProtectedItem":"Microsoft.RecoveryServices.AzureVmWorkloadSQLDatabaseProtectedItem","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadErrorInfo":"Microsoft.RecoveryServices.AzureWorkloadErrorInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadJob":"Microsoft.RecoveryServices.AzureWorkloadJob","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadJobExtendedInfo":"Microsoft.RecoveryServices.AzureWorkloadJobExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadJobTaskDetails":"Microsoft.RecoveryServices.AzureWorkloadJobTaskDetails","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadPointInTimeRecoveryPoint":"Microsoft.RecoveryServices.AzureWorkloadPointInTimeRecoveryPoint","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadPointInTimeRestoreRequest":"Microsoft.RecoveryServices.AzureWorkloadPointInTimeRestoreRequest","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadRecoveryPoint":"Microsoft.RecoveryServices.AzureWorkloadRecoveryPoint","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadRestoreRequest":"Microsoft.RecoveryServices.AzureWorkloadRestoreRequest","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadSAPHanaPointInTimeRecoveryPoint":"Microsoft.RecoveryServices.AzureWorkloadSAPHanaPointInTimeRecoveryPoint","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadSAPHanaPointInTimeRestoreRequest":"Microsoft.RecoveryServices.AzureWorkloadSAPHanaPointInTimeRestoreRequest","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadSAPHanaRecoveryPoint":"Microsoft.RecoveryServices.AzureWorkloadSAPHanaRecoveryPoint","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadSAPHanaRestoreRequest":"Microsoft.RecoveryServices.AzureWorkloadSAPHanaRestoreRequest","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadSQLPointInTimeRecoveryPoint":"Microsoft.RecoveryServices.AzureWorkloadSQLPointInTimeRecoveryPoint","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadSQLPointInTimeRestoreRequest":"Microsoft.RecoveryServices.AzureWorkloadSQLPointInTimeRestoreRequest","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadSQLRecoveryPoint":"Microsoft.RecoveryServices.AzureWorkloadSQLRecoveryPoint","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadSQLRecoveryPointExtendedInfo":"Microsoft.RecoveryServices.AzureWorkloadSQLRecoveryPointExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadSQLRestoreRequest":"Microsoft.RecoveryServices.AzureWorkloadSQLRestoreRequest","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BEKDetails":"Microsoft.RecoveryServices.BEKDetails","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementType":"Microsoft.RecoveryServices.BackupManagementType","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementUsage":"Microsoft.RecoveryServices.BackupManagementUsage","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupResourceConfig":"Microsoft.RecoveryServices.BackupResourceConfig","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ClientScriptForConnect":"Microsoft.RecoveryServices.ClientScriptForConnect","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CopyOptions":"Microsoft.RecoveryServices.CopyOptions","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CreateMode":"Microsoft.RecoveryServices.CreateMode","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrossRegionRestoreRequest":"Microsoft.RecoveryServices.CrossRegionRestoreRequest","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrAccessToken":"Microsoft.RecoveryServices.CrrAccessToken","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrJobRequest":"Microsoft.RecoveryServices.CrrJobRequest","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DPMProtectedItem":"Microsoft.RecoveryServices.DPMProtectedItem","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DPMProtectedItemExtendedInfo":"Microsoft.RecoveryServices.DPMProtectedItemExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DataSourceType":"Microsoft.RecoveryServices.DataSourceType","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DiskExclusionProperties":"Microsoft.RecoveryServices.DiskExclusionProperties","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DiskInformation":"Microsoft.RecoveryServices.DiskInformation","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DpmErrorInfo":"Microsoft.RecoveryServices.DpmErrorInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DpmJob":"Microsoft.RecoveryServices.DpmJob","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DpmJobExtendedInfo":"Microsoft.RecoveryServices.DpmJobExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DpmJobTaskDetails":"Microsoft.RecoveryServices.DpmJobTaskDetails","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.EncryptionDetails":"Microsoft.RecoveryServices.EncryptionDetails","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ErrorDetail":"Microsoft.RecoveryServices.ErrorDetail","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ExtendedProperties":"Microsoft.RecoveryServices.ExtendedProperties","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.GenericProtectedItem":"Microsoft.RecoveryServices.GenericProtectedItem","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.GenericRecoveryPoint":"Microsoft.RecoveryServices.GenericRecoveryPoint","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.HealthStatus":"Microsoft.RecoveryServices.HealthStatus","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.IaasVMRecoveryPoint":"Microsoft.RecoveryServices.IaasVMRecoveryPoint","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.IaasVMRestoreRequest":"Microsoft.RecoveryServices.IaasVMRestoreRequest","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.IdentityBasedRestoreDetails":"Microsoft.RecoveryServices.IdentityBasedRestoreDetails","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.IdentityInfo":"Microsoft.RecoveryServices.IdentityInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.InstantItemRecoveryTarget":"Microsoft.RecoveryServices.InstantItemRecoveryTarget","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.Job":"Microsoft.RecoveryServices.Job","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.JobSupportedAction":"Microsoft.RecoveryServices.JobSupportedAction","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.KEKDetails":"Microsoft.RecoveryServices.KEKDetails","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.KPIResourceHealthDetails":"Microsoft.RecoveryServices.KPIResourceHealthDetails","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.KeyAndSecretDetails":"Microsoft.RecoveryServices.KeyAndSecretDetails","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.LastBackupStatus":"Microsoft.RecoveryServices.LastBackupStatus","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.MabErrorInfo":"Microsoft.RecoveryServices.MabErrorInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.MabFileFolderProtectedItem":"Microsoft.RecoveryServices.MabFileFolderProtectedItem","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.MabFileFolderProtectedItemExtendedInfo":"Microsoft.RecoveryServices.MabFileFolderProtectedItemExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.MabJob":"Microsoft.RecoveryServices.MabJob","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.MabJobExtendedInfo":"Microsoft.RecoveryServices.MabJobExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.MabJobTaskDetails":"Microsoft.RecoveryServices.MabJobTaskDetails","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.MabServerType":"Microsoft.RecoveryServices.MabServerType","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.NameInfo":"Microsoft.RecoveryServices.NameInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatusError":"Microsoft.RecoveryServices.OperationStatusError","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatusExtendedInfo":"Microsoft.RecoveryServices.OperationStatusExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatusJobExtendedInfo":"Microsoft.RecoveryServices.OperationStatusJobExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatusJobsExtendedInfo":"Microsoft.RecoveryServices.OperationStatusJobsExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatusProvisionILRExtendedInfo":"Microsoft.RecoveryServices.OperationStatusProvisionILRExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatusRecoveryPointExtendedInfo":"Microsoft.RecoveryServices.OperationStatusRecoveryPointExtendedInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatusValues":"Microsoft.RecoveryServices.OperationStatusValues","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OverwriteOptions":"Microsoft.RecoveryServices.OverwriteOptions","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.PointInTimeRange":"Microsoft.RecoveryServices.PointInTimeRange","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ProtectedItem":"Microsoft.RecoveryServices.ProtectedItem","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ProtectedItemHealthStatus":"Microsoft.RecoveryServices.ProtectedItemHealthStatus","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ProtectedItemResource":"Microsoft.RecoveryServices.ProtectedItemResource","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ProtectedItemState":"Microsoft.RecoveryServices.ProtectedItemState","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ProtectionState":"Microsoft.RecoveryServices.ProtectionState","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryMode":"Microsoft.RecoveryServices.RecoveryMode","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPoint":"Microsoft.RecoveryServices.RecoveryPoint","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPointDiskConfiguration":"Microsoft.RecoveryServices.RecoveryPointDiskConfiguration","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPointMoveReadinessInfo":"Microsoft.RecoveryServices.RecoveryPointMoveReadinessInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPointProperties":"Microsoft.RecoveryServices.RecoveryPointProperties","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPointTierInformation":"Microsoft.RecoveryServices.RecoveryPointTierInformation","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPointTierStatus":"Microsoft.RecoveryServices.RecoveryPointTierStatus","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPointTierType":"Microsoft.RecoveryServices.RecoveryPointTierType","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryType":"Microsoft.RecoveryServices.RecoveryType","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ResourceHealthDetails":"Microsoft.RecoveryServices.ResourceHealthDetails","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ResourceHealthStatus":"Microsoft.RecoveryServices.ResourceHealthStatus","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ResourceList":"Microsoft.RecoveryServices.ResourceList","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RestoreFileSpecs":"Microsoft.RecoveryServices.RestoreFileSpecs","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RestorePointType":"Microsoft.RecoveryServices.RestorePointType","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RestoreRequest":"Microsoft.RecoveryServices.RestoreRequest","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RestoreRequestType":"Microsoft.RecoveryServices.RestoreRequestType","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.SQLDataDirectory":"Microsoft.RecoveryServices.SQLDataDirectory","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.SQLDataDirectoryMapping":"Microsoft.RecoveryServices.SQLDataDirectoryMapping","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.SQLDataDirectoryType":"Microsoft.RecoveryServices.SQLDataDirectoryType","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.StorageType":"Microsoft.RecoveryServices.StorageType","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.StorageTypeState":"Microsoft.RecoveryServices.StorageTypeState","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.TargetAFSRestoreInfo":"Microsoft.RecoveryServices.TargetAFSRestoreInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.TargetRestoreInfo":"Microsoft.RecoveryServices.TargetRestoreInfo","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.UsagesUnit":"Microsoft.RecoveryServices.UsagesUnit","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.WorkloadCrrAccessToken":"Microsoft.RecoveryServices.WorkloadCrrAccessToken","com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.WorkloadType":"Microsoft.RecoveryServices.WorkloadType"},"generatedFiles":["src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/RecoveryServicesBackupCrrManager.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/AadPropertiesOperationsClient.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupCrrJobDetailsClient.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupCrrJobsClient.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupProtectedItemsCrrsClient.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupResourceStorageConfigsClient.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/BackupUsageSummariesCRRsClient.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrossRegionRestoresClient.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrrOperationResultsClient.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/CrrOperationStatusClient.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryPointsClient.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryPointsCrrsClient.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/RecoveryServicesBackupCrrManagementClient.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/AADPropertiesResourceInner.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/BackupManagementUsageListInner.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/BackupResourceConfigResourceInner.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/CrrAccessTokenResourceInner.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/JobResourceInner.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/JobResourceListInner.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/OperationStatusInner.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/ProtectedItemResourceListInner.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/RecoveryPointResourceInner.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/fluent/package-info.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AADPropertiesResourceImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AadPropertiesOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/AadPropertiesOperationsImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobDetailsClientImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobDetailsImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobsClientImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupCrrJobsImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupManagementUsageListImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupProtectedItemsCrrsClientImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupProtectedItemsCrrsImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceConfigResourceImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceStorageConfigsClientImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupResourceStorageConfigsImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupUsageSummariesCRRsClientImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/BackupUsageSummariesCRRsImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrossRegionRestoresClientImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrossRegionRestoresImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrAccessTokenResourceImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationResultsClientImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationResultsImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationStatusClientImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/CrrOperationStatusImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/JobResourceImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/JobResourceListImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/OperationStatusImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/ProtectedItemResourceListImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointResourceImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsClientImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsCrrsClientImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsCrrsImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryPointsImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryServicesBackupCrrManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/RecoveryServicesBackupCrrManagementClientImpl.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/models/RecoveryPointResourceList.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/implementation/package-info.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AADProperties.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AADPropertiesResource.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AadPropertiesOperations.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ArmResource.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileShareRecoveryPoint.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileShareRestoreRequest.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileshareProtectedItem.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureFileshareProtectedItemExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSClassicComputeVMProtectedItem.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSComputeVMProtectedItem.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMErrorInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMHealthDetails.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJob.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJobExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMJobTaskDetails.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMProtectedItem.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureIaaSVMProtectedItemExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureSqlProtectedItem.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureSqlProtectedItemExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageErrorInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJob.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJobExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureStorageJobTaskDetails.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadProtectedItem.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadProtectedItemExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSAPAseDatabaseProtectedItem.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureVmWorkloadSQLDatabaseProtectedItem.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadErrorInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJob.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJobExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadJobTaskDetails.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadPointInTimeRecoveryPoint.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadPointInTimeRestoreRequest.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadRecoveryPoint.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadRestoreRequest.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaPointInTimeRestoreRequest.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaRecoveryPoint.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSAPHanaRestoreRequest.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLPointInTimeRecoveryPoint.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLPointInTimeRestoreRequest.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRecoveryPoint.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRecoveryPointExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/AzureWorkloadSQLRestoreRequest.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BEKDetails.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupCrrJobDetails.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupCrrJobs.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementType.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementUsage.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupManagementUsageList.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupProtectedItemsCrrs.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceConfig.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceConfigResource.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupResourceStorageConfigs.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/BackupUsageSummariesCRRs.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ClientScriptForConnect.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CopyOptions.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CreateMode.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrossRegionRestoreRequest.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrossRegionRestores.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrAccessToken.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrAccessTokenResource.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrJobRequest.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrOperationResults.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/CrrOperationStatus.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DPMProtectedItem.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DPMProtectedItemExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DataSourceType.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DiskExclusionProperties.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DiskInformation.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmErrorInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJob.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJobExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/DpmJobTaskDetails.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/EncryptionDetails.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ErrorDetail.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ExtendedProperties.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/GenericProtectedItem.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/GenericRecoveryPoint.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/HealthStatus.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IaasVMRecoveryPoint.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IaasVMRestoreRequest.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IdentityBasedRestoreDetails.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/IdentityInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/InstantItemRecoveryTarget.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/Job.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobResource.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobResourceList.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/JobSupportedAction.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KEKDetails.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KPIResourceHealthDetails.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/KeyAndSecretDetails.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/LastBackupStatus.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabErrorInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabFileFolderProtectedItem.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabFileFolderProtectedItemExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJob.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJobExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabJobTaskDetails.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/MabServerType.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/NameInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatus.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusError.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusJobExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusJobsExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusProvisionILRExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusRecoveryPointExtendedInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OperationStatusValues.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/OverwriteOptions.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/PointInTimeRange.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItem.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemHealthStatus.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemResource.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemResourceList.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectedItemState.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ProtectionState.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryMode.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPoint.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointDiskConfiguration.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointMoveReadinessInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointProperties.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointResource.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierInformation.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierStatus.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointTierType.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPoints.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryPointsCrrs.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RecoveryType.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceHealthDetails.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceHealthStatus.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/ResourceList.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreFileSpecs.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestorePointType.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreRequest.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/RestoreRequestType.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectory.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectoryMapping.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/SQLDataDirectoryType.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/StorageType.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/StorageTypeState.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/TargetAFSRestoreInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/TargetRestoreInfo.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/UsagesUnit.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/WorkloadCrrAccessToken.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/WorkloadType.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/models/package-info.java","src/main/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/META-INF/native-image/com.azure.resourcemanager/recoveryservicesbackupcrossregionrestore/proxy-config.json b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/META-INF/native-image/com.azure.resourcemanager/recoveryservicesbackupcrossregionrestore/proxy-config.json new file mode 100644 index 000000000000..290945a37472 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/META-INF/native-image/com.azure.resourcemanager/recoveryservicesbackupcrossregionrestore/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.AadPropertiesOperationsClientImpl$AadPropertiesOperationsService"],["com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.BackupCrrJobDetailsClientImpl$BackupCrrJobDetailsService"],["com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.BackupCrrJobsClientImpl$BackupCrrJobsService"],["com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.BackupProtectedItemsCrrsClientImpl$BackupProtectedItemsCrrsService"],["com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.BackupResourceStorageConfigsClientImpl$BackupResourceStorageConfigsService"],["com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.BackupUsageSummariesCRRsClientImpl$BackupUsageSummariesCRRsService"],["com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.CrossRegionRestoresClientImpl$CrossRegionRestoresService"],["com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.CrrOperationResultsClientImpl$CrrOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.CrrOperationStatusClientImpl$CrrOperationStatusService"],["com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.RecoveryPointsClientImpl$RecoveryPointsService"],["com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.implementation.RecoveryPointsCrrsClientImpl$RecoveryPointsCrrsService"]] \ No newline at end of file diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/META-INF/native-image/com.azure.resourcemanager/recoveryservicesbackupcrossregionrestore/reflect-config.json b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/META-INF/native-image/com.azure.resourcemanager/recoveryservicesbackupcrossregionrestore/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/META-INF/native-image/com.azure.resourcemanager/recoveryservicesbackupcrossregionrestore/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/azure-resourcemanager-recoveryservicesbackupcrossregionrestore.properties b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/azure-resourcemanager-recoveryservicesbackupcrossregionrestore.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/main/resources/azure-resourcemanager-recoveryservicesbackupcrossregionrestore.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AadPropeSamples.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AadPropeSamples.java new file mode 100644 index 000000000000..366dddd6fe77 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AadPropeSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +/** + * Samples for AadPropertiesOperation Get. + */ +public final class AadPropeSamples { + /* + * x-ms-original-file: 2026-07-15/AzureIaasVm/BackupAadProperties_Get.json + */ + /** + * Sample code: Get AAD Properties for authentication in the third region. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void getAADPropertiesForAuthenticationInTheThirdRegion( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.aadPropertiesOperations().getWithResponse("southeastasia", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupCrSamples.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupCrSamples.java new file mode 100644 index 000000000000..413da98ce6e2 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupCrSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrJobRequest; + +/** + * Samples for BackupCrrJobDetails Get. + */ +public final class BackupCrSamples { + /* + * x-ms-original-file: 2026-07-15/AzureIaasVm/GetCrrJob_Post.json + */ + /** + * Sample code: Get Cross Region Restore Job Details in the secondary region. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void getCrossRegionRestoreJobDetailsInTheSecondaryRegion( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.backupCrrJobDetails() + .getWithResponse("southeastasia", new CrrJobRequest().withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Compute/VirtualMachines/testVm") + .withJobName("02585cc9-d7f4-4b46-860c-14c048cce178"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupPrSamples.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupPrSamples.java new file mode 100644 index 000000000000..719bd50d5218 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupPrSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +/** + * Samples for BackupProtectedItemsCrr List. + */ +public final class BackupPrSamples { + /* + * x-ms-original-file: 2026-07-15/AzureIaasVm/BackupProtectedItems_List.json + */ + /** + * Sample code: List protected items with backupManagementType filter as AzureIaasVm. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void listProtectedItemsWithBackupManagementTypeFilterAsAzureIaasVm( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.backupProtectedItemsCrrs() + .listWithResponse("SwaggerTestRg", "NetSDKTestRsVault", + "backupManagementType eq 'AzureIaasVM' and itemType eq 'VM'", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupReSamples.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupReSamples.java new file mode 100644 index 000000000000..cc6e3978d14c --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupReSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +/** + * Samples for BackupResourceStorageConfigs Get. + */ +public final class BackupReSamples { + /* + * x-ms-original-file: 2026-07-15/Common/BackupStorageConfig_Get.json + */ + /** + * Sample code: Get Vault Storage Configuration. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void getVaultStorageConfiguration( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.backupResourceStorageConfigs() + .getWithResponse("PythonSDKBackupTestRg", "PySDKBackupTestRsVault", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupUsSamples.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupUsSamples.java new file mode 100644 index 000000000000..b6b2a4e56683 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupUsSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +/** + * Samples for BackupUsageSummariesCRR List. + */ +public final class BackupUsSamples { + /* + * x-ms-original-file: 2026-07-15/Common/BackupProtectedItem_UsageSummary_Get.json + */ + /** + * Sample code: Get Protected Items Usages Summary. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void getProtectedItemsUsagesSummary( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.backupUsageSummariesCRRs() + .listWithResponse("testRG", "testVault", "type eq 'BackupProtectedItemCountSummary'", null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-15/Common/BackupProtectionContainers_UsageSummary_Get.json + */ + /** + * Sample code: Get Protected Containers Usages Summary. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void getProtectedContainersUsagesSummary( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.backupUsageSummariesCRRs() + .listWithResponse("testRG", "testVault", "type eq 'BackupProtectionContainerCountSummary'", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrossRegSamples.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrossRegSamples.java new file mode 100644 index 000000000000..8a937fdae829 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrossRegSamples.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrossRegionRestoreRequest; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.EncryptionDetails; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.IaasVMRestoreRequest; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.IdentityBasedRestoreDetails; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.IdentityInfo; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.WorkloadCrrAccessToken; +import java.util.Arrays; + +/** + * Samples for CrossRegionRestore Trigger. + */ +public final class CrossRegSamples { + /* + * x-ms-original-file: 2026-07-15/AzureIaasVm/TriggerCrossRegionRestore_Post.json + */ + /** + * Sample code: Trigger Cross Region Restore. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void triggerCrossRegionRestore( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.crossRegionRestores() + .triggerWithResponse("southeastasia", new CrossRegionRestoreRequest() + .withCrossRegionRestoreAccessDetails( + new WorkloadCrrAccessToken().withAccessTokenString("fakeTokenPlaceholder") + .withSubscriptionId("f2edfd5d-5496-4683-b94f-b3588c579009") + .withResourceGroupName("srinivasccyrg") + .withResourceName("sriniccyvault") + .withResourceId("1330837906418138160") + .withRecoveryPointId("87178355392716") + .withRecoveryPointTime("10/9/2019 6:05:54 PM") + .withContainerName("iaasvmcontainerv2;srinivasccyrg;sriniccylinux") + .withContainerType("IaasVMContainer") + .withBackupManagementType("AzureIaasVM") + .withDatasourceType("VM") + .withDatasourceName("sriniccylinux") + .withDatasourceId("1142937031") + .withDatasourceContainerName("iaasvmcontainerv2;srinivasccyrg;sriniccylinux") + .withCoordinatorServiceStampUri("https://pod01-coord1.ccy.backup.windowsazure.com") + .withProtectionServiceStampId("90d98224-2ac6-4bda-9f35-33fb22841f2a") + .withProtectionServiceStampUri("https://pod01-prot1-int.ccy.backup.windowsazure.com") + .withTokenExtendedInformation("fakeTokenPlaceholder")) + .withRestoreRequest(new IaasVMRestoreRequest().withRecoveryPointId("87178355392716") + .withRecoveryType(RecoveryType.ALTERNATE_LOCATION) + .withSourceResourceId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/srinivasccyrg/providers/Microsoft.Compute/virtualMachines/sriniccylinux") + .withTargetVirtualMachineId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAckl/providers/Microsoft.Compute/virtualMachines/gaallaVM") + .withTargetResourceGroupId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAckl") + .withStorageAccountId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00prjaiTestRg1/providers/Microsoft.Storage/storageAccounts/00prjaitestrg1disks993") + .withVirtualNetworkId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAcklVaultCCY/providers/Microsoft.Network/virtualNetworks/00networkAcklVaultCCY-vnet") + .withSubnetId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAcklVaultCCY/providers/Microsoft.Network/virtualNetworks/00networkAcklVaultCCY-vnet/subnets/default") + .withRegion("eastus2euap") + .withAffinityGroup("") + .withCreateNewCloudService(false) + .withOriginalStorageAccountOption(false) + .withEncryptionDetails(new EncryptionDetails().withEncryptionEnabled(false)) + .withZones(Arrays.asList("2")) + .withIdentityInfo(new IdentityInfo().withIsSystemAssignedIdentity(false) + .withManagedIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-15/AzureIaasVm/TriggerCrossRegionRestore_IdentityBasedRestoreDetails_Post.json + */ + /** + * Sample code: Trigger Cross Region Restore with identityBasedRestoreDetails. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void triggerCrossRegionRestoreWithIdentityBasedRestoreDetails( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.crossRegionRestores() + .triggerWithResponse("southeastasia", new CrossRegionRestoreRequest() + .withCrossRegionRestoreAccessDetails( + new WorkloadCrrAccessToken().withAccessTokenString("fakeTokenPlaceholder") + .withSubscriptionId("f2edfd5d-5496-4683-b94f-b3588c579009") + .withResourceGroupName("srinivasccyrg") + .withResourceName("sriniccyvault") + .withResourceId("1330837906418138160") + .withRecoveryPointId("87178355392716") + .withRecoveryPointTime("10/9/2019 6:05:54 PM") + .withContainerName("iaasvmcontainerv2;srinivasccyrg;sriniccylinux") + .withContainerType("IaasVMContainer") + .withBackupManagementType("AzureIaasVM") + .withDatasourceType("VM") + .withDatasourceName("sriniccylinux") + .withDatasourceId("1142937031") + .withDatasourceContainerName("iaasvmcontainerv2;srinivasccyrg;sriniccylinux") + .withCoordinatorServiceStampUri("https://pod01-coord1.ccy.backup.windowsazure.com") + .withProtectionServiceStampId("90d98224-2ac6-4bda-9f35-33fb22841f2a") + .withProtectionServiceStampUri("https://pod01-prot1-int.ccy.backup.windowsazure.com") + .withTokenExtendedInformation("fakeTokenPlaceholder")) + .withRestoreRequest(new IaasVMRestoreRequest().withRecoveryPointId("87178355392716") + .withRecoveryType(RecoveryType.ALTERNATE_LOCATION) + .withSourceResourceId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/srinivasccyrg/providers/Microsoft.Compute/virtualMachines/sriniccylinux") + .withTargetVirtualMachineId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAckl/providers/Microsoft.Compute/virtualMachines/gaallaVM") + .withTargetResourceGroupId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAckl") + .withVirtualNetworkId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAcklVaultCCY/providers/Microsoft.Network/virtualNetworks/00networkAcklVaultCCY-vnet") + .withSubnetId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAcklVaultCCY/providers/Microsoft.Network/virtualNetworks/00networkAcklVaultCCY-vnet/subnets/default") + .withRegion("eastus2euap") + .withAffinityGroup("") + .withCreateNewCloudService(false) + .withOriginalStorageAccountOption(false) + .withEncryptionDetails(new EncryptionDetails().withEncryptionEnabled(false)) + .withZones(Arrays.asList("2")) + .withIdentityInfo(new IdentityInfo().withIsSystemAssignedIdentity(false) + .withManagedIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi")) + .withIdentityBasedRestoreDetails(new IdentityBasedRestoreDetails().withTargetStorageAccountId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00prjaiTestRg1/providers/Microsoft.Storage/storageAccounts/00prjaitestrg1disks993"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrrOperaSamples.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrrOperaSamples.java new file mode 100644 index 000000000000..013b0aea6a21 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrrOperaSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +/** + * Samples for CrrOperationResults Get. + */ +public final class CrrOperaSamples { + /* + * x-ms-original-file: 2026-07-15/AzureIaasVm/GetCrrOperationResults_Get.json + */ + /** + * Sample code: Get Operation Results for Cross Region Restore. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void getOperationResultsForCrossRegionRestore( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.crrOperationResults() + .getWithResponse("southeastasia", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RecoverySamples.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RecoverySamples.java new file mode 100644 index 000000000000..e08de54f3194 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/samples/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RecoverySamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.AADPropertiesResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AADProperties; + +/** + * Samples for RecoveryPoints GetAccessToken. + */ +public final class RecoverySamples { + /* + * x-ms-original-file: 2026-07-15/AzureIaasVm/GetAccessToken_Get.json + */ + /** + * Sample code: Get Access Token for Crr. + * + * @param manager Entry point to RecoveryServicesBackupCrrManager. + */ + public static void getAccessTokenForCrr( + com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager manager) { + manager.recoveryPoints() + .getAccessTokenWithResponse("rshhtestmdvmrg", "rshvault", "Azure", + "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", + "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", "26083826328862", + new AADPropertiesResourceInner() + .withProperties(new AADProperties().withTenantId("33e01921-4d64-4f8c-a055-5bdaffd5e33d") + .withAudience("https://RecoveryServices/IaasCoord/aadmgmt/ase") + .withServicePrincipalObjectId("5ecd8123-cf74-4037-83e9-9246b227b351")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AADPropertiesTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AADPropertiesTests.java new file mode 100644 index 000000000000..80a0e50aa99b --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AADPropertiesTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.AADPropertiesResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AADProperties; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class AADPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AADPropertiesResourceInner model = BinaryData.fromString( + "{\"properties\":{\"servicePrincipalClientId\":\"sle\",\"tenantId\":\"vxyqjpkcattpngjc\",\"authority\":\"czsqpjhvm\",\"audience\":\"jvnysounqe\",\"servicePrincipalObjectId\":\"noae\"},\"eTag\":\"fhyhltrpmopjmcma\",\"location\":\"u\",\"tags\":{\"kvxod\":\"hfuiuaodsfc\",\"bezy\":\"uozmyzydagfua\",\"wqsmbsur\":\"uokktwhrdxwz\",\"ryocfsfksymdd\":\"xim\"},\"id\":\"stkiiuxhqyud\",\"name\":\"o\",\"type\":\"rq\"}") + .toObject(AADPropertiesResourceInner.class); + Assertions.assertEquals("u", model.location()); + Assertions.assertEquals("hfuiuaodsfc", model.tags().get("kvxod")); + Assertions.assertEquals("sle", model.properties().servicePrincipalClientId()); + Assertions.assertEquals("vxyqjpkcattpngjc", model.properties().tenantId()); + Assertions.assertEquals("czsqpjhvm", model.properties().authority()); + Assertions.assertEquals("jvnysounqe", model.properties().audience()); + Assertions.assertEquals("noae", model.properties().servicePrincipalObjectId()); + Assertions.assertEquals("fhyhltrpmopjmcma", model.eTag()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AADPropertiesResourceInner model = new AADPropertiesResourceInner().withLocation("u") + .withTags(mapOf("kvxod", "hfuiuaodsfc", "bezy", "uozmyzydagfua", "wqsmbsur", "uokktwhrdxwz", + "ryocfsfksymdd", "xim")) + .withProperties(new AADProperties().withServicePrincipalClientId("sle") + .withTenantId("vxyqjpkcattpngjc") + .withAuthority("czsqpjhvm") + .withAudience("jvnysounqe") + .withServicePrincipalObjectId("noae")) + .withETag("fhyhltrpmopjmcma"); + model = BinaryData.fromObject(model).toObject(AADPropertiesResourceInner.class); + Assertions.assertEquals("u", model.location()); + Assertions.assertEquals("hfuiuaodsfc", model.tags().get("kvxod")); + Assertions.assertEquals("sle", model.properties().servicePrincipalClientId()); + Assertions.assertEquals("vxyqjpkcattpngjc", model.properties().tenantId()); + Assertions.assertEquals("czsqpjhvm", model.properties().authority()); + Assertions.assertEquals("jvnysounqe", model.properties().audience()); + Assertions.assertEquals("noae", model.properties().servicePrincipalObjectId()); + Assertions.assertEquals("fhyhltrpmopjmcma", model.eTag()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AadProperMockTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AadProperMockTests.java new file mode 100644 index 000000000000..803ee1051d42 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AadProperMockTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AADPropertiesResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AadProperMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"servicePrincipalClientId\":\"wvvb\",\"tenantId\":\"xlllchp\",\"authority\":\"bzevwrd\",\"audience\":\"fukuvsjcswsmystu\",\"servicePrincipalObjectId\":\"qypfcv\"},\"eTag\":\"rchpqbmfpjbabwid\",\"location\":\"cxsspuunnoxyh\",\"tags\":{\"dao\":\"qddrihpfhoqcaae\"},\"id\":\"djvlpj\",\"name\":\"xkzb\",\"type\":\"msgeivsiykzk\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupCrrManager manager = RecoveryServicesBackupCrrManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AADPropertiesResource response = manager.aadPropertiesOperations() + .getWithResponse("yhddvia", "egfnmntfpmvmemfn", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("cxsspuunnoxyh", response.location()); + Assertions.assertEquals("qddrihpfhoqcaae", response.tags().get("dao")); + Assertions.assertEquals("wvvb", response.properties().servicePrincipalClientId()); + Assertions.assertEquals("xlllchp", response.properties().tenantId()); + Assertions.assertEquals("bzevwrd", response.properties().authority()); + Assertions.assertEquals("fukuvsjcswsmystu", response.properties().audience()); + Assertions.assertEquals("qypfcv", response.properties().servicePrincipalObjectId()); + Assertions.assertEquals("rchpqbmfpjbabwid", response.eTag()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ArmResourceTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ArmResourceTests.java new file mode 100644 index 000000000000..fb3f6d75ce52 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ArmResourceTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ArmResource; + +public final class ArmResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ArmResource model = BinaryData.fromString("{\"id\":\"gnufoooj\",\"name\":\"ifsqesaagdfmg\",\"type\":\"lhjxr\"}") + .toObject(ArmResource.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ArmResource model = new ArmResource(); + model = BinaryData.fromObject(model).toObject(ArmResource.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureFileSharTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureFileSharTests.java new file mode 100644 index 000000000000..30e9d00cb7ab --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureFileSharTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureFileShareRecoveryPoint; +import org.junit.jupiter.api.Assertions; + +public final class AzureFileSharTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AzureFileShareRecoveryPoint model = BinaryData.fromString( + "{\"objectType\":\"AzureFileShareRecoveryPoint\",\"recoveryPointType\":\"pewnw\",\"recoveryPointTime\":\"2021-10-24T12:50:40Z\",\"fileShareSnapshotUri\":\"jzyflu\",\"recoveryPointSizeInGB\":272665329,\"recoveryPointProperties\":{\"expiryTime\":\"ofcqhsm\",\"ruleName\":\"rkdtmlxh\",\"isSoftDeleted\":true}}") + .toObject(AzureFileShareRecoveryPoint.class); + Assertions.assertEquals("ofcqhsm", model.recoveryPointProperties().expiryTime()); + Assertions.assertEquals("rkdtmlxh", model.recoveryPointProperties().ruleName()); + Assertions.assertTrue(model.recoveryPointProperties().isSoftDeleted()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureFilesharTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureFilesharTests.java new file mode 100644 index 000000000000..b402774548a4 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureFilesharTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureFileshareProtectedItemExtendedInfo; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class AzureFilesharTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AzureFileshareProtectedItemExtendedInfo model = BinaryData.fromString( + "{\"oldestRecoveryPoint\":\"2021-05-22T23:16:36Z\",\"recoveryPointCount\":869640496,\"policyState\":\"v\",\"resourceState\":\"cyajguqf\",\"resourceStateSyncTime\":\"2021-07-13T08:21:12Z\"}") + .toObject(AzureFileshareProtectedItemExtendedInfo.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-22T23:16:36Z"), model.oldestRecoveryPoint()); + Assertions.assertEquals(869640496, model.recoveryPointCount()); + Assertions.assertEquals("v", model.policyState()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureIaaSVMJoTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureIaaSVMJoTests.java new file mode 100644 index 000000000000..47a1de359bfb --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureIaaSVMJoTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureIaaSVMJobExtendedInfo; +import java.time.Duration; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class AzureIaaSVMJoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AzureIaaSVMJobExtendedInfo model = BinaryData.fromString( + "{\"tasksList\":[{\"taskId\":\"rbpbewtghfgblcg\",\"startTime\":\"2021-05-16T18:46:25Z\",\"endTime\":\"2021-04-07T06:02:43Z\",\"instanceId\":\"qhjk\",\"duration\":\"PT192H52M16S\",\"status\":\"btn\",\"progressPercentage\":94.28330612334818,\"taskExecutionDetails\":\"wwaloayqcgwrt\"},{\"taskId\":\"uzgwyzmhtx\",\"startTime\":\"2021-10-09T13:49:19Z\",\"endTime\":\"2021-08-29T11:45:06Z\",\"instanceId\":\"avjcbpwx\",\"duration\":\"PT146H56M55S\",\"status\":\"knftguvriuh\",\"progressPercentage\":61.62360563052315,\"taskExecutionDetails\":\"yvxqtayriwwroy\"},{\"taskId\":\"exrmcqibycnojvk\",\"startTime\":\"2021-02-06T03:19:14Z\",\"endTime\":\"2021-10-05T16:59:27Z\",\"instanceId\":\"gzva\",\"duration\":\"PT114H39M34S\",\"status\":\"y\",\"progressPercentage\":89.94227289406008,\"taskExecutionDetails\":\"qzcjrvxdj\"}],\"propertyBag\":{\"vzunluthnnprnxi\":\"wlxkvugfhzovaw\",\"tskzbbtdzumveek\":\"eilpjzuaejxdu\"},\"internalPropertyBag\":{\"sjyofdx\":\"ozuhkfp\",\"oekqvk\":\"uusdttouwa\"},\"progressPercentage\":52.54369251409328,\"estimatedRemainingDuration\":\"vbxwyjsflhh\",\"dynamicErrorMessage\":\"aln\"}") + .toObject(AzureIaaSVMJobExtendedInfo.class); + Assertions.assertEquals("rbpbewtghfgblcg", model.tasksList().get(0).taskId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-16T18:46:25Z"), model.tasksList().get(0).startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-07T06:02:43Z"), model.tasksList().get(0).endTime()); + Assertions.assertEquals("qhjk", model.tasksList().get(0).instanceId()); + Assertions.assertEquals(Duration.parse("PT192H52M16S"), model.tasksList().get(0).duration()); + Assertions.assertEquals("btn", model.tasksList().get(0).status()); + Assertions.assertEquals(94.28330612334818D, model.tasksList().get(0).progressPercentage()); + Assertions.assertEquals("wwaloayqcgwrt", model.tasksList().get(0).taskExecutionDetails()); + Assertions.assertEquals("wlxkvugfhzovaw", model.propertyBag().get("vzunluthnnprnxi")); + Assertions.assertEquals("ozuhkfp", model.internalPropertyBag().get("sjyofdx")); + Assertions.assertEquals(52.54369251409328D, model.progressPercentage()); + Assertions.assertEquals("vbxwyjsflhh", model.estimatedRemainingDuration()); + Assertions.assertEquals("aln", model.dynamicErrorMessage()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureIaaSVMPrTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureIaaSVMPrTests.java new file mode 100644 index 000000000000..153d309c202b --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureIaaSVMPrTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureIaaSVMProtectedItemExtendedInfo; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class AzureIaaSVMPrTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AzureIaaSVMProtectedItemExtendedInfo model = BinaryData.fromString( + "{\"oldestRecoveryPoint\":\"2021-01-23T14:08:39Z\",\"recoveryPointCount\":1291517950,\"policyInconsistent\":true}") + .toObject(AzureIaaSVMProtectedItemExtendedInfo.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-23T14:08:39Z"), model.oldestRecoveryPoint()); + Assertions.assertEquals(1291517950, model.recoveryPointCount()); + Assertions.assertTrue(model.policyInconsistent()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureSqlProteTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureSqlProteTests.java new file mode 100644 index 000000000000..19b975be3435 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureSqlProteTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureSqlProtectedItem; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CreateMode; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DataSourceType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ProtectedItemState; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class AzureSqlProteTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AzureSqlProtectedItem model = BinaryData.fromString( + "{\"protectedItemType\":\"Microsoft.Sql/servers/databases\",\"protectedItemDataId\":\"nrvgoupmfiibfgg\",\"protectionState\":\"Invalid\",\"extendedInfo\":{\"oldestRecoveryPoint\":\"2021-04-15T19:39:33Z\",\"recoveryPointCount\":330800818,\"policyState\":\"kvtkkg\"},\"backupManagementType\":\"AzureSql\",\"workloadType\":\"SQLDB\",\"containerName\":\"gvjayvblmh\",\"sourceResourceId\":\"zuhbxvvyhgsopb\",\"policyId\":\"qufegxuvwzfbn\",\"lastRecoveryPoint\":\"2021-08-15T03:14:49Z\",\"backupSetName\":\"tlpdn\",\"createMode\":\"Default\",\"deferredDeleteTimeInUTC\":\"2021-08-07T08:23:49Z\",\"isScheduledForDeferredDelete\":true,\"deferredDeleteTimeRemaining\":\"rixkwmyijejve\",\"isDeferredDeleteScheduleUpcoming\":true,\"isRehydrate\":false,\"resourceGuardOperationRequests\":[\"ixexcc\",\"dreaxh\",\"exdrrvqahqkg\",\"tpwijnh\"]}") + .toObject(AzureSqlProtectedItem.class); + Assertions.assertEquals(BackupManagementType.AZURE_SQL, model.backupManagementType()); + Assertions.assertEquals(DataSourceType.SQLDB, model.workloadType()); + Assertions.assertEquals("gvjayvblmh", model.containerName()); + Assertions.assertEquals("zuhbxvvyhgsopb", model.sourceResourceId()); + Assertions.assertEquals("qufegxuvwzfbn", model.policyId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-15T03:14:49Z"), model.lastRecoveryPoint()); + Assertions.assertEquals("tlpdn", model.backupSetName()); + Assertions.assertEquals(CreateMode.DEFAULT, model.createMode()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-07T08:23:49Z"), model.deferredDeleteTimeInUTC()); + Assertions.assertTrue(model.isScheduledForDeferredDelete()); + Assertions.assertEquals("rixkwmyijejve", model.deferredDeleteTimeRemaining()); + Assertions.assertTrue(model.isDeferredDeleteScheduleUpcoming()); + Assertions.assertFalse(model.isRehydrate()); + Assertions.assertEquals("ixexcc", model.resourceGuardOperationRequests().get(0)); + Assertions.assertEquals("nrvgoupmfiibfgg", model.protectedItemDataId()); + Assertions.assertEquals(ProtectedItemState.INVALID, model.protectionState()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T19:39:33Z"), + model.extendedInfo().oldestRecoveryPoint()); + Assertions.assertEquals(330800818, model.extendedInfo().recoveryPointCount()); + Assertions.assertEquals("kvtkkg", model.extendedInfo().policyState()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureStorageJTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureStorageJTests.java new file mode 100644 index 000000000000..22723742d2c9 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureStorageJTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureStorageJobExtendedInfo; +import org.junit.jupiter.api.Assertions; + +public final class AzureStorageJTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AzureStorageJobExtendedInfo model = BinaryData.fromString( + "{\"tasksList\":[{\"taskId\":\"xmedjvcsly\",\"status\":\"wwncwzzhxgk\"},{\"taskId\":\"mgucna\",\"status\":\"t\"},{\"taskId\":\"ellwptfdy\",\"status\":\"fqbuaceopzf\"},{\"taskId\":\"hhuao\",\"status\":\"pcqeqx\"}],\"propertyBag\":{\"kdmoi\":\"dahzxctobg\"},\"dynamicErrorMessage\":\"ostmgrcf\"}") + .toObject(AzureStorageJobExtendedInfo.class); + Assertions.assertEquals("xmedjvcsly", model.tasksList().get(0).taskId()); + Assertions.assertEquals("wwncwzzhxgk", model.tasksList().get(0).status()); + Assertions.assertEquals("dahzxctobg", model.propertyBag().get("kdmoi")); + Assertions.assertEquals("ostmgrcf", model.dynamicErrorMessage()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureVmWorkloTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureVmWorkloTests.java new file mode 100644 index 000000000000..2b2d60ff7280 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureVmWorkloTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureVmWorkloadProtectedItemExtendedInfo; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class AzureVmWorkloTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AzureVmWorkloadProtectedItemExtendedInfo model = BinaryData.fromString( + "{\"oldestRecoveryPoint\":\"2021-05-17T18:45:20Z\",\"recoveryPointCount\":1461211866,\"policyState\":\"o\"}") + .toObject(AzureVmWorkloadProtectedItemExtendedInfo.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-17T18:45:20Z"), model.oldestRecoveryPoint()); + Assertions.assertEquals(1461211866, model.recoveryPointCount()); + Assertions.assertEquals("o", model.policyState()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureWorkloadTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureWorkloadTests.java new file mode 100644 index 000000000000..835f0911dfce --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/AzureWorkloadTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.AzureWorkloadPointInTimeRecoveryPoint; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPointTierStatus; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPointTierType; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class AzureWorkloadTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AzureWorkloadPointInTimeRecoveryPoint model = BinaryData.fromString( + "{\"objectType\":\"AzureWorkloadPointInTimeRecoveryPoint\",\"timeRanges\":[{\"startTime\":\"2021-02-28T12:00:07Z\",\"endTime\":\"2021-07-12T07:08:41Z\"},{\"startTime\":\"2021-02-24T11:34:50Z\",\"endTime\":\"2021-09-01T13:50:11Z\"},{\"startTime\":\"2021-08-05T03:19:22Z\",\"endTime\":\"2021-07-10T03:20:03Z\"},{\"startTime\":\"2021-05-08T11:09:41Z\",\"endTime\":\"2021-09-15T08:01:43Z\"}],\"recoveryPointTimeInUTC\":\"2021-10-17T03:56:24Z\",\"type\":\"Full\",\"recoveryPointTierDetails\":[{\"type\":\"InstantRP\",\"status\":\"Deleted\",\"extendedInfo\":{\"mglzufcy\":\"ihfxtijbpzvgnwzs\",\"ufhfcbjysa\":\"kohdbiha\"}},{\"type\":\"Invalid\",\"status\":\"Invalid\",\"extendedInfo\":{\"npqxuh\":\"abifpikxwczbys\"}},{\"type\":\"Invalid\",\"status\":\"Valid\",\"extendedInfo\":{\"br\":\"b\"}}],\"recoveryPointMoveReadinessInfo\":{\"dcc\":{\"isReadyForMove\":true,\"additionalInfo\":\"jgrtfwvukxga\"}},\"recoveryPointProperties\":{\"expiryTime\":\"s\",\"ruleName\":\"nyejhkryhtnap\",\"isSoftDeleted\":false}}") + .toObject(AzureWorkloadPointInTimeRecoveryPoint.class); + Assertions.assertEquals(RecoveryPointTierType.INSTANT_RP, model.recoveryPointTierDetails().get(0).type()); + Assertions.assertEquals(RecoveryPointTierStatus.DELETED, model.recoveryPointTierDetails().get(0).status()); + Assertions.assertEquals("ihfxtijbpzvgnwzs", + model.recoveryPointTierDetails().get(0).extendedInfo().get("mglzufcy")); + Assertions.assertTrue(model.recoveryPointMoveReadinessInfo().get("dcc").isReadyForMove()); + Assertions.assertEquals("jgrtfwvukxga", model.recoveryPointMoveReadinessInfo().get("dcc").additionalInfo()); + Assertions.assertEquals("s", model.recoveryPointProperties().expiryTime()); + Assertions.assertEquals("nyejhkryhtnap", model.recoveryPointProperties().ruleName()); + Assertions.assertFalse(model.recoveryPointProperties().isSoftDeleted()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-28T12:00:07Z"), model.timeRanges().get(0).startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-12T07:08:41Z"), model.timeRanges().get(0).endTime()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupCrrMockTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupCrrMockTests.java new file mode 100644 index 000000000000..b9ef230b7f2a --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupCrrMockTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrJobRequest; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.JobResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BackupCrrMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"jobType\":\"Job\",\"entityFriendlyName\":\"of\",\"backupManagementType\":\"DefaultBackup\",\"operation\":\"fcibyfmowuxrkj\",\"status\":\"dwxf\",\"startTime\":\"2021-09-25T09:52:18Z\",\"endTime\":\"2021-10-05T15:20:41Z\",\"activityId\":\"jbhyzsxjrkambtr\"},\"eTag\":\"gvmnvuqeq\",\"location\":\"lds\",\"tags\":{\"kdmflvestmjlx\":\"tjb\",\"zapeewchpx\":\"ril\",\"levufuztcktyhj\":\"ktwkuziyc\"},\"id\":\"qedcgzulwm\",\"name\":\"rqzz\",\"type\":\"rjvpglydzgkrvqee\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupCrrManager manager = RecoveryServicesBackupCrrManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + JobResource response = manager.backupCrrJobDetails() + .getWithResponse("apzwyrpgog", new CrrJobRequest().withResourceId("xepnyl").withJobName("uajlyj"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("lds", response.location()); + Assertions.assertEquals("tjb", response.tags().get("kdmflvestmjlx")); + Assertions.assertEquals("of", response.properties().entityFriendlyName()); + Assertions.assertEquals(BackupManagementType.DEFAULT_BACKUP, response.properties().backupManagementType()); + Assertions.assertEquals("fcibyfmowuxrkj", response.properties().operation()); + Assertions.assertEquals("dwxf", response.properties().status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-25T09:52:18Z"), response.properties().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-05T15:20:41Z"), response.properties().endTime()); + Assertions.assertEquals("jbhyzsxjrkambtr", response.properties().activityId()); + Assertions.assertEquals("gvmnvuqeq", response.eTag()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupManagemTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupManagemTests.java new file mode 100644 index 000000000000..dd26bd9a6d1f --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupManagemTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupManagementUsageListInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.UsagesUnit; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class BackupManagemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BackupManagementUsageListInner model = BinaryData.fromString( + "{\"value\":[{\"unit\":\"Seconds\",\"quotaPeriod\":\"v\",\"nextResetTime\":\"2021-04-07T14:56:45Z\",\"currentValue\":6199142667074725987,\"limit\":273776256317993978,\"name\":{\"value\":\"gigr\",\"localizedValue\":\"burvjxxjnspy\"}}]}") + .toObject(BackupManagementUsageListInner.class); + Assertions.assertEquals(UsagesUnit.SECONDS, model.value().get(0).unit()); + Assertions.assertEquals("v", model.value().get(0).quotaPeriod()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-07T14:56:45Z"), model.value().get(0).nextResetTime()); + Assertions.assertEquals(6199142667074725987L, model.value().get(0).currentValue()); + Assertions.assertEquals(273776256317993978L, model.value().get(0).limit()); + Assertions.assertEquals("gigr", model.value().get(0).name().value()); + Assertions.assertEquals("burvjxxjnspy", model.value().get(0).name().localizedValue()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupProMockTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupProMockTests.java new file mode 100644 index 000000000000..96ab7c218c7b --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupProMockTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CreateMode; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DataSourceType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ProtectedItemResourceList; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BackupProMockTests { + @Test + public void testListWithResponse() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"protectedItemType\":\"ProtectedItem\",\"backupManagementType\":\"AzureBackupServer\",\"workloadType\":\"Sharepoint\",\"containerName\":\"xmprafwg\",\"sourceResourceId\":\"hocxvdfffwafqrou\",\"policyId\":\"spave\",\"lastRecoveryPoint\":\"2021-03-28T22:08:03Z\",\"backupSetName\":\"kbunzoz\",\"createMode\":\"Invalid\",\"deferredDeleteTimeInUTC\":\"2021-07-25T12:58:50Z\",\"isScheduledForDeferredDelete\":true,\"deferredDeleteTimeRemaining\":\"oyxcdyuib\",\"isDeferredDeleteScheduleUpcoming\":false,\"isRehydrate\":true,\"resourceGuardOperationRequests\":[\"ydvfvfcjnae\",\"isrvhm\"]},\"eTag\":\"r\",\"location\":\"fukiscvwmzhw\",\"tags\":{\"btgn\":\"faxvxil\",\"zqlqhyc\":\"nzeyqxtjj\",\"mieknlraria\":\"vodggxdbee\"},\"id\":\"wiuagydwqf\",\"name\":\"ylyrfgiagtco\",\"type\":\"ocqwogfnzjvus\"}],\"nextLink\":\"ld\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupCrrManager manager = RecoveryServicesBackupCrrManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ProtectedItemResourceList response = manager.backupProtectedItemsCrrs() + .listWithResponse("frbbc", "vqagtltdhlf", "qojpy", "vgtrdcnifmzzs", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("ld", response.nextLink()); + Assertions.assertEquals("fukiscvwmzhw", response.value().get(0).location()); + Assertions.assertEquals("faxvxil", response.value().get(0).tags().get("btgn")); + Assertions.assertEquals(BackupManagementType.AZURE_BACKUP_SERVER, + response.value().get(0).properties().backupManagementType()); + Assertions.assertEquals(DataSourceType.SHAREPOINT, response.value().get(0).properties().workloadType()); + Assertions.assertEquals("xmprafwg", response.value().get(0).properties().containerName()); + Assertions.assertEquals("hocxvdfffwafqrou", response.value().get(0).properties().sourceResourceId()); + Assertions.assertEquals("spave", response.value().get(0).properties().policyId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-28T22:08:03Z"), + response.value().get(0).properties().lastRecoveryPoint()); + Assertions.assertEquals("kbunzoz", response.value().get(0).properties().backupSetName()); + Assertions.assertEquals(CreateMode.INVALID, response.value().get(0).properties().createMode()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-25T12:58:50Z"), + response.value().get(0).properties().deferredDeleteTimeInUTC()); + Assertions.assertTrue(response.value().get(0).properties().isScheduledForDeferredDelete()); + Assertions.assertEquals("oyxcdyuib", response.value().get(0).properties().deferredDeleteTimeRemaining()); + Assertions.assertFalse(response.value().get(0).properties().isDeferredDeleteScheduleUpcoming()); + Assertions.assertTrue(response.value().get(0).properties().isRehydrate()); + Assertions.assertEquals("ydvfvfcjnae", + response.value().get(0).properties().resourceGuardOperationRequests().get(0)); + Assertions.assertEquals("r", response.value().get(0).eTag()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupResMockTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupResMockTests.java new file mode 100644 index 000000000000..25ce557cfa88 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupResMockTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupResourceConfigResource; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.StorageType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.StorageTypeState; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BackupResMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"storageModelType\":\"ReadAccessGeoZoneRedundant\",\"storageType\":\"ReadAccessGeoZoneRedundant\",\"storageTypeState\":\"Locked\",\"crossRegionRestoreFlag\":true},\"tags\":{\"jltduceam\":\"mjdftu\",\"ejwcwwqiok\":\"mczuo\"},\"location\":\"sx\",\"eTag\":\"jmsvpkjp\",\"id\":\"kwcf\",\"name\":\"ql\",\"type\":\"yxgtczh\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupCrrManager manager = RecoveryServicesBackupCrrManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + BackupResourceConfigResource response = manager.backupResourceStorageConfigs() + .getWithResponse("dznx", "vdsrhnjiv", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(StorageType.READ_ACCESS_GEO_ZONE_REDUNDANT, response.properties().storageModelType()); + Assertions.assertEquals(StorageType.READ_ACCESS_GEO_ZONE_REDUNDANT, response.properties().storageType()); + Assertions.assertEquals(StorageTypeState.LOCKED, response.properties().storageTypeState()); + Assertions.assertTrue(response.properties().crossRegionRestoreFlag()); + Assertions.assertEquals("mjdftu", response.tags().get("jltduceam")); + Assertions.assertEquals("sx", response.location()); + Assertions.assertEquals("jmsvpkjp", response.eTag()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupResourcTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupResourcTests.java new file mode 100644 index 000000000000..164003fa7fb4 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupResourcTests.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.BackupResourceConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupResourceConfig; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.StorageType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.StorageTypeState; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class BackupResourcTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BackupResourceConfigResourceInner model = BinaryData.fromString( + "{\"properties\":{\"storageModelType\":\"Invalid\",\"storageType\":\"ZoneRedundant\",\"storageTypeState\":\"Invalid\",\"crossRegionRestoreFlag\":false},\"tags\":{\"tzopbsphrupidgsy\":\"bczmeh\",\"bhdxbm\":\"bejhphoycmsxa\",\"p\":\"qioqjzehtbmu\"},\"location\":\"noi\",\"eTag\":\"wlrxyb\",\"id\":\"oqijgkdmbpaz\",\"name\":\"obcu\",\"type\":\"pdznrbtcqqjnqgl\"}") + .toObject(BackupResourceConfigResourceInner.class); + Assertions.assertEquals(StorageType.INVALID, model.properties().storageModelType()); + Assertions.assertEquals(StorageType.ZONE_REDUNDANT, model.properties().storageType()); + Assertions.assertEquals(StorageTypeState.INVALID, model.properties().storageTypeState()); + Assertions.assertFalse(model.properties().crossRegionRestoreFlag()); + Assertions.assertEquals("bczmeh", model.tags().get("tzopbsphrupidgsy")); + Assertions.assertEquals("noi", model.location()); + Assertions.assertEquals("wlrxyb", model.eTag()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BackupResourceConfigResourceInner model = new BackupResourceConfigResourceInner() + .withProperties(new BackupResourceConfig().withStorageModelType(StorageType.INVALID) + .withStorageType(StorageType.ZONE_REDUNDANT) + .withStorageTypeState(StorageTypeState.INVALID) + .withCrossRegionRestoreFlag(false)) + .withTags(mapOf("tzopbsphrupidgsy", "bczmeh", "bhdxbm", "bejhphoycmsxa", "p", "qioqjzehtbmu")) + .withLocation("noi") + .withETag("wlrxyb"); + model = BinaryData.fromObject(model).toObject(BackupResourceConfigResourceInner.class); + Assertions.assertEquals(StorageType.INVALID, model.properties().storageModelType()); + Assertions.assertEquals(StorageType.ZONE_REDUNDANT, model.properties().storageType()); + Assertions.assertEquals(StorageTypeState.INVALID, model.properties().storageTypeState()); + Assertions.assertFalse(model.properties().crossRegionRestoreFlag()); + Assertions.assertEquals("bczmeh", model.tags().get("tzopbsphrupidgsy")); + Assertions.assertEquals("noi", model.location()); + Assertions.assertEquals("wlrxyb", model.eTag()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupUsaMockTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupUsaMockTests.java new file mode 100644 index 000000000000..ad6abdf67fee --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/BackupUsaMockTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementUsageList; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.UsagesUnit; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BackupUsaMockTests { + @Test + public void testListWithResponse() throws Exception { + String responseStr + = "{\"value\":[{\"unit\":\"Bytes\",\"quotaPeriod\":\"vudtjuewbcihx\",\"nextResetTime\":\"2021-03-30T06:07:22Z\",\"currentValue\":614766874259196772,\"limit\":8836529440782745734,\"name\":{\"value\":\"bvpa\",\"localizedValue\":\"kkudzp\"}},{\"unit\":\"CountPerSecond\",\"quotaPeriod\":\"plmag\",\"nextResetTime\":\"2021-10-13T06:57:05Z\",\"currentValue\":7905728111440793800,\"limit\":4659615612373215411,\"name\":{\"value\":\"kdbdgiogsj\",\"localizedValue\":\"nwqjnoba\"}}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupCrrManager manager = RecoveryServicesBackupCrrManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + BackupManagementUsageList response = manager.backupUsageSummariesCRRs() + .listWithResponse("ruocbgo", "rb", "eoybfhjxakvvjgs", "ordilmywwtkgkxny", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(UsagesUnit.BYTES, response.value().get(0).unit()); + Assertions.assertEquals("vudtjuewbcihx", response.value().get(0).quotaPeriod()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-30T06:07:22Z"), response.value().get(0).nextResetTime()); + Assertions.assertEquals(614766874259196772L, response.value().get(0).currentValue()); + Assertions.assertEquals(8836529440782745734L, response.value().get(0).limit()); + Assertions.assertEquals("bvpa", response.value().get(0).name().value()); + Assertions.assertEquals("kkudzp", response.value().get(0).name().localizedValue()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ClientScriptFTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ClientScriptFTests.java new file mode 100644 index 000000000000..dd450d0e44d9 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ClientScriptFTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ClientScriptForConnect; +import org.junit.jupiter.api.Assertions; + +public final class ClientScriptFTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClientScriptForConnect model = BinaryData.fromString( + "{\"scriptContent\":\"cqdpfuv\",\"scriptExtension\":\"sbjjc\",\"osType\":\"vxb\",\"url\":\"vudutncor\",\"scriptNameSuffix\":\"lxqtvcofudfl\"}") + .toObject(ClientScriptForConnect.class); + Assertions.assertEquals("cqdpfuv", model.scriptContent()); + Assertions.assertEquals("sbjjc", model.scriptExtension()); + Assertions.assertEquals("vxb", model.osType()); + Assertions.assertEquals("vudutncor", model.url()); + Assertions.assertEquals("lxqtvcofudfl", model.scriptNameSuffix()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrrJobRequestTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrrJobRequestTests.java new file mode 100644 index 000000000000..1d64ce05512b --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrrJobRequestTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CrrJobRequest; +import org.junit.jupiter.api.Assertions; + +public final class CrrJobRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CrrJobRequest model = BinaryData.fromString("{\"resourceId\":\"misgwbnb\",\"jobName\":\"ldawkzbaliourqha\"}") + .toObject(CrrJobRequest.class); + Assertions.assertEquals("misgwbnb", model.resourceId()); + Assertions.assertEquals("ldawkzbaliourqha", model.jobName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CrrJobRequest model = new CrrJobRequest().withResourceId("misgwbnb").withJobName("ldawkzbaliourqha"); + model = BinaryData.fromObject(model).toObject(CrrJobRequest.class); + Assertions.assertEquals("misgwbnb", model.resourceId()); + Assertions.assertEquals("ldawkzbaliourqha", model.jobName()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrrOperatMockTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrrOperatMockTests.java new file mode 100644 index 000000000000..40d33577ebf3 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/CrrOperatMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class CrrOperatMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupCrrManager manager = RecoveryServicesBackupCrrManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.crrOperationResults().getWithResponse("uwmncs", "tijfybvp", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DPMProtectedITests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DPMProtectedITests.java new file mode 100644 index 000000000000..4db3c33039f5 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DPMProtectedITests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CreateMode; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DPMProtectedItem; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DataSourceType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ProtectedItemState; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class DPMProtectedITests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DPMProtectedItem model = BinaryData.fromString( + "{\"protectedItemType\":\"DPMProtectedItem\",\"friendlyName\":\"ttpkiwkkbnujrywv\",\"backupEngineName\":\"lbfpncurd\",\"protectionState\":\"Invalid\",\"extendedInfo\":{\"protectableObjectLoadPath\":{\"nfdn\":\"htywubxcbihwq\",\"ihxumwctondzj\":\"wjchrdg\"},\"protected\":false,\"isPresentOnCloud\":false,\"lastBackupStatus\":\"lwg\",\"lastRefreshedAt\":\"2021-04-25T18:49:42Z\",\"oldestRecoveryPoint\":\"2021-08-12T18:38:44Z\",\"recoveryPointCount\":676587800,\"onPremiseOldestRecoveryPoint\":\"2021-04-09T09:47:22Z\",\"onPremiseLatestRecoveryPoint\":\"2021-01-09T04:08:29Z\",\"onPremiseRecoveryPointCount\":10157721,\"isCollocated\":true,\"protectionGroupName\":\"qfi\",\"diskStorageUsedInBytes\":\"x\",\"totalDiskStorageSizeInBytes\":\"npirgnepttw\"},\"backupManagementType\":\"AzureIaasVM\",\"workloadType\":\"AzureFileShare\",\"containerName\":\"fcdmqnrojlpijn\",\"sourceResourceId\":\"xfrdd\",\"policyId\":\"ratiz\",\"lastRecoveryPoint\":\"2021-06-27T16:40:41Z\",\"backupSetName\":\"asxifto\",\"createMode\":\"Default\",\"deferredDeleteTimeInUTC\":\"2021-01-30T13:58:29Z\",\"isScheduledForDeferredDelete\":false,\"deferredDeleteTimeRemaining\":\"esgogc\",\"isDeferredDeleteScheduleUpcoming\":true,\"isRehydrate\":true,\"resourceGuardOperationRequests\":[\"rlgnyhmos\",\"xkk\"]}") + .toObject(DPMProtectedItem.class); + Assertions.assertEquals(BackupManagementType.AZURE_IAAS_VM, model.backupManagementType()); + Assertions.assertEquals(DataSourceType.AZURE_FILE_SHARE, model.workloadType()); + Assertions.assertEquals("fcdmqnrojlpijn", model.containerName()); + Assertions.assertEquals("xfrdd", model.sourceResourceId()); + Assertions.assertEquals("ratiz", model.policyId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-27T16:40:41Z"), model.lastRecoveryPoint()); + Assertions.assertEquals("asxifto", model.backupSetName()); + Assertions.assertEquals(CreateMode.DEFAULT, model.createMode()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-30T13:58:29Z"), model.deferredDeleteTimeInUTC()); + Assertions.assertFalse(model.isScheduledForDeferredDelete()); + Assertions.assertEquals("esgogc", model.deferredDeleteTimeRemaining()); + Assertions.assertTrue(model.isDeferredDeleteScheduleUpcoming()); + Assertions.assertTrue(model.isRehydrate()); + Assertions.assertEquals("rlgnyhmos", model.resourceGuardOperationRequests().get(0)); + Assertions.assertEquals("ttpkiwkkbnujrywv", model.friendlyName()); + Assertions.assertEquals("lbfpncurd", model.backupEngineName()); + Assertions.assertEquals(ProtectedItemState.INVALID, model.protectionState()); + Assertions.assertEquals("htywubxcbihwq", model.extendedInfo().protectableObjectLoadPath().get("nfdn")); + Assertions.assertFalse(model.extendedInfo().protectedProperty()); + Assertions.assertFalse(model.extendedInfo().isPresentOnCloud()); + Assertions.assertEquals("lwg", model.extendedInfo().lastBackupStatus()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T18:49:42Z"), model.extendedInfo().lastRefreshedAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-12T18:38:44Z"), + model.extendedInfo().oldestRecoveryPoint()); + Assertions.assertEquals(676587800, model.extendedInfo().recoveryPointCount()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-09T09:47:22Z"), + model.extendedInfo().onPremiseOldestRecoveryPoint()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-09T04:08:29Z"), + model.extendedInfo().onPremiseLatestRecoveryPoint()); + Assertions.assertEquals(10157721, model.extendedInfo().onPremiseRecoveryPointCount()); + Assertions.assertTrue(model.extendedInfo().isCollocated()); + Assertions.assertEquals("qfi", model.extendedInfo().protectionGroupName()); + Assertions.assertEquals("x", model.extendedInfo().diskStorageUsedInBytes()); + Assertions.assertEquals("npirgnepttw", model.extendedInfo().totalDiskStorageSizeInBytes()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DiskExclusionTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DiskExclusionTests.java new file mode 100644 index 000000000000..315d77bca664 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DiskExclusionTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DiskExclusionProperties; +import org.junit.jupiter.api.Assertions; + +public final class DiskExclusionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DiskExclusionProperties model = BinaryData + .fromString("{\"diskLunList\":[1271536570,115190409,1775495028,2015959117],\"isInclusionList\":true}") + .toObject(DiskExclusionProperties.class); + Assertions.assertEquals(1271536570, model.diskLunList().get(0)); + Assertions.assertTrue(model.isInclusionList()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DiskInformatiTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DiskInformatiTests.java new file mode 100644 index 000000000000..7575326389f9 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DiskInformatiTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DiskInformation; +import org.junit.jupiter.api.Assertions; + +public final class DiskInformatiTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DiskInformation model + = BinaryData.fromString("{\"lun\":1906806316,\"name\":\"f\"}").toObject(DiskInformation.class); + Assertions.assertEquals(1906806316, model.lun()); + Assertions.assertEquals("f", model.name()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmErrorInfoTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmErrorInfoTests.java new file mode 100644 index 000000000000..a56b84731835 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmErrorInfoTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DpmErrorInfo; +import org.junit.jupiter.api.Assertions; + +public final class DpmErrorInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DpmErrorInfo model = BinaryData + .fromString( + "{\"errorString\":\"wakbogqxndl\",\"recommendations\":[\"xhuri\",\"lbpodxunk\",\"ebxmubyynt\"]}") + .toObject(DpmErrorInfo.class); + Assertions.assertEquals("wakbogqxndl", model.errorString()); + Assertions.assertEquals("xhuri", model.recommendations().get(0)); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmJobExtendeTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmJobExtendeTests.java new file mode 100644 index 000000000000..f25ebcbafb92 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmJobExtendeTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DpmJobExtendedInfo; +import java.time.Duration; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class DpmJobExtendeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DpmJobExtendedInfo model = BinaryData.fromString( + "{\"tasksList\":[{\"taskId\":\"qtkoievs\",\"startTime\":\"2021-12-03T04:31:52Z\",\"endTime\":\"2021-04-19T07:28:36Z\",\"duration\":\"PT107H53M23S\",\"status\":\"tmuwlauwzi\"},{\"taskId\":\"bm\",\"startTime\":\"2021-06-20T04:01:26Z\",\"endTime\":\"2021-07-24T09:20:41Z\",\"duration\":\"PT127H32M1S\",\"status\":\"muvp\"}],\"propertyBag\":{\"morppxebmnzbtbh\":\"d\"},\"dynamicErrorMessage\":\"glkfg\"}") + .toObject(DpmJobExtendedInfo.class); + Assertions.assertEquals("qtkoievs", model.tasksList().get(0).taskId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-03T04:31:52Z"), model.tasksList().get(0).startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-19T07:28:36Z"), model.tasksList().get(0).endTime()); + Assertions.assertEquals(Duration.parse("PT107H53M23S"), model.tasksList().get(0).duration()); + Assertions.assertEquals("tmuwlauwzi", model.tasksList().get(0).status()); + Assertions.assertEquals("d", model.propertyBag().get("morppxebmnzbtbh")); + Assertions.assertEquals("glkfg", model.dynamicErrorMessage()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmJobTaskDetTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmJobTaskDetTests.java new file mode 100644 index 000000000000..f899607e36ac --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmJobTaskDetTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DpmJobTaskDetails; +import java.time.Duration; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class DpmJobTaskDetTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DpmJobTaskDetails model = BinaryData.fromString( + "{\"taskId\":\"dneu\",\"startTime\":\"2021-03-26T18:18:01Z\",\"endTime\":\"2021-04-04T13:11:17Z\",\"duration\":\"PT147H53M24S\",\"status\":\"htozfikdow\"}") + .toObject(DpmJobTaskDetails.class); + Assertions.assertEquals("dneu", model.taskId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-26T18:18:01Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T13:11:17Z"), model.endTime()); + Assertions.assertEquals(Duration.parse("PT147H53M24S"), model.duration()); + Assertions.assertEquals("htozfikdow", model.status()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmJobTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmJobTests.java new file mode 100644 index 000000000000..5deb5eb60782 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/DpmJobTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DpmJob; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.JobSupportedAction; +import java.time.Duration; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class DpmJobTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DpmJob model = BinaryData.fromString( + "{\"jobType\":\"DpmJob\",\"duration\":\"PT165H20M39S\",\"dpmServerName\":\"ssotftpv\",\"containerName\":\"bexilzznfqqnv\",\"containerType\":\"mqtaruoujmkcjh\",\"workloadType\":\"ytjrybnwjewgdr\",\"actionsInfo\":[\"Invalid\",\"Cancellable\",\"Cancellable\"],\"errorDetails\":[{\"errorString\":\"pehindoygm\",\"recommendations\":[\"hnzdndslgnayqi\",\"ynduha\"]},{\"errorString\":\"qlkth\",\"recommendations\":[\"qolbgyc\",\"uie\",\"tgccymvaolpss\",\"qlfmmdnbb\"]}],\"extendedInfo\":{\"tasksList\":[{\"taskId\":\"wiydmcwyhzdxssad\",\"startTime\":\"2021-10-15T22:28:47Z\",\"endTime\":\"2021-10-28T06:50:59Z\",\"duration\":\"PT155H4M9S\",\"status\":\"n\"},{\"taskId\":\"ao\",\"startTime\":\"2021-09-27T09:43:19Z\",\"endTime\":\"2021-05-29T13:49:41Z\",\"duration\":\"PT111H54M3S\",\"status\":\"lylpstdb\"},{\"taskId\":\"xsrz\",\"startTime\":\"2021-10-21T03:09:33Z\",\"endTime\":\"2021-10-15T02:58:18Z\",\"duration\":\"PT221H43M47S\",\"status\":\"dntnevf\"}],\"propertyBag\":{\"tmweriofzpyq\":\"mygtdssls\",\"hhszh\":\"emwabnet\",\"lvwiwubmwmbesl\":\"d\",\"pp\":\"nkww\"},\"dynamicErrorMessage\":\"lcxog\"},\"entityFriendlyName\":\"konzmnsik\",\"backupManagementType\":\"AzureStorage\",\"operation\":\"ze\",\"status\":\"kdltfzxmhhvhg\",\"startTime\":\"2021-10-25T11:18:43Z\",\"endTime\":\"2020-12-25T12:19:04Z\",\"activityId\":\"wobdagxtibqdx\"}") + .toObject(DpmJob.class); + Assertions.assertEquals("konzmnsik", model.entityFriendlyName()); + Assertions.assertEquals(BackupManagementType.AZURE_STORAGE, model.backupManagementType()); + Assertions.assertEquals("ze", model.operation()); + Assertions.assertEquals("kdltfzxmhhvhg", model.status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-25T11:18:43Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-25T12:19:04Z"), model.endTime()); + Assertions.assertEquals("wobdagxtibqdx", model.activityId()); + Assertions.assertEquals(Duration.parse("PT165H20M39S"), model.duration()); + Assertions.assertEquals("ssotftpv", model.dpmServerName()); + Assertions.assertEquals("bexilzznfqqnv", model.containerName()); + Assertions.assertEquals("mqtaruoujmkcjh", model.containerType()); + Assertions.assertEquals("ytjrybnwjewgdr", model.workloadType()); + Assertions.assertEquals(JobSupportedAction.INVALID, model.actionsInfo().get(0)); + Assertions.assertEquals("pehindoygm", model.errorDetails().get(0).errorString()); + Assertions.assertEquals("hnzdndslgnayqi", model.errorDetails().get(0).recommendations().get(0)); + Assertions.assertEquals("wiydmcwyhzdxssad", model.extendedInfo().tasksList().get(0).taskId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-15T22:28:47Z"), + model.extendedInfo().tasksList().get(0).startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-28T06:50:59Z"), + model.extendedInfo().tasksList().get(0).endTime()); + Assertions.assertEquals(Duration.parse("PT155H4M9S"), model.extendedInfo().tasksList().get(0).duration()); + Assertions.assertEquals("n", model.extendedInfo().tasksList().get(0).status()); + Assertions.assertEquals("mygtdssls", model.extendedInfo().propertyBag().get("tmweriofzpyq")); + Assertions.assertEquals("lcxog", model.extendedInfo().dynamicErrorMessage()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ExtendedPropeTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ExtendedPropeTests.java new file mode 100644 index 000000000000..133acb58c49e --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ExtendedPropeTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ExtendedProperties; +import org.junit.jupiter.api.Assertions; + +public final class ExtendedPropeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExtendedProperties model = BinaryData.fromString( + "{\"diskExclusionProperties\":{\"diskLunList\":[1361399231,524454595,632633713],\"isInclusionList\":false}}") + .toObject(ExtendedProperties.class); + Assertions.assertEquals(1361399231, model.diskExclusionProperties().diskLunList().get(0)); + Assertions.assertFalse(model.diskExclusionProperties().isInclusionList()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/GenericProtecTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/GenericProtecTests.java new file mode 100644 index 000000000000..d27457d9532f --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/GenericProtecTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CreateMode; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DataSourceType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.GenericProtectedItem; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ProtectionState; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class GenericProtecTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GenericProtectedItem model = BinaryData.fromString( + "{\"protectedItemType\":\"GenericProtectedItem\",\"friendlyName\":\"ox\",\"policyState\":\"ggufhyaomtb\",\"protectionState\":\"ProtectionPaused\",\"protectedItemId\":9155995236468632439,\"sourceAssociations\":{\"xumvfcluyovw\":\"kffovjzhpjbibgjm\",\"wzdgirujbzbo\":\"nbkfezzxscy\",\"pniyujviyl\":\"vzzbtdcq\"},\"fabricName\":\"shfssnrbgyef\",\"backupManagementType\":\"Invalid\",\"workloadType\":\"Sharepoint\",\"containerName\":\"ojfmwnco\",\"sourceResourceId\":\"rfh\",\"policyId\":\"ctymoxoftp\",\"lastRecoveryPoint\":\"2021-04-03T05:33:45Z\",\"backupSetName\":\"yczuhxacpq\",\"createMode\":\"Recover\",\"deferredDeleteTimeInUTC\":\"2021-05-02T02:31:15Z\",\"isScheduledForDeferredDelete\":false,\"deferredDeleteTimeRemaining\":\"pskasdvlmfwdg\",\"isDeferredDeleteScheduleUpcoming\":false,\"isRehydrate\":false,\"resourceGuardOperationRequests\":[\"pamrsr\"]}") + .toObject(GenericProtectedItem.class); + Assertions.assertEquals(BackupManagementType.INVALID, model.backupManagementType()); + Assertions.assertEquals(DataSourceType.SHAREPOINT, model.workloadType()); + Assertions.assertEquals("ojfmwnco", model.containerName()); + Assertions.assertEquals("rfh", model.sourceResourceId()); + Assertions.assertEquals("ctymoxoftp", model.policyId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T05:33:45Z"), model.lastRecoveryPoint()); + Assertions.assertEquals("yczuhxacpq", model.backupSetName()); + Assertions.assertEquals(CreateMode.RECOVER, model.createMode()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-02T02:31:15Z"), model.deferredDeleteTimeInUTC()); + Assertions.assertFalse(model.isScheduledForDeferredDelete()); + Assertions.assertEquals("pskasdvlmfwdg", model.deferredDeleteTimeRemaining()); + Assertions.assertFalse(model.isDeferredDeleteScheduleUpcoming()); + Assertions.assertFalse(model.isRehydrate()); + Assertions.assertEquals("pamrsr", model.resourceGuardOperationRequests().get(0)); + Assertions.assertEquals("ox", model.friendlyName()); + Assertions.assertEquals("ggufhyaomtb", model.policyState()); + Assertions.assertEquals(ProtectionState.PROTECTION_PAUSED, model.protectionState()); + Assertions.assertEquals(9155995236468632439L, model.protectedItemId()); + Assertions.assertEquals("kffovjzhpjbibgjm", model.sourceAssociations().get("xumvfcluyovw")); + Assertions.assertEquals("shfssnrbgyef", model.fabricName()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/GenericRecoveTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/GenericRecoveTests.java new file mode 100644 index 000000000000..632a9d10baf1 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/GenericRecoveTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.GenericRecoveryPoint; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class GenericRecoveTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GenericRecoveryPoint model = BinaryData.fromString( + "{\"objectType\":\"GenericRecoveryPoint\",\"friendlyName\":\"ajionpimexgstxg\",\"recoveryPointType\":\"odgmaajrmvdjwz\",\"recoveryPointTime\":\"2021-07-31T14:59:47Z\",\"recoveryPointAdditionalInfo\":\"mcl\",\"recoveryPointProperties\":{\"expiryTime\":\"j\",\"ruleName\":\"ejctbzaqsqsycb\",\"isSoftDeleted\":true}}") + .toObject(GenericRecoveryPoint.class); + Assertions.assertEquals("ajionpimexgstxg", model.friendlyName()); + Assertions.assertEquals("odgmaajrmvdjwz", model.recoveryPointType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T14:59:47Z"), model.recoveryPointTime()); + Assertions.assertEquals("mcl", model.recoveryPointAdditionalInfo()); + Assertions.assertEquals("j", model.recoveryPointProperties().expiryTime()); + Assertions.assertEquals("ejctbzaqsqsycb", model.recoveryPointProperties().ruleName()); + Assertions.assertTrue(model.recoveryPointProperties().isSoftDeleted()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/IdentityBasedTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/IdentityBasedTests.java new file mode 100644 index 000000000000..ca90fe231007 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/IdentityBasedTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.IdentityBasedRestoreDetails; +import org.junit.jupiter.api.Assertions; + +public final class IdentityBasedTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IdentityBasedRestoreDetails model + = BinaryData.fromString("{\"objectType\":\"qpv\",\"targetStorageAccountId\":\"dmwsrcrgvxpvgomz\"}") + .toObject(IdentityBasedRestoreDetails.class); + Assertions.assertEquals("qpv", model.objectType()); + Assertions.assertEquals("dmwsrcrgvxpvgomz", model.targetStorageAccountId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IdentityBasedRestoreDetails model + = new IdentityBasedRestoreDetails().withObjectType("qpv").withTargetStorageAccountId("dmwsrcrgvxpvgomz"); + model = BinaryData.fromObject(model).toObject(IdentityBasedRestoreDetails.class); + Assertions.assertEquals("qpv", model.objectType()); + Assertions.assertEquals("dmwsrcrgvxpvgomz", model.targetStorageAccountId()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/IdentityInfoTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/IdentityInfoTests.java new file mode 100644 index 000000000000..20bed6f0ec6f --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/IdentityInfoTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.IdentityInfo; +import org.junit.jupiter.api.Assertions; + +public final class IdentityInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IdentityInfo model = BinaryData + .fromString("{\"isSystemAssignedIdentity\":false,\"managedIdentityResourceId\":\"quhcdhmduala\"}") + .toObject(IdentityInfo.class); + Assertions.assertFalse(model.isSystemAssignedIdentity()); + Assertions.assertEquals("quhcdhmduala", model.managedIdentityResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IdentityInfo model + = new IdentityInfo().withIsSystemAssignedIdentity(false).withManagedIdentityResourceId("quhcdhmduala"); + model = BinaryData.fromObject(model).toObject(IdentityInfo.class); + Assertions.assertFalse(model.isSystemAssignedIdentity()); + Assertions.assertEquals("quhcdhmduala", model.managedIdentityResourceId()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/InstantItemReTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/InstantItemReTests.java new file mode 100644 index 000000000000..33a3c5fac8ec --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/InstantItemReTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.InstantItemRecoveryTarget; +import org.junit.jupiter.api.Assertions; + +public final class InstantItemReTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InstantItemRecoveryTarget model = BinaryData.fromString( + "{\"clientScripts\":[{\"scriptContent\":\"agxsdszuemps\",\"scriptExtension\":\"kfzbeyvpnqicvi\",\"osType\":\"kjj\",\"url\":\"xrbuukzclew\",\"scriptNameSuffix\":\"mlwpazt\"},{\"scriptContent\":\"ofncckwyfzqwhxxb\",\"scriptExtension\":\"qa\",\"osType\":\"feqztppriol\",\"url\":\"rjaltolmncw\",\"scriptNameSuffix\":\"bqwcsdbnwdcf\"}]}") + .toObject(InstantItemRecoveryTarget.class); + Assertions.assertEquals("agxsdszuemps", model.clientScripts().get(0).scriptContent()); + Assertions.assertEquals("kfzbeyvpnqicvi", model.clientScripts().get(0).scriptExtension()); + Assertions.assertEquals("kjj", model.clientScripts().get(0).osType()); + Assertions.assertEquals("xrbuukzclew", model.clientScripts().get(0).url()); + Assertions.assertEquals("mlwpazt", model.clientScripts().get(0).scriptNameSuffix()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/JobResourceInTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/JobResourceInTests.java new file mode 100644 index 000000000000..0a6d2ab20daa --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/JobResourceInTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementType; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class JobResourceInTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + JobResourceInner model = BinaryData.fromString( + "{\"properties\":{\"jobType\":\"Job\",\"entityFriendlyName\":\"hashsfwxosow\",\"backupManagementType\":\"MAB\",\"operation\":\"gicjooxdjeb\",\"status\":\"ucww\",\"startTime\":\"2021-11-10T03:45:07Z\",\"endTime\":\"2021-05-10T00:57:01Z\",\"activityId\":\"meue\"},\"eTag\":\"vyhzceuojgjrwj\",\"location\":\"eiotwmcdytdx\",\"tags\":{\"wgqwgxhn\":\"xnrj\",\"y\":\"skxfbk\"},\"id\":\"gklwn\",\"name\":\"nhjdauw\",\"type\":\"vylwzbtdhxuj\"}") + .toObject(JobResourceInner.class); + Assertions.assertEquals("eiotwmcdytdx", model.location()); + Assertions.assertEquals("xnrj", model.tags().get("wgqwgxhn")); + Assertions.assertEquals("hashsfwxosow", model.properties().entityFriendlyName()); + Assertions.assertEquals(BackupManagementType.MAB, model.properties().backupManagementType()); + Assertions.assertEquals("gicjooxdjeb", model.properties().operation()); + Assertions.assertEquals("ucww", model.properties().status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-10T03:45:07Z"), model.properties().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-10T00:57:01Z"), model.properties().endTime()); + Assertions.assertEquals("meue", model.properties().activityId()); + Assertions.assertEquals("vyhzceuojgjrwj", model.eTag()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/JobResourceLiTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/JobResourceLiTests.java new file mode 100644 index 000000000000..7188f9877365 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/JobResourceLiTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.JobResourceListInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementType; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class JobResourceLiTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + JobResourceListInner model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"jobType\":\"Job\",\"entityFriendlyName\":\"joxafnndlpi\",\"backupManagementType\":\"Invalid\",\"operation\":\"ymkcdyhb\",\"status\":\"kpw\",\"startTime\":\"2021-09-24T00:24:15Z\",\"endTime\":\"2021-06-20T16:01:18Z\",\"activityId\":\"vvqfovljxyws\"},\"eTag\":\"syrsndsytgadgvra\",\"location\":\"aeneqnzarrwl\",\"tags\":{\"bjibwwiftohq\":\"ijfqkacewiipfp\",\"plsaknynfsynljph\":\"vpuvks\"},\"id\":\"op\",\"name\":\"odlqiyntor\",\"type\":\"ihleos\"},{\"properties\":{\"jobType\":\"Job\",\"entityFriendlyName\":\"srmslyzr\",\"backupManagementType\":\"Invalid\",\"operation\":\"hckqqzqioxiy\",\"status\":\"iizynkedyatrwyh\",\"startTime\":\"2021-07-12T14:32:58Z\",\"endTime\":\"2021-01-03T03:03:31Z\",\"activityId\":\"hwit\"},\"eTag\":\"ypyynpcdpumnzg\",\"location\":\"wznm\",\"tags\":{\"gj\":\"knso\",\"vokotllxdyh\":\"xbldtlwwrlkdmtn\",\"oocrkvcikhnv\":\"syocogjltdtbnnha\"},\"id\":\"amqgxqquezikyw\",\"name\":\"gxk\",\"type\":\"lla\"},{\"properties\":{\"jobType\":\"Job\",\"entityFriendlyName\":\"lwuip\",\"backupManagementType\":\"AzureIaasVM\",\"operation\":\"zkzivgvvcnay\",\"status\":\"yrnxxmueedn\",\"startTime\":\"2021-03-13T02:42:41Z\",\"endTime\":\"2021-08-28T04:29:29Z\",\"activityId\":\"kwqqtchealmf\"},\"eTag\":\"d\",\"location\":\"aygdvwvgpioh\",\"tags\":{\"qagvrvm\":\"rtfudxepxg\",\"dblx\":\"pkukghi\",\"fnjhfjxwmszkkfo\":\"wi\"},\"id\":\"rey\",\"name\":\"kzikfjawneaivxwc\",\"type\":\"elpcirelsfeaenwa\"},{\"properties\":{\"jobType\":\"Job\",\"entityFriendlyName\":\"tkl\",\"backupManagementType\":\"AzureWorkload\",\"operation\":\"jhwuaanozjos\",\"status\":\"youlp\",\"startTime\":\"2021-09-04T05:53:47Z\",\"endTime\":\"2021-04-09T11:20:33Z\",\"activityId\":\"l\"},\"eTag\":\"imjwosyt\",\"location\":\"itc\",\"tags\":{\"hlyfjhdgqgg\":\"cktqumiekkezzi\",\"qfatpxllrxcyjm\":\"bdunygaeqid\",\"su\":\"a\"},\"id\":\"arm\",\"name\":\"wdmjsjqbjhhyx\",\"type\":\"rw\"}],\"nextLink\":\"co\"}") + .toObject(JobResourceListInner.class); + Assertions.assertEquals("co", model.nextLink()); + Assertions.assertEquals("aeneqnzarrwl", model.value().get(0).location()); + Assertions.assertEquals("ijfqkacewiipfp", model.value().get(0).tags().get("bjibwwiftohq")); + Assertions.assertEquals("joxafnndlpi", model.value().get(0).properties().entityFriendlyName()); + Assertions.assertEquals(BackupManagementType.INVALID, model.value().get(0).properties().backupManagementType()); + Assertions.assertEquals("ymkcdyhb", model.value().get(0).properties().operation()); + Assertions.assertEquals("kpw", model.value().get(0).properties().status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-24T00:24:15Z"), + model.value().get(0).properties().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-20T16:01:18Z"), + model.value().get(0).properties().endTime()); + Assertions.assertEquals("vvqfovljxyws", model.value().get(0).properties().activityId()); + Assertions.assertEquals("syrsndsytgadgvra", model.value().get(0).eTag()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/JobTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/JobTests.java new file mode 100644 index 000000000000..110d3f6a3894 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/JobTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.Job; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class JobTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Job model = BinaryData.fromString( + "{\"jobType\":\"Job\",\"entityFriendlyName\":\"bm\",\"backupManagementType\":\"DefaultBackup\",\"operation\":\"wpr\",\"status\":\"lve\",\"startTime\":\"2021-01-24T13:59:26Z\",\"endTime\":\"2020-12-27T06:38:54Z\",\"activityId\":\"mkh\"}") + .toObject(Job.class); + Assertions.assertEquals("bm", model.entityFriendlyName()); + Assertions.assertEquals(BackupManagementType.DEFAULT_BACKUP, model.backupManagementType()); + Assertions.assertEquals("wpr", model.operation()); + Assertions.assertEquals("lve", model.status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-24T13:59:26Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-27T06:38:54Z"), model.endTime()); + Assertions.assertEquals("mkh", model.activityId()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabErrorInfoTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabErrorInfoTests.java new file mode 100644 index 000000000000..fe9d4d93dbe9 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabErrorInfoTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.MabErrorInfo; + +public final class MabErrorInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MabErrorInfo model = BinaryData + .fromString( + "{\"errorString\":\"elxprglyatddck\",\"recommendations\":[\"uejrjxgc\",\"qibrhosxsdqrhzoy\",\"i\"]}") + .toObject(MabErrorInfo.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabFileFolderTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabFileFolderTests.java new file mode 100644 index 000000000000..50e577263ecc --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabFileFolderTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CreateMode; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DataSourceType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.MabFileFolderProtectedItem; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MabFileFolderTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MabFileFolderProtectedItem model = BinaryData.fromString( + "{\"protectedItemType\":\"MabFileFolderProtectedItem\",\"friendlyName\":\"zvxurisjnhny\",\"computerName\":\"ifqjz\",\"lastBackupStatus\":\"mrhublwpc\",\"lastBackupTime\":\"2021-06-28T02:18Z\",\"protectionState\":\"rgjupauut\",\"deferredDeleteSyncTimeInUTC\":2888604604095787464,\"extendedInfo\":{\"lastRefreshedAt\":\"2021-11-15T20:29:08Z\",\"oldestRecoveryPoint\":\"2021-03-13T05:34:56Z\",\"recoveryPointCount\":89548348},\"backupManagementType\":\"AzureStorage\",\"workloadType\":\"SAPHanaDatabase\",\"containerName\":\"qntcypsxjvfoimwk\",\"sourceResourceId\":\"ircizjxvy\",\"policyId\":\"ceacvlhvygdy\",\"lastRecoveryPoint\":\"2021-04-02T04:25:09Z\",\"backupSetName\":\"rtwnawjslbi\",\"createMode\":\"Recover\",\"deferredDeleteTimeInUTC\":\"2021-10-11T07:11:07Z\",\"isScheduledForDeferredDelete\":false,\"deferredDeleteTimeRemaining\":\"tsf\",\"isDeferredDeleteScheduleUpcoming\":true,\"isRehydrate\":true,\"resourceGuardOperationRequests\":[\"ph\",\"hqnrn\",\"pxehuwrykqga\",\"fmviklby\"]}") + .toObject(MabFileFolderProtectedItem.class); + Assertions.assertEquals(BackupManagementType.AZURE_STORAGE, model.backupManagementType()); + Assertions.assertEquals(DataSourceType.SAPHANA_DATABASE, model.workloadType()); + Assertions.assertEquals("qntcypsxjvfoimwk", model.containerName()); + Assertions.assertEquals("ircizjxvy", model.sourceResourceId()); + Assertions.assertEquals("ceacvlhvygdy", model.policyId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-02T04:25:09Z"), model.lastRecoveryPoint()); + Assertions.assertEquals("rtwnawjslbi", model.backupSetName()); + Assertions.assertEquals(CreateMode.RECOVER, model.createMode()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-11T07:11:07Z"), model.deferredDeleteTimeInUTC()); + Assertions.assertFalse(model.isScheduledForDeferredDelete()); + Assertions.assertEquals("tsf", model.deferredDeleteTimeRemaining()); + Assertions.assertTrue(model.isDeferredDeleteScheduleUpcoming()); + Assertions.assertTrue(model.isRehydrate()); + Assertions.assertEquals("ph", model.resourceGuardOperationRequests().get(0)); + Assertions.assertEquals("zvxurisjnhny", model.friendlyName()); + Assertions.assertEquals("ifqjz", model.computerName()); + Assertions.assertEquals("mrhublwpc", model.lastBackupStatus()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-28T02:18Z"), model.lastBackupTime()); + Assertions.assertEquals("rgjupauut", model.protectionState()); + Assertions.assertEquals(2888604604095787464L, model.deferredDeleteSyncTimeInUTC()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-15T20:29:08Z"), model.extendedInfo().lastRefreshedAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-13T05:34:56Z"), + model.extendedInfo().oldestRecoveryPoint()); + Assertions.assertEquals(89548348, model.extendedInfo().recoveryPointCount()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabJobExtendeTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabJobExtendeTests.java new file mode 100644 index 000000000000..71dac248f045 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabJobExtendeTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.MabJobExtendedInfo; +import java.time.Duration; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MabJobExtendeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MabJobExtendedInfo model = BinaryData.fromString( + "{\"tasksList\":[{\"taskId\":\"yiba\",\"startTime\":\"2021-07-04T22:46:20Z\",\"endTime\":\"2021-06-22T01:48:05Z\",\"duration\":\"PT216H18M24S\",\"status\":\"tmhrkwofyyvoqacp\"}],\"propertyBag\":{\"wbwo\":\"pbtg\",\"kcnqxwbpo\":\"nwashrtd\",\"aasipqi\":\"ulpiuj\"},\"dynamicErrorMessage\":\"byuqerpqlp\"}") + .toObject(MabJobExtendedInfo.class); + Assertions.assertEquals("yiba", model.tasksList().get(0).taskId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-04T22:46:20Z"), model.tasksList().get(0).startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T01:48:05Z"), model.tasksList().get(0).endTime()); + Assertions.assertEquals(Duration.parse("PT216H18M24S"), model.tasksList().get(0).duration()); + Assertions.assertEquals("tmhrkwofyyvoqacp", model.tasksList().get(0).status()); + Assertions.assertEquals("pbtg", model.propertyBag().get("wbwo")); + Assertions.assertEquals("byuqerpqlp", model.dynamicErrorMessage()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabJobTaskDetTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabJobTaskDetTests.java new file mode 100644 index 000000000000..22e454583a4c --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabJobTaskDetTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.MabJobTaskDetails; +import java.time.Duration; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MabJobTaskDetTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MabJobTaskDetails model = BinaryData.fromString( + "{\"taskId\":\"cciuqgbdbutau\",\"startTime\":\"2021-03-08T12:51:31Z\",\"endTime\":\"2021-09-10T07:31:19Z\",\"duration\":\"PT19M8S\",\"status\":\"h\"}") + .toObject(MabJobTaskDetails.class); + Assertions.assertEquals("cciuqgbdbutau", model.taskId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-08T12:51:31Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-10T07:31:19Z"), model.endTime()); + Assertions.assertEquals(Duration.parse("PT19M8S"), model.duration()); + Assertions.assertEquals("h", model.status()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabJobTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabJobTests.java new file mode 100644 index 000000000000..ac1ad0fb4299 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/MabJobTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.JobSupportedAction; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.MabJob; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.MabServerType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.WorkloadType; +import java.time.Duration; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MabJobTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MabJob model = BinaryData.fromString( + "{\"jobType\":\"MabJob\",\"duration\":\"PT30H25M36S\",\"actionsInfo\":[\"Cancellable\"],\"mabServerName\":\"xclvit\",\"mabServerType\":\"VCenter\",\"workloadType\":\"VM\",\"errorDetails\":[{\"errorString\":\"ggbhcohfwds\",\"recommendations\":[\"aljutiiswac\"]},{\"errorString\":\"gdkz\",\"recommendations\":[\"kfvhqcrailvpn\",\"pfuflrw\",\"mh\",\"lxyjr\"]}],\"extendedInfo\":{\"tasksList\":[{\"taskId\":\"fcnihgwq\",\"startTime\":\"2021-02-20T01:03:23Z\",\"endTime\":\"2021-01-01T23:39:14Z\",\"duration\":\"PT210H4M58S\",\"status\":\"cvkcvqvpkeqdcv\"},{\"taskId\":\"hvoodsotbobzd\",\"startTime\":\"2021-08-05T12:30:09Z\",\"endTime\":\"2021-09-04T23:27:53Z\",\"duration\":\"PT71H37M37S\",\"status\":\"dldwmgxc\"},{\"taskId\":\"slpmutwuo\",\"startTime\":\"2021-07-03T15:36:28Z\",\"endTime\":\"2021-08-11T07:57:19Z\",\"duration\":\"PT74H5M31S\",\"status\":\"niyqslui\"},{\"taskId\":\"dggkzzlvmbmpa\",\"startTime\":\"2021-04-28T10:55:20Z\",\"endTime\":\"2021-11-18T02:02:33Z\",\"duration\":\"PT212H53M21S\",\"status\":\"fy\"}],\"propertyBag\":{\"ft\":\"pfvmwyhrfou\",\"iyzvqtmnub\":\"akcp\"},\"dynamicErrorMessage\":\"kpzksmondjmq\"},\"entityFriendlyName\":\"vypomgkopkwho\",\"backupManagementType\":\"Invalid\",\"operation\":\"jqg\",\"status\":\"smocmbq\",\"startTime\":\"2021-08-15T23:09:36Z\",\"endTime\":\"2021-03-04T23:45:02Z\",\"activityId\":\"xozap\"}") + .toObject(MabJob.class); + Assertions.assertEquals("vypomgkopkwho", model.entityFriendlyName()); + Assertions.assertEquals(BackupManagementType.INVALID, model.backupManagementType()); + Assertions.assertEquals("jqg", model.operation()); + Assertions.assertEquals("smocmbq", model.status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-15T23:09:36Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-04T23:45:02Z"), model.endTime()); + Assertions.assertEquals("xozap", model.activityId()); + Assertions.assertEquals(Duration.parse("PT30H25M36S"), model.duration()); + Assertions.assertEquals(JobSupportedAction.CANCELLABLE, model.actionsInfo().get(0)); + Assertions.assertEquals("xclvit", model.mabServerName()); + Assertions.assertEquals(MabServerType.VCENTER, model.mabServerType()); + Assertions.assertEquals(WorkloadType.VM, model.workloadType()); + Assertions.assertEquals("fcnihgwq", model.extendedInfo().tasksList().get(0).taskId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-20T01:03:23Z"), + model.extendedInfo().tasksList().get(0).startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-01T23:39:14Z"), + model.extendedInfo().tasksList().get(0).endTime()); + Assertions.assertEquals(Duration.parse("PT210H4M58S"), model.extendedInfo().tasksList().get(0).duration()); + Assertions.assertEquals("cvkcvqvpkeqdcv", model.extendedInfo().tasksList().get(0).status()); + Assertions.assertEquals("pfvmwyhrfou", model.extendedInfo().propertyBag().get("ft")); + Assertions.assertEquals("kpzksmondjmq", model.extendedInfo().dynamicErrorMessage()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/NameInfoTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/NameInfoTests.java new file mode 100644 index 000000000000..534c57727730 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/NameInfoTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.NameInfo; +import org.junit.jupiter.api.Assertions; + +public final class NameInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NameInfo model = BinaryData.fromString("{\"value\":\"ntypmrbpizcdrqj\",\"localizedValue\":\"pyd\"}") + .toObject(NameInfo.class); + Assertions.assertEquals("ntypmrbpizcdrqj", model.value()); + Assertions.assertEquals("pyd", model.localizedValue()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/OperationStatTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/OperationStatTests.java new file mode 100644 index 000000000000..6eda8a21ffdd --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/OperationStatTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OperationStatusExtendedInfo; + +public final class OperationStatTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationStatusExtendedInfo model = BinaryData.fromString("{\"objectType\":\"OperationStatusExtendedInfo\"}") + .toObject(OperationStatusExtendedInfo.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/PointInTimeRaTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/PointInTimeRaTests.java new file mode 100644 index 000000000000..9e72159860c1 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/PointInTimeRaTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.PointInTimeRange; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class PointInTimeRaTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PointInTimeRange model + = BinaryData.fromString("{\"startTime\":\"2021-04-02T13:56:53Z\",\"endTime\":\"2021-02-06T20:35:46Z\"}") + .toObject(PointInTimeRange.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-02T13:56:53Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T20:35:46Z"), model.endTime()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ProtectedItemTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ProtectedItemTests.java new file mode 100644 index 000000000000..3623c10b9f84 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ProtectedItemTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.ProtectedItemResourceListInner; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.CreateMode; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.DataSourceType; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ProtectedItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProtectedItemResourceListInner model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"protectedItemType\":\"ProtectedItem\",\"backupManagementType\":\"DPM\",\"workloadType\":\"GenericDataSource\",\"containerName\":\"znqntoru\",\"sourceResourceId\":\"gsahmkycgrauw\",\"policyId\":\"etaebu\",\"lastRecoveryPoint\":\"2021-09-21T03:41:44Z\",\"backupSetName\":\"movsmzlxwabmqoe\",\"createMode\":\"Default\",\"deferredDeleteTimeInUTC\":\"2021-11-25T20:27:09Z\",\"isScheduledForDeferredDelete\":false,\"deferredDeleteTimeRemaining\":\"u\",\"isDeferredDeleteScheduleUpcoming\":false,\"isRehydrate\":false,\"resourceGuardOperationRequests\":[\"kfbtndoaongbjc\",\"tujitcjedft\",\"waezkojvd\"]},\"eTag\":\"zfoqouicybxar\",\"location\":\"gszufoxciqopid\",\"tags\":{\"khnzbonlw\":\"ciodhkhaz\",\"dwbwhkszzcmrvexz\":\"toego\",\"owtlmnguxawqald\":\"vbtqgsfraoyzk\",\"bykutw\":\"yuuximerqfobwyzn\"},\"id\":\"fhpagmhrskdsnf\",\"name\":\"sd\",\"type\":\"akgtdlmkkzevdlh\"},{\"properties\":{\"protectedItemType\":\"ProtectedItem\",\"backupManagementType\":\"AzureWorkload\",\"workloadType\":\"SAPAseDatabase\",\"containerName\":\"ttwvogvbbe\",\"sourceResourceId\":\"cngqqmoakufgmjz\",\"policyId\":\"rdgrtw\",\"lastRecoveryPoint\":\"2021-01-23T08:17:26Z\",\"backupSetName\":\"uzkopbminrfd\",\"createMode\":\"Recover\",\"deferredDeleteTimeInUTC\":\"2021-07-17T19:38:14Z\",\"isScheduledForDeferredDelete\":true,\"deferredDeleteTimeRemaining\":\"u\",\"isDeferredDeleteScheduleUpcoming\":true,\"isRehydrate\":false,\"resourceGuardOperationRequests\":[\"dmsmlm\",\"qhoftrmaequiah\",\"icslfaoq\",\"piyylhalnswhccsp\"]},\"eTag\":\"aivwitqscywu\",\"location\":\"gwol\",\"tags\":{\"i\":\"zbwemh\",\"wmsweypqwd\":\"sbrgz\",\"mkttlstvlzywem\":\"ggicccnxqhue\",\"lusiy\":\"zrncsdt\"},\"id\":\"bsfgytguslfea\",\"name\":\"cy\",\"type\":\"qukyhejhzi\"},{\"properties\":{\"protectedItemType\":\"ProtectedItem\",\"backupManagementType\":\"MAB\",\"workloadType\":\"GenericDataSource\",\"containerName\":\"olppvksrpqvujz\",\"sourceResourceId\":\"ehtwdwrft\",\"policyId\":\"iby\",\"lastRecoveryPoint\":\"2021-07-06T15:36:40Z\",\"backupSetName\":\"bhshfwpracstwity\",\"createMode\":\"Recover\",\"deferredDeleteTimeInUTC\":\"2021-11-26T04:46:53Z\",\"isScheduledForDeferredDelete\":true,\"deferredDeleteTimeRemaining\":\"dcpnmdyodnw\",\"isDeferredDeleteScheduleUpcoming\":true,\"isRehydrate\":false,\"resourceGuardOperationRequests\":[\"nhltiugcxn\",\"vvwxqi\",\"y\"]},\"eTag\":\"nyowxwlmdjrkvfg\",\"location\":\"vfvpdbodaciz\",\"tags\":{\"hvxndzwmkrefajpj\":\"lhkrribdeibqipqk\"},\"id\":\"rwkq\",\"name\":\"yhgbijtjivfx\",\"type\":\"sjabibs\"}],\"nextLink\":\"tawfsdjpvkvp\"}") + .toObject(ProtectedItemResourceListInner.class); + Assertions.assertEquals("tawfsdjpvkvp", model.nextLink()); + Assertions.assertEquals("gszufoxciqopid", model.value().get(0).location()); + Assertions.assertEquals("ciodhkhaz", model.value().get(0).tags().get("khnzbonlw")); + Assertions.assertEquals(BackupManagementType.DPM, model.value().get(0).properties().backupManagementType()); + Assertions.assertEquals(DataSourceType.GENERIC_DATA_SOURCE, model.value().get(0).properties().workloadType()); + Assertions.assertEquals("znqntoru", model.value().get(0).properties().containerName()); + Assertions.assertEquals("gsahmkycgrauw", model.value().get(0).properties().sourceResourceId()); + Assertions.assertEquals("etaebu", model.value().get(0).properties().policyId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T03:41:44Z"), + model.value().get(0).properties().lastRecoveryPoint()); + Assertions.assertEquals("movsmzlxwabmqoe", model.value().get(0).properties().backupSetName()); + Assertions.assertEquals(CreateMode.DEFAULT, model.value().get(0).properties().createMode()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-25T20:27:09Z"), + model.value().get(0).properties().deferredDeleteTimeInUTC()); + Assertions.assertFalse(model.value().get(0).properties().isScheduledForDeferredDelete()); + Assertions.assertEquals("u", model.value().get(0).properties().deferredDeleteTimeRemaining()); + Assertions.assertFalse(model.value().get(0).properties().isDeferredDeleteScheduleUpcoming()); + Assertions.assertFalse(model.value().get(0).properties().isRehydrate()); + Assertions.assertEquals("kfbtndoaongbjc", + model.value().get(0).properties().resourceGuardOperationRequests().get(0)); + Assertions.assertEquals("zfoqouicybxar", model.value().get(0).eTag()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RecoveryPMockTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RecoveryPMockTests.java new file mode 100644 index 000000000000..db0e94931209 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RecoveryPMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.RecoveryServicesBackupCrrManager; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RecoveryPointResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RecoveryPMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"objectType\":\"RecoveryPoint\"},\"tags\":{\"qchiszep\":\"gdxpg\",\"crxgibb\":\"nb\",\"sukokwbqplhl\":\"axconfozauo\"},\"location\":\"uuepzlrphwzsoldw\",\"eTag\":\"uqdunvmnnrwrbi\",\"id\":\"ktalywjhhgdnhxms\",\"name\":\"v\",\"type\":\"omi\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupCrrManager manager = RecoveryServicesBackupCrrManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + RecoveryPointResource response = manager.recoveryPointsCrrs() + .getWithResponse("neekulfg", "lqubkwdlen", "d", "utujba", "pjuohminyfl", "orwmduvwpklv", + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("gdxpg", response.tags().get("qchiszep")); + Assertions.assertEquals("uuepzlrphwzsoldw", response.location()); + Assertions.assertEquals("uqdunvmnnrwrbi", response.eTag()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RecoveryPointTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RecoveryPointTests.java new file mode 100644 index 000000000000..18cd494963f1 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RecoveryPointTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.fluent.models.RecoveryPointResourceInner; +import org.junit.jupiter.api.Assertions; + +public final class RecoveryPointTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryPointResourceInner model = BinaryData.fromString( + "{\"properties\":{\"objectType\":\"RecoveryPoint\"},\"tags\":{\"ipa\":\"to\"},\"location\":\"ajpsquc\",\"eTag\":\"o\",\"id\":\"dkfo\",\"name\":\"knygjofjddeq\",\"type\":\"rd\"}") + .toObject(RecoveryPointResourceInner.class); + Assertions.assertEquals("to", model.tags().get("ipa")); + Assertions.assertEquals("ajpsquc", model.location()); + Assertions.assertEquals("o", model.eTag()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ResourceListTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ResourceListTests.java new file mode 100644 index 000000000000..91407440b24c --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/ResourceListTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.ResourceList; +import org.junit.jupiter.api.Assertions; + +public final class ResourceListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceList model = BinaryData.fromString("{\"nextLink\":\"zrkgqhcjrefovg\"}").toObject(ResourceList.class); + Assertions.assertEquals("zrkgqhcjrefovg", model.nextLink()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RestoreFileSpTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RestoreFileSpTests.java new file mode 100644 index 000000000000..adfb11ac76e0 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RestoreFileSpTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RestoreFileSpecs; +import org.junit.jupiter.api.Assertions; + +public final class RestoreFileSpTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RestoreFileSpecs model = BinaryData.fromString( + "{\"path\":\"ixzbinjeputtmryw\",\"fileSpecType\":\"zoqftiyqzrnkcqvy\",\"targetFolderPath\":\"whzlsicohoq\"}") + .toObject(RestoreFileSpecs.class); + Assertions.assertEquals("ixzbinjeputtmryw", model.path()); + Assertions.assertEquals("zoqftiyqzrnkcqvy", model.fileSpecType()); + Assertions.assertEquals("whzlsicohoq", model.targetFolderPath()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RestoreFileSpecs model = new RestoreFileSpecs().withPath("ixzbinjeputtmryw") + .withFileSpecType("zoqftiyqzrnkcqvy") + .withTargetFolderPath("whzlsicohoq"); + model = BinaryData.fromObject(model).toObject(RestoreFileSpecs.class); + Assertions.assertEquals("ixzbinjeputtmryw", model.path()); + Assertions.assertEquals("zoqftiyqzrnkcqvy", model.fileSpecType()); + Assertions.assertEquals("whzlsicohoq", model.targetFolderPath()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RestoreRequesTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RestoreRequesTests.java new file mode 100644 index 000000000000..3719030026dc --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/RestoreRequesTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.RestoreRequest; + +public final class RestoreRequesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RestoreRequest model + = BinaryData.fromString("{\"objectType\":\"RestoreRequest\"}").toObject(RestoreRequest.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RestoreRequest model = new RestoreRequest(); + model = BinaryData.fromObject(model).toObject(RestoreRequest.class); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/SQLDataDirectTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/SQLDataDirectTests.java new file mode 100644 index 000000000000..a1279ade4c1e --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/SQLDataDirectTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.SQLDataDirectory; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.SQLDataDirectoryType; +import org.junit.jupiter.api.Assertions; + +public final class SQLDataDirectTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SQLDataDirectory model + = BinaryData.fromString("{\"type\":\"Invalid\",\"path\":\"toqcjmklja\",\"logicalName\":\"qidtqajzyu\"}") + .toObject(SQLDataDirectory.class); + Assertions.assertEquals(SQLDataDirectoryType.INVALID, model.type()); + Assertions.assertEquals("toqcjmklja", model.path()); + Assertions.assertEquals("qidtqajzyu", model.logicalName()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/TargetAFSRestTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/TargetAFSRestTests.java new file mode 100644 index 000000000000..d411d1cbc5eb --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/TargetAFSRestTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.TargetAFSRestoreInfo; +import org.junit.jupiter.api.Assertions; + +public final class TargetAFSRestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TargetAFSRestoreInfo model = BinaryData.fromString("{\"name\":\"wvl\",\"targetResourceId\":\"avwhheunm\"}") + .toObject(TargetAFSRestoreInfo.class); + Assertions.assertEquals("wvl", model.name()); + Assertions.assertEquals("avwhheunm", model.targetResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TargetAFSRestoreInfo model = new TargetAFSRestoreInfo().withName("wvl").withTargetResourceId("avwhheunm"); + model = BinaryData.fromObject(model).toObject(TargetAFSRestoreInfo.class); + Assertions.assertEquals("wvl", model.name()); + Assertions.assertEquals("avwhheunm", model.targetResourceId()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/TargetRestoreTests.java b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/TargetRestoreTests.java new file mode 100644 index 000000000000..090f33a8fc90 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/src/test/java/com/azure/resourcemanager/recoveryservicesbackupcrossregionrestore/generated/TargetRestoreTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.OverwriteOptions; +import com.azure.resourcemanager.recoveryservicesbackupcrossregionrestore.models.TargetRestoreInfo; +import org.junit.jupiter.api.Assertions; + +public final class TargetRestoreTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TargetRestoreInfo model = BinaryData.fromString( + "{\"overwriteOption\":\"Invalid\",\"containerId\":\"vjtoqnermclfp\",\"databaseName\":\"hoxus\",\"targetDirectoryForFileRestore\":\"pabgyeps\"}") + .toObject(TargetRestoreInfo.class); + Assertions.assertEquals(OverwriteOptions.INVALID, model.overwriteOption()); + Assertions.assertEquals("vjtoqnermclfp", model.containerId()); + Assertions.assertEquals("hoxus", model.databaseName()); + Assertions.assertEquals("pabgyeps", model.targetDirectoryForFileRestore()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TargetRestoreInfo model = new TargetRestoreInfo().withOverwriteOption(OverwriteOptions.INVALID) + .withContainerId("vjtoqnermclfp") + .withDatabaseName("hoxus") + .withTargetDirectoryForFileRestore("pabgyeps"); + model = BinaryData.fromObject(model).toObject(TargetRestoreInfo.class); + Assertions.assertEquals(OverwriteOptions.INVALID, model.overwriteOption()); + Assertions.assertEquals("vjtoqnermclfp", model.containerId()); + Assertions.assertEquals("hoxus", model.databaseName()); + Assertions.assertEquals("pabgyeps", model.targetDirectoryForFileRestore()); + } +} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/tsp-location.yaml b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/tsp-location.yaml new file mode 100644 index 000000000000..14ada94bfbd8 --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/recoveryservicesbackupcrr/resource-manager/Microsoft.RecoveryServices/RecoveryServicesBackupCrr +commit: e2b167bfbb5cb118d84bdc44774324c5bd52620d +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/recoveryservicesbackupcrossregionrestore/ci.yml b/sdk/recoveryservicesbackupcrossregionrestore/ci.yml new file mode 100644 index 000000000000..f821a412837e --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservicesbackupcrossregionrestore/ci.yml + - sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/ + exclude: + - sdk/recoveryservicesbackupcrossregionrestore/pom.xml + - sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservicesbackupcrossregionrestore/ci.yml + - sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/ + exclude: + - sdk/recoveryservicesbackupcrossregionrestore/pom.xml + - sdk/recoveryservicesbackupcrossregionrestore/azure-resourcemanager-recoveryservicesbackupcrossregionrestore/pom.xml + +parameters: + - name: release_azureresourcemanagerrecoveryservicesbackupcrossregionrestore + displayName: azure-resourcemanager-recoveryservicesbackupcrossregionrestore + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: recoveryservicesbackupcrossregionrestore + Artifacts: + - name: azure-resourcemanager-recoveryservicesbackupcrossregionrestore + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerrecoveryservicesbackupcrossregionrestore + releaseInBatch: ${{ parameters.release_azureresourcemanagerrecoveryservicesbackupcrossregionrestore }} diff --git a/sdk/recoveryservicesbackupcrossregionrestore/pom.xml b/sdk/recoveryservicesbackupcrossregionrestore/pom.xml new file mode 100644 index 000000000000..d8e38d4f7b6b --- /dev/null +++ b/sdk/recoveryservicesbackupcrossregionrestore/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-recoveryservicesbackupcrossregionrestore-service + pom + 1.0.0 + + + azure-resourcemanager-recoveryservicesbackupcrossregionrestore + +