From 7ff39e02373066886694970593f780d041564d7a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 25 Nov 2021 10:38:21 +0000 Subject: [PATCH] CodeGen from PR 16865 in Azure/azure-rest-api-specs Merge 5e7b20d92c5a15b6b3f9170819337e1053576afc into 754938e4cb9416358b02dcc11f444adf14b3b7b6 --- .../CHANGELOG.md | 3 +- .../README.md | 7 +- .../SAMPLE.md | 2717 +++++++++++++++++ .../pom.xml | 121 +- .../RecoveryServicesBackupManager.java | 322 +- .../fluent/AadPropertiesOperationsClient.java | 40 - .../fluent/BackupCrrJobDetailsClient.java | 42 - .../fluent/BackupCrrJobsClient.java | 45 - ...BackupResourceEncryptionConfigsClient.java | 14 +- ...pResourceStorageConfigsNonCrrsClient.java} | 6 +- .../fluent/CrossRegionRestoresClient.java | 68 - .../fluent/CrrOperationResultsClient.java | 35 - .../fluent/CrrOperationStatusClient.java | 37 - ...nt.java => OperationOperationsClient.java} | 32 +- .../fluent/OperationsClient.java | 30 +- .../fluent/OperationsOperationsClient.java | 36 - .../PrivateEndpointConnectionsClient.java | 8 +- .../fluent/ProtectionPoliciesClient.java | 4 +- .../fluent/RecoveryPointsClient.java | 54 - .../fluent/RecoveryPointsCrrsClient.java | 56 - .../fluent/RecoveryServicesBackupClient.java | 172 +- ...t.java => ResourceGuardProxiesClient.java} | 21 +- .../ResourceGuardProxyOperationsClient.java | 142 + .../fluent/ResourceProvidersClient.java | 12 +- .../fluent/RestoresClient.java | 4 +- .../fluent/SecurityPINsClient.java | 5 +- .../models/AadPropertiesResourceInner.java | 96 - ...ncryptionConfigExtendedResourceInner.java} | 32 +- ... ResourceGuardProxyBaseResourceInner.java} | 30 +- .../models/UnlockDeleteResponseInner.java | 50 + .../AadPropertiesOperationsClientImpl.java | 237 -- .../AadPropertiesOperationsImpl.java | 60 - .../AadPropertiesResourceImpl.java | 65 - .../BackupCrrJobDetailsImpl.java | 61 - .../BackupCrrJobsClientImpl.java | 383 --- .../implementation/BackupCrrJobsImpl.java | 50 - .../BackupEnginesClientImpl.java | 12 +- .../implementation/BackupJobsClientImpl.java | 6 +- .../BackupOperationResultsClientImpl.java | 6 +- .../BackupOperationStatusesClientImpl.java | 6 +- .../BackupPoliciesClientImpl.java | 6 +- .../BackupProtectableItemsClientImpl.java | 6 +- .../BackupProtectedItemsClientImpl.java | 6 +- .../BackupProtectedItemsCrrsImpl.java | 49 - .../BackupProtectionContainersClientImpl.java | 6 +- .../BackupProtectionIntentsClientImpl.java | 6 +- ...EncryptionConfigExtendedResourceImpl.java} | 19 +- ...upResourceEncryptionConfigsClientImpl.java | 43 +- .../BackupResourceEncryptionConfigsImpl.java | 21 +- ...ourceStorageConfigsNonCrrsClientImpl.java} | 50 +- ...kupResourceStorageConfigsNonCrrsImpl.java} | 16 +- .../BackupResourceVaultConfigsClientImpl.java | 18 +- .../BackupStatusClientImpl.java | 6 +- .../BackupUsageSummariesClientImpl.java | 6 +- .../BackupUsageSummariesCrrsClientImpl.java | 282 -- .../BackupUsageSummariesCrrsImpl.java | 49 - .../BackupWorkloadItemsClientImpl.java | 6 +- .../implementation/BackupsClientImpl.java | 6 +- ...areDataMoveOperationResultsClientImpl.java | 6 +- .../CrossRegionRestoresClientImpl.java | 310 -- .../CrossRegionRestoresImpl.java | 43 - .../CrrOperationResultsClientImpl.java | 198 -- .../CrrOperationResultsImpl.java | 43 - .../CrrOperationStatusClientImpl.java | 209 -- .../ExportJobsOperationResultsClientImpl.java | 6 +- .../FeatureSupportsClientImpl.java | 6 +- ...temLevelRecoveryConnectionsClientImpl.java | 12 +- .../JobCancellationsClientImpl.java | 6 +- .../implementation/JobDetailsClientImpl.java | 6 +- .../JobOperationResultsClientImpl.java | 6 +- .../implementation/JobsClientImpl.java | 6 +- ...ava => OperationOperationsClientImpl.java} | 135 +- ...Impl.java => OperationOperationsImpl.java} | 36 +- .../implementation/OperationsClientImpl.java | 261 +- .../implementation/OperationsImpl.java | 35 +- .../OperationsOperationsClientImpl.java | 272 -- .../OperationsOperationsImpl.java | 47 - .../PrivateEndpointConnectionsClientImpl.java | 34 +- .../PrivateEndpointsClientImpl.java | 6 +- .../ProtectableContainersClientImpl.java | 6 +- ...otectedItemOperationResultsClientImpl.java | 6 +- ...tectedItemOperationStatusesClientImpl.java | 6 +- .../ProtectedItemsClientImpl.java | 18 +- .../implementation/ProtectedItemsImpl.java | 3 +- ...onContainerOperationResultsClientImpl.java | 6 +- ...inerRefreshOperationResultsClientImpl.java | 6 +- .../ProtectionContainersClientImpl.java | 30 +- .../ProtectionIntentsClientImpl.java | 24 +- .../implementation/ProtectionIntentsImpl.java | 2 +- .../ProtectionPoliciesClientImpl.java | 26 +- ...ctionPolicyOperationResultsClientImpl.java | 6 +- ...tionPolicyOperationStatusesClientImpl.java | 6 +- .../RecoveryPointsClientImpl.java | 307 +- .../RecoveryPointsCrrsClientImpl.java | 455 --- .../RecoveryPointsCrrsImpl.java | 59 - .../implementation/RecoveryPointsImpl.java | 61 - ...ryPointsRecommendedForMovesClientImpl.java | 6 +- .../RecoveryServicesBackupClientImpl.java | 343 +-- ...va => ResourceGuardProxiesClientImpl.java} | 152 +- .../ResourceGuardProxiesImpl.java | 50 + ...> ResourceGuardProxyBaseResourceImpl.java} | 18 +- ...esourceGuardProxyOperationsClientImpl.java | 818 +++++ .../ResourceGuardProxyOperationsImpl.java | 134 + .../ResourceProvidersClientImpl.java | 48 +- .../implementation/RestoresClientImpl.java | 14 +- .../SecurityPINsClientImpl.java | 60 +- .../implementation/SecurityPINsImpl.java | 6 +- .../UnlockDeleteResponseImpl.java | 33 + .../models/AadProperties.java | 154 - .../models/AadPropertiesOperations.java | 35 - .../models/AzureBackupServerContainer.java | 4 +- .../models/AzureBackupServerEngine.java | 4 +- .../AzureFileShareProtectionPolicy.java | 9 + ...reFileShareRecoveryPointAutoGenerated.java | 93 - .../models/AzureFileshareProtectedItem.java | 10 + ...reFileshareProtectedItemAutoGenerated.java | 350 --- .../AzureIaaSClassicComputeVMContainer.java | 4 +- ...reIaaSClassicComputeVMProtectableItem.java | 4 +- ...zureIaaSClassicComputeVMProtectedItem.java | 12 +- .../models/AzureIaaSComputeVMContainer.java | 4 +- .../AzureIaaSComputeVMProtectableItem.java | 4 +- .../AzureIaaSComputeVMProtectedItem.java | 12 +- .../models/AzureIaaSvmJobExtendedInfo.java | 3 + .../models/AzureIaaSvmProtectedItem.java | 9 + .../models/AzureIaaSvmProtectionPolicy.java | 8 + ...eRecoveryServiceVaultProtectionIntent.java | 4 +- .../models/AzureSqlContainer.java | 4 +- .../models/AzureSqlProtectedItem.java | 8 + .../models/AzureSqlProtectionPolicy.java | 8 + ...gWorkloadContainerProtectionContainer.java | 4 +- .../models/AzureStorageJobExtendedInfo.java | 2 + .../AzureStorageProtectableContainer.java | 4 +- ...ureVMAppContainerProtectableContainer.java | 4 +- ...zureVMAppContainerProtectionContainer.java | 4 +- .../models/AzureVmWorkloadProtectedItem.java | 11 + .../AzureVmWorkloadProtectionPolicy.java | 8 + ...VmWorkloadSapAseDatabaseProtectedItem.java | 13 +- ...eVmWorkloadSapAseDatabaseWorkloadItem.java | 4 +- ...VmWorkloadSapAseSystemProtectableItem.java | 4 +- ...ureVmWorkloadSapAseSystemWorkloadItem.java | 4 +- ...orkloadSapHanaDatabaseProtectableItem.java | 4 +- ...mWorkloadSapHanaDatabaseProtectedItem.java | 13 +- ...VmWorkloadSapHanaDatabaseWorkloadItem.java | 4 +- ...mWorkloadSapHanaSystemProtectableItem.java | 4 +- ...reVmWorkloadSapHanaSystemWorkloadItem.java | 4 +- ...adSqlAvailabilityGroupProtectableItem.java | 4 +- ...eVmWorkloadSqlDatabaseProtectableItem.java | 4 +- ...ureVmWorkloadSqlDatabaseProtectedItem.java | 13 +- ...zureVmWorkloadSqlDatabaseWorkloadItem.java | 4 +- ...eVmWorkloadSqlInstanceProtectableItem.java | 4 +- .../AzureWorkloadAutoProtectionIntent.java | 4 +- .../models/AzureWorkloadJobExtendedInfo.java | 2 + ...PointInTimeRecoveryPointAutoGenerated.java | 88 - ...zureWorkloadPointInTimeRestoreRequest.java | 7 + ...ointInTimeRestoreRequestAutoGenerated.java | 103 - .../models/AzureWorkloadRecoveryPoint.java | 2 + ...ureWorkloadRecoveryPointAutoGenerated.java | 144 - .../models/AzureWorkloadRestoreRequest.java | 32 + ...reWorkloadRestoreRequestAutoGenerated.java | 214 -- ...rkloadSapHanaPointInTimeRecoveryPoint.java | 4 +- ...PointInTimeRecoveryPointAutoGenerated.java | 57 - ...kloadSapHanaPointInTimeRestoreRequest.java | 7 + ...ointInTimeRestoreRequestAutoGenerated.java | 104 - ...ointInTimeRestoreWithRehydrateRequest.java | 8 + .../AzureWorkloadSapHanaRecoveryPoint.java | 4 +- ...loadSapHanaRecoveryPointAutoGenerated.java | 48 - .../AzureWorkloadSapHanaRestoreRequest.java | 11 +- ...oadSapHanaRestoreRequestAutoGenerated.java | 83 - ...oadSapHanaRestoreWithRehydrateRequest.java | 7 + ...PointInTimeRecoveryPointAutoGenerated.java | 87 - ...eWorkloadSqlPointInTimeRestoreRequest.java | 7 + ...ointInTimeRestoreRequestAutoGenerated.java | 127 - ...ointInTimeRestoreWithRehydrateRequest.java | 8 + ...WorkloadSqlRecoveryPointAutoGenerated.java | 96 - ...ecoveryPointExtendedInfoAutoGenerated.java | 60 - .../AzureWorkloadSqlRestoreRequest.java | 7 + ...orkloadSqlRestoreRequestAutoGenerated.java | 173 -- ...orkloadSqlRestoreWithRehydrateRequest.java | 7 + .../models/BackupCrrJobDetails.java | 36 - .../models/BackupCrrJobs.java | 39 - .../BackupResourceEncryptionConfig.java | 2 +- ...ackupResourceEncryptionConfigExtended.java | 114 + ...urceEncryptionConfigExtendedResource.java} | 16 +- ...ackupResourceEncryptionConfigResource.java | 98 +- .../BackupResourceEncryptionConfigs.java | 12 +- ... BackupResourceStorageConfigsNonCrrs.java} | 4 +- .../models/BackupResourceVaultConfig.java | 27 + .../models/CrossRegionRestoreRequest.java | 83 - .../models/CrossRegionRestores.java | 33 - .../models/CrrAccessToken.java | 685 ----- .../models/CrrJobRequest.java | 76 - .../models/CrrOperationResults.java | 31 - .../models/CrrOperationStatus.java | 32 - .../models/DpmBackupEngine.java | 4 +- .../models/DpmJobExtendedInfo.java | 2 + .../models/DpmProtectedItem.java | 8 + .../models/DpmProtectedItemExtendedInfo.java | 2 + .../models/GenericContainerExtendedInfo.java | 2 + .../models/GenericProtectedItem.java | 10 + .../models/GenericProtectionPolicy.java | 7 + .../models/HealthState.java | 40 - .../models/IaasVMRecoveryPoint.java | 2 + .../IaasVMRecoveryPointAutoGenerated.java | 394 --- .../models/IaasVMRestoreRequest.java | 30 + .../IaasVMRestoreWithRehydrationRequest.java | 7 + .../models/IdentityInfo.java | 83 + .../models/IntentItemType.java | 37 - .../models/JobOperationType.java | 61 - .../models/JobStatus.java | 49 - .../models/LastUpdateStatus.java | 6 + .../models/MabFileFolderProtectedItem.java | 8 + .../models/MabJobExtendedInfo.java | 2 + .../models/MabProtectionPolicy.java | 8 + ...temsCrrs.java => OperationOperations.java} | 25 +- .../models/OperationStatusExtendedInfo.java | 5 +- .../OperationStatusJobsExtendedInfo.java | 2 + ...rationStatusRecoveryPointExtendedInfo.java | 88 - .../models/OperationWorkerResponse.java | 2 + .../models/Operations.java | 23 +- .../models/OperationsOperations.java | 31 - .../models/PrepareDataMoveResponse.java | 2 + .../models/ProtectedItem.java | 32 +- .../models/ProtectionPolicy.java | 27 + .../models/RecoveryPoint.java | 5 +- .../models/RecoveryPointTierInformation.java | 2 + .../models/RecoveryPoints.java | 51 - .../models/RecoveryPointsCrrs.java | 51 - .../models/ResourceGuardOperationDetail.java | 76 + ...iesCrrs.java => ResourceGuardProxies.java} | 19 +- .../models/ResourceGuardProxyBase.java | 133 + ...va => ResourceGuardProxyBaseResource.java} | 15 +- .../ResourceGuardProxyBaseResourceList.java | 64 + .../models/ResourceGuardProxyOperations.java | 129 + .../models/RestorePointQueryType.java | 49 - .../models/RestoreRequest.java | 3 +- .../models/SecurityPINs.java | 4 +- .../models/SecurityPinBase.java | 51 + .../recoveryservicesbackup/models/Type.java | 38 - .../models/UnlockDeleteRequest.java | 77 + .../models/UnlockDeleteResponse.java | 24 + ...ValidateIaasVMRestoreOperationRequest.java | 4 +- .../models/VaultJobExtendedInfo.java | 2 + .../models/WorkloadCrrAccessToken.java | 444 --- .../generated/BackupEnginesGetSamples.java | 23 + .../generated/BackupEnginesListSamples.java | 23 + .../generated/BackupJobsListSamples.java | 64 + .../BackupOperationResultsGetSamples.java | 29 + .../BackupOperationStatusesGetSamples.java | 29 + .../generated/BackupPoliciesListSamples.java | 40 + .../BackupProtectableItemsListSamples.java | 25 + .../BackupProtectedItemsListSamples.java | 30 + ...BackupProtectionContainersListSamples.java | 25 + .../BackupProtectionIntentListSamples.java | 23 + ...upResourceEncryptionConfigsGetSamples.java | 23 + ...esourceEncryptionConfigsUpdateSamples.java | 39 + ...esourceStorageConfigsNonCrrGetSamples.java | 25 + ...ourceStorageConfigsNonCrrPatchSamples.java | 37 + ...urceStorageConfigsNonCrrUpdateSamples.java | 37 + .../BackupResourceVaultConfigsGetSamples.java | 23 + .../BackupResourceVaultConfigsPutSamples.java | 37 + ...ckupResourceVaultConfigsUpdateSamples.java | 34 + .../generated/BackupStatusGetSamples.java | 33 + .../BackupUsageSummariesListSamples.java | 40 + .../BackupWorkloadItemsListSamples.java | 32 + .../generated/BackupsTriggerSamples.java | 34 + ...pareDataMoveOperationResultGetSamples.java | 25 + .../ExportJobsOperationResultsGetSamples.java | 26 + .../FeatureSupportValidateSamples.java | 29 + ...elRecoveryConnectionsProvisionSamples.java | 42 + ...LevelRecoveryConnectionsRevokeSamples.java | 32 + .../JobCancellationsTriggerSamples.java | 26 + .../generated/JobDetailsGetSamples.java | 26 + .../JobOperationResultsGetSamples.java | 30 + .../generated/JobsExportSamples.java | 23 + .../OperationOperationValidateSamples.java | 26 + .../generated/OperationsListSamples.java | 23 + ...rivateEndpointConnectionDeleteSamples.java | 26 + .../PrivateEndpointConnectionGetSamples.java | 26 + .../PrivateEndpointConnectionPutSamples.java | 51 + ...vateEndpointGetOperationStatusSamples.java | 30 + .../ProtectableContainersListSamples.java | 30 + ...otectedItemOperationResultsGetSamples.java | 32 + ...tectedItemOperationStatusesGetSamples.java | 32 + .../ProtectedItemsCreateOrUpdateSamples.java | 64 + .../ProtectedItemsDeleteSamples.java | 31 + .../generated/ProtectedItemsGetSamples.java | 54 + ...onContainerOperationResultsGetSamples.java | 31 + ...inerRefreshOperationResultsGetSamples.java | 26 + .../ProtectionContainersGetSamples.java | 25 + .../ProtectionContainersInquireSamples.java | 26 + .../ProtectionContainersRefreshSamples.java | 25 + .../ProtectionContainersRegisterSamples.java | 33 + ...ProtectionContainersUnregisterSamples.java | 26 + ...ProtectionIntentCreateOrUpdateSamples.java | 34 + .../ProtectionIntentDeleteSamples.java | 25 + .../generated/ProtectionIntentGetSamples.java | 25 + .../ProtectionIntentValidateSamples.java | 36 + ...otectionPoliciesCreateOrUpdateSamples.java | 230 ++ .../ProtectionPoliciesDeleteSamples.java | 23 + .../ProtectionPoliciesGetSamples.java | 23 + ...ctionPolicyOperationResultsGetSamples.java | 30 + ...tionPolicyOperationStatusesGetSamples.java | 30 + .../generated/RecoveryPointsGetSamples.java | 32 + .../generated/RecoveryPointsListSamples.java | 32 + ...ryPointsRecommendedForMoveListSamples.java | 36 + .../ResourceGuardProxiesGetSamples.java | 23 + ...ourceGuardProxyOperationDeleteSamples.java | 25 + ...ResourceGuardProxyOperationGetSamples.java | 25 + ...ResourceGuardProxyOperationPutSamples.java | 25 + ...uardProxyOperationUnlockDeleteSamples.java | 38 + ...urceProviderBmsPrepareDataMoveSamples.java | 35 + ...urceProviderBmsTriggerDataMoveSamples.java | 36 + ...urceProviderGetOperationStatusSamples.java | 26 + ...ourceProviderMoveRecoveryPointSamples.java | 38 + .../generated/RestoresTriggerSamples.java | 146 + .../generated/SecurityPINsGetSamples.java | 23 + 316 files changed, 8960 insertions(+), 9629 deletions(-) create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/SAMPLE.md delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/AadPropertiesOperationsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupCrrJobDetailsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupCrrJobsClient.java rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/{BackupResourceStorageConfigsClient.java => BackupResourceStorageConfigsNonCrrsClient.java} (96%) delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossRegionRestoresClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrrOperationResultsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrrOperationStatusClient.java rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/{BackupProtectedItemsCrrsClient.java => OperationOperationsClient.java} (60%) delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsOperationsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsCrrsClient.java rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/{BackupUsageSummariesCrrsClient.java => ResourceGuardProxiesClient.java} (70%) create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceGuardProxyOperationsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AadPropertiesResourceInner.java rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/{BackupResourceEncryptionConfigResourceInner.java => BackupResourceEncryptionConfigExtendedResourceInner.java} (61%) rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/{CrrAccessTokenResourceInner.java => ResourceGuardProxyBaseResourceInner.java} (62%) create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/UnlockDeleteResponseInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesOperationsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesOperationsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobDetailsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsCrrsImpl.java rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/{BackupResourceEncryptionConfigResourceImpl.java => BackupResourceEncryptionConfigExtendedResourceImpl.java} (72%) rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/{BackupResourceStorageConfigsClientImpl.java => BackupResourceStorageConfigsNonCrrsClientImpl.java} (94%) rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/{BackupResourceStorageConfigsImpl.java => BackupResourceStorageConfigsNonCrrsImpl.java} (88%) delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesCrrsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesCrrsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossRegionRestoresClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossRegionRestoresImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationResultsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationResultsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationStatusClientImpl.java rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/{BackupCrrJobDetailsClientImpl.java => OperationOperationsClientImpl.java} (57%) rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/{CrrOperationStatusImpl.java => OperationOperationsImpl.java} (51%) delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsOperationsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsOperationsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsCrrsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsCrrsImpl.java rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/{BackupProtectedItemsCrrsClientImpl.java => ResourceGuardProxiesClientImpl.java} (67%) create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxiesImpl.java rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/{CrrAccessTokenResourceImpl.java => ResourceGuardProxyBaseResourceImpl.java} (72%) create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsClientImpl.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsImpl.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/UnlockDeleteResponseImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadProperties.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadPropertiesOperations.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPointAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPointAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequestAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPointAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequestAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPointAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPointAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequestAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRecoveryPointAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointExtendedInfoAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequestAutoGenerated.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupCrrJobDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupCrrJobs.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtended.java rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/{AadPropertiesResource.java => BackupResourceEncryptionConfigExtendedResource.java} (67%) rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/{BackupResourceStorageConfigs.java => BackupResourceStorageConfigsNonCrrs.java} (97%) delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossRegionRestoreRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossRegionRestores.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrAccessToken.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrJobRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrOperationResults.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrOperationStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HealthState.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPointAutoGenerated.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IdentityInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IntentItemType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobOperationType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobStatus.java rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/{BackupProtectedItemsCrrs.java => OperationOperations.java} (62%) delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusRecoveryPointExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationsOperations.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointsCrrs.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardOperationDetail.java rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/{BackupUsageSummariesCrrs.java => ResourceGuardProxies.java} (67%) create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBase.java rename sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/{CrrAccessTokenResource.java => ResourceGuardProxyBaseResource.java} (75%) create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBaseResourceList.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyOperations.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestorePointQueryType.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPinBase.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Type.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteRequest.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteResponse.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadCrrAccessToken.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesListSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupJobsListSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationResultsGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationStatusesGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupPoliciesListSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectableItemsListSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectedItemsListSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionContainersListSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionIntentListSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsUpdateSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrPatchSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrUpdateSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsPutSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsUpdateSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupStatusGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupUsageSummariesListSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupWorkloadItemsListSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupsTriggerSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BmsPrepareDataMoveOperationResultGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ExportJobsOperationResultsGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/FeatureSupportValidateSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsProvisionSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsRevokeSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobCancellationsTriggerSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobDetailsGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobOperationResultsGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobsExportSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationOperationValidateSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationsListSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionDeleteSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionPutSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointGetOperationStatusSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectableContainersListSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationResultsGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationStatusesGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsCreateOrUpdateSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsDeleteSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerOperationResultsGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerRefreshOperationResultsGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersInquireSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRefreshSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRegisterSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersUnregisterSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentCreateOrUpdateSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentDeleteSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentValidateSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesCreateOrUpdateSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesDeleteSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationResultsGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationStatusesGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsListSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsRecommendedForMoveListSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxiesGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationDeleteSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationGetSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationPutSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationUnlockDeleteSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsPrepareDataMoveSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsTriggerDataMoveSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderGetOperationStatusSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderMoveRecoveryPointSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RestoresTriggerSamples.java create mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/SecurityPINsGetSamples.java diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/CHANGELOG.md b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/CHANGELOG.md index 1fa818252c6ed..cd34878a1b530 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/CHANGELOG.md +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-11-25) +- Azure Resource Manager RecoveryServicesBackup client library for Java. This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-2021-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-05-24) diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/README.md b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/README.md index 5c2914d45b0b5..949f267e88c1b 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/README.md +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/README.md @@ -2,7 +2,7 @@ Azure Resource Manager RecoveryServicesBackup client library for Java. -This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-2021-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-2021-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-recoveryservicesbackup - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/SAMPLE.md b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/SAMPLE.md new file mode 100644 index 0000000000000..c1f5d0e90be0a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/SAMPLE.md @@ -0,0 +1,2717 @@ +# Code snippets and samples + + +## BackupEngines + +- [Get](#backupengines_get) +- [List](#backupengines_list) + +## BackupJobs + +- [List](#backupjobs_list) + +## BackupOperationResults + +- [Get](#backupoperationresults_get) + +## BackupOperationStatuses + +- [Get](#backupoperationstatuses_get) + +## BackupPolicies + +- [List](#backuppolicies_list) + +## BackupProtectableItems + +- [List](#backupprotectableitems_list) + +## BackupProtectedItems + +- [List](#backupprotecteditems_list) + +## BackupProtectionContainers + +- [List](#backupprotectioncontainers_list) + +## BackupProtectionIntent + +- [List](#backupprotectionintent_list) + +## BackupResourceEncryptionConfigs + +- [Get](#backupresourceencryptionconfigs_get) +- [Update](#backupresourceencryptionconfigs_update) + +## BackupResourceStorageConfigsNonCrr + +- [Get](#backupresourcestorageconfigsnoncrr_get) +- [Patch](#backupresourcestorageconfigsnoncrr_patch) +- [Update](#backupresourcestorageconfigsnoncrr_update) + +## BackupResourceVaultConfigs + +- [Get](#backupresourcevaultconfigs_get) +- [Put](#backupresourcevaultconfigs_put) +- [Update](#backupresourcevaultconfigs_update) + +## BackupStatus + +- [Get](#backupstatus_get) + +## BackupUsageSummaries + +- [List](#backupusagesummaries_list) + +## BackupWorkloadItems + +- [List](#backupworkloaditems_list) + +## Backups + +- [Trigger](#backups_trigger) + +## BmsPrepareDataMoveOperationResult + +- [Get](#bmspreparedatamoveoperationresult_get) + +## ExportJobsOperationResults + +- [Get](#exportjobsoperationresults_get) + +## FeatureSupport + +- [Validate](#featuresupport_validate) + +## ItemLevelRecoveryConnections + +- [Provision](#itemlevelrecoveryconnections_provision) +- [Revoke](#itemlevelrecoveryconnections_revoke) + +## JobCancellations + +- [Trigger](#jobcancellations_trigger) + +## JobDetails + +- [Get](#jobdetails_get) + +## JobOperationResults + +- [Get](#joboperationresults_get) + +## Jobs + +- [Export](#jobs_export) + +## OperationOperation + +- [Validate](#operationoperation_validate) + +## Operations + +- [List](#operations_list) + +## PrivateEndpoint + +- [GetOperationStatus](#privateendpoint_getoperationstatus) + +## PrivateEndpointConnection + +- [Delete](#privateendpointconnection_delete) +- [Get](#privateendpointconnection_get) +- [Put](#privateendpointconnection_put) + +## ProtectableContainers + +- [List](#protectablecontainers_list) + +## ProtectedItemOperationResults + +- [Get](#protecteditemoperationresults_get) + +## ProtectedItemOperationStatuses + +- [Get](#protecteditemoperationstatuses_get) + +## ProtectedItems + +- [CreateOrUpdate](#protecteditems_createorupdate) +- [Delete](#protecteditems_delete) +- [Get](#protecteditems_get) + +## ProtectionContainerOperationResults + +- [Get](#protectioncontaineroperationresults_get) + +## ProtectionContainerRefreshOperationResults + +- [Get](#protectioncontainerrefreshoperationresults_get) + +## ProtectionContainers + +- [Get](#protectioncontainers_get) +- [Inquire](#protectioncontainers_inquire) +- [Refresh](#protectioncontainers_refresh) +- [Register](#protectioncontainers_register) +- [Unregister](#protectioncontainers_unregister) + +## ProtectionIntent + +- [CreateOrUpdate](#protectionintent_createorupdate) +- [Delete](#protectionintent_delete) +- [Get](#protectionintent_get) +- [Validate](#protectionintent_validate) + +## ProtectionPolicies + +- [CreateOrUpdate](#protectionpolicies_createorupdate) +- [Delete](#protectionpolicies_delete) +- [Get](#protectionpolicies_get) + +## ProtectionPolicyOperationResults + +- [Get](#protectionpolicyoperationresults_get) + +## ProtectionPolicyOperationStatuses + +- [Get](#protectionpolicyoperationstatuses_get) + +## RecoveryPoints + +- [Get](#recoverypoints_get) +- [List](#recoverypoints_list) + +## RecoveryPointsRecommendedForMove + +- [List](#recoverypointsrecommendedformove_list) + +## ResourceGuardProxies + +- [Get](#resourceguardproxies_get) + +## ResourceGuardProxyOperation + +- [Delete](#resourceguardproxyoperation_delete) +- [Get](#resourceguardproxyoperation_get) +- [Put](#resourceguardproxyoperation_put) +- [UnlockDelete](#resourceguardproxyoperation_unlockdelete) + +## ResourceProvider + +- [BmsPrepareDataMove](#resourceprovider_bmspreparedatamove) +- [BmsTriggerDataMove](#resourceprovider_bmstriggerdatamove) +- [GetOperationStatus](#resourceprovider_getoperationstatus) +- [MoveRecoveryPoint](#resourceprovider_moverecoverypoint) + +## Restores + +- [Trigger](#restores_trigger) + +## SecurityPINs + +- [Get](#securitypins_get) +### BackupEngines_Get + +```java +import com.azure.core.util.Context; + +/** Samples for BackupEngines Get. */ +public final class BackupEnginesGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Dpm/BackupEngines_Get.json + */ + /** + * Sample code: Get Dpm/AzureBackupServer/Lajolla Backup Engine Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getDpmAzureBackupServerLajollaBackupEngineDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupEngines().getWithResponse("testVault", "testRG", "testServer", null, null, Context.NONE); + } +} +``` + +### BackupEngines_List + +```java +import com.azure.core.util.Context; + +/** Samples for BackupEngines List. */ +public final class BackupEnginesListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Dpm/BackupEngines_List.json + */ + /** + * Sample code: List Dpm/AzureBackupServer/Lajolla Backup Engines. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listDpmAzureBackupServerLajollaBackupEngines( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupEngines().list("testVault", "testRG", null, null, Context.NONE); + } +} +``` + +### BackupJobs_List + +```java +import com.azure.core.util.Context; + +/** Samples for BackupJobs List. */ +public final class BackupJobsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/ListJobs.json + */ + /** + * Sample code: List All Jobs. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listAllJobs( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupJobs().list("NetSDKTestRsVault", "SwaggerTestRg", null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/ListJobsWithAllSupportedFilters.json + */ + /** + * Sample code: List Jobs With Filters. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listJobsWithFilters( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupJobs() + .list( + "NetSDKTestRsVault", + "SwaggerTestRg", + "startTime eq '2016-01-01 00:00:00 AM' and endTime eq '2017-11-29 00:00:00 AM' and operation eq" + + " 'Backup' and backupManagementType eq 'AzureIaasVM' and status eq 'InProgress'", + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/ListJobsWithStartTimeAndEndTimeFilters.json + */ + /** + * Sample code: List Jobs With Time Filter. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listJobsWithTimeFilter( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupJobs() + .list( + "NetSDKTestRsVault", + "SwaggerTestRg", + "startTime eq '2016-01-01 00:00:00 AM' and endTime eq '2017-11-29 00:00:00 AM'", + null, + Context.NONE); + } +} +``` + +### BackupOperationResults_Get + +```java +import com.azure.core.util.Context; + +/** Samples for BackupOperationResults Get. */ +public final class BackupOperationResultsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/ProtectedItem_Delete_OperationResult.json + */ + /** + * Sample code: Get Result for Protected Item Delete Operation. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getResultForProtectedItemDeleteOperation( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupOperationResults() + .getWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} +``` + +### BackupOperationStatuses_Get + +```java +import com.azure.core.util.Context; + +/** Samples for BackupOperationStatuses Get. */ +public final class BackupOperationStatusesGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/ProtectedItem_Delete_OperationStatus.json + */ + /** + * Sample code: Get Protected Item Delete Operation Status. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedItemDeleteOperationStatus( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupOperationStatuses() + .getWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} +``` + +### BackupPolicies_List + +```java +import com.azure.core.util.Context; + +/** Samples for BackupPolicies List. */ +public final class BackupPoliciesListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/BackupPolicies_List.json + */ + /** + * Sample code: List protection policies with backupManagementType filter as AzureWorkload. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listProtectionPoliciesWithBackupManagementTypeFilterAsAzureWorkload( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupPolicies() + .list("NetSDKTestRsVault", "SwaggerTestRg", "backupManagementType eq 'AzureWorkload'", Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/BackupPolicies_List.json + */ + /** + * Sample code: List protection policies with backupManagementType filter as AzureIaasVm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listProtectionPoliciesWithBackupManagementTypeFilterAsAzureIaasVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupPolicies() + .list("NetSDKTestRsVault", "SwaggerTestRg", "backupManagementType eq 'AzureIaasVM'", Context.NONE); + } +} +``` + +### BackupProtectableItems_List + +```java +import com.azure.core.util.Context; + +/** Samples for BackupProtectableItems List. */ +public final class BackupProtectableItemsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/BackupProtectableItems_List.json + */ + /** + * Sample code: List protectable items with backupManagementType filter as AzureIaasVm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listProtectableItemsWithBackupManagementTypeFilterAsAzureIaasVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupProtectableItems() + .list("NetSDKTestRsVault", "SwaggerTestRg", "backupManagementType eq 'AzureIaasVM'", null, Context.NONE); + } +} +``` + +### BackupProtectedItems_List + +```java +import com.azure.core.util.Context; + +/** Samples for BackupProtectedItems List. */ +public final class BackupProtectedItemsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/BackupProtectedItems_List.json + */ + /** + * Sample code: List protected items with backupManagementType filter as AzureIaasVm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listProtectedItemsWithBackupManagementTypeFilterAsAzureIaasVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupProtectedItems() + .list( + "NetSDKTestRsVault", + "SwaggerTestRg", + "backupManagementType eq 'AzureIaasVM' and itemType eq 'VM'", + null, + Context.NONE); + } +} +``` + +### BackupProtectionContainers_List + +```java +import com.azure.core.util.Context; + +/** Samples for BackupProtectionContainers List. */ +public final class BackupProtectionContainersListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureStorage/ProtectionContainers_List.json + */ + /** + * Sample code: List Backup Protection Containers. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listBackupProtectionContainers( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupProtectionContainers() + .list("testVault", "testRg", "backupManagementType eq 'AzureWorkload'", Context.NONE); + } +} +``` + +### BackupProtectionIntent_List + +```java +import com.azure.core.util.Context; + +/** Samples for BackupProtectionIntent List. */ +public final class BackupProtectionIntentListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/BackupProtectionIntent_List.json + */ + /** + * Sample code: List protection intent with backupManagementType filter. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listProtectionIntentWithBackupManagementTypeFilter( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupProtectionIntents().list("myVault", "myRG", null, null, Context.NONE); + } +} +``` + +### BackupResourceEncryptionConfigs_Get + +```java +import com.azure.core.util.Context; + +/** Samples for BackupResourceEncryptionConfigs Get. */ +public final class BackupResourceEncryptionConfigsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/BackupResourceEncryptionConfig_Get.json + */ + /** + * Sample code: Get Vault Encryption Configuration. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getVaultEncryptionConfiguration( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupResourceEncryptionConfigs().getWithResponse("rishTestVault", "rishgrp", Context.NONE); + } +} +``` + +### BackupResourceEncryptionConfigs_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfig; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.EncryptionAtRestType; +import com.azure.resourcemanager.recoveryservicesbackup.models.InfrastructureEncryptionState; + +/** Samples for BackupResourceEncryptionConfigs Update. */ +public final class BackupResourceEncryptionConfigsUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/BackupResourceEncryptionConfig_Put.json + */ + /** + * Sample code: Update Vault Encryption Configuration. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void updateVaultEncryptionConfiguration( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupResourceEncryptionConfigs() + .updateWithResponse( + "source-rsv", + "test-rg", + new BackupResourceEncryptionConfigResource() + .withProperties( + new BackupResourceEncryptionConfig() + .withEncryptionAtRestType(EncryptionAtRestType.CUSTOMER_MANAGED) + .withKeyUri("https://gktestkv1.vault.azure.net/keys/Test1/ed2e8cdc7f86477ebf0c6462b504a9ed") + .withSubscriptionId("1a2311d9-66f5-47d3-a9fb-7a37da63934b") + .withInfrastructureEncryptionState(InfrastructureEncryptionState.fromString("true"))), + Context.NONE); + } +} +``` + +### BackupResourceStorageConfigsNonCrr_Get + +```java +import com.azure.core.util.Context; + +/** Samples for BackupResourceStorageConfigsNonCrr Get. */ +public final class BackupResourceStorageConfigsNonCrrGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupStorageConfig_Get.json + */ + /** + * Sample code: Get Vault Storage Configuration. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getVaultStorageConfiguration( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupResourceStorageConfigsNonCrrs() + .getWithResponse("PySDKBackupTestRsVault", "PythonSDKBackupTestRg", Context.NONE); + } +} +``` + +### BackupResourceStorageConfigsNonCrr_Patch + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceConfig; +import com.azure.resourcemanager.recoveryservicesbackup.models.StorageType; +import com.azure.resourcemanager.recoveryservicesbackup.models.StorageTypeState; + +/** Samples for BackupResourceStorageConfigsNonCrr Patch. */ +public final class BackupResourceStorageConfigsNonCrrPatchSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupStorageConfig_Patch.json + */ + /** + * Sample code: Update Vault Storage Configuration. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void updateVaultStorageConfiguration( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupResourceStorageConfigsNonCrrs() + .patchWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + new BackupResourceConfigResourceInner() + .withProperties( + new BackupResourceConfig() + .withStorageType(StorageType.LOCALLY_REDUNDANT) + .withStorageTypeState(StorageTypeState.UNLOCKED)), + Context.NONE); + } +} +``` + +### BackupResourceStorageConfigsNonCrr_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceConfig; +import com.azure.resourcemanager.recoveryservicesbackup.models.StorageType; +import com.azure.resourcemanager.recoveryservicesbackup.models.StorageTypeState; + +/** Samples for BackupResourceStorageConfigsNonCrr Update. */ +public final class BackupResourceStorageConfigsNonCrrUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupStorageConfig_Put.json + */ + /** + * Sample code: Update Vault Storage Configuration. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void updateVaultStorageConfiguration( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupResourceStorageConfigsNonCrrs() + .updateWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + new BackupResourceConfigResourceInner() + .withProperties( + new BackupResourceConfig() + .withStorageType(StorageType.LOCALLY_REDUNDANT) + .withStorageTypeState(StorageTypeState.UNLOCKED)), + Context.NONE); + } +} +``` + +### BackupResourceVaultConfigs_Get + +```java +import com.azure.core.util.Context; + +/** Samples for BackupResourceVaultConfigs Get. */ +public final class BackupResourceVaultConfigsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupResourceVaultConfigs_Get.json + */ + /** + * Sample code: Get Vault Security Config. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getVaultSecurityConfig( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupResourceVaultConfigs().getWithResponse("SwaggerTest", "SwaggerTestRg", Context.NONE); + } +} +``` + +### BackupResourceVaultConfigs_Put + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfig; +import com.azure.resourcemanager.recoveryservicesbackup.models.EnhancedSecurityState; +import com.azure.resourcemanager.recoveryservicesbackup.models.SoftDeleteFeatureState; + +/** Samples for BackupResourceVaultConfigs Put. */ +public final class BackupResourceVaultConfigsPutSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupResourceVaultConfigs_Put.json + */ + /** + * Sample code: Update Vault Security Config. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void updateVaultSecurityConfig( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupResourceVaultConfigs() + .putWithResponse( + "SwaggerTest", + "SwaggerTestRg", + new BackupResourceVaultConfigResourceInner() + .withProperties( + new BackupResourceVaultConfig() + .withEnhancedSecurityState(EnhancedSecurityState.ENABLED) + .withSoftDeleteFeatureState(SoftDeleteFeatureState.ENABLED)), + Context.NONE); + } +} +``` + +### BackupResourceVaultConfigs_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfig; +import com.azure.resourcemanager.recoveryservicesbackup.models.EnhancedSecurityState; + +/** Samples for BackupResourceVaultConfigs Update. */ +public final class BackupResourceVaultConfigsUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupResourceVaultConfigs_Patch.json + */ + /** + * Sample code: Update Vault Security Config. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void updateVaultSecurityConfig( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupResourceVaultConfigs() + .updateWithResponse( + "SwaggerTest", + "SwaggerTestRg", + new BackupResourceVaultConfigResourceInner() + .withProperties( + new BackupResourceVaultConfig().withEnhancedSecurityState(EnhancedSecurityState.ENABLED)), + Context.NONE); + } +} +``` + +### BackupStatus_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatusRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.DataSourceType; + +/** Samples for BackupStatus Get. */ +public final class BackupStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/GetBackupStatus.json + */ + /** + * Sample code: Get Azure Virtual Machine Backup Status. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getAzureVirtualMachineBackupStatus( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupStatus() + .getWithResponse( + "southeastasia", + new BackupStatusRequest() + .withResourceType(DataSourceType.VM) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Compute/VirtualMachines/testVm"), + Context.NONE); + } +} +``` + +### BackupUsageSummaries_List + +```java +import com.azure.core.util.Context; + +/** Samples for BackupUsageSummaries List. */ +public final class BackupUsageSummariesListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupProtectedItem_UsageSummary_Get.json + */ + /** + * Sample code: Get Protected Items Usages Summary. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedItemsUsagesSummary( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupUsageSummaries() + .list("testVault", "testRG", "type eq 'BackupProtectedItemCountSummary'", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupProtectionContainers_UsageSummary_Get.json + */ + /** + * Sample code: Get Protected Containers Usages Summary. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedContainersUsagesSummary( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupUsageSummaries() + .list("testVault", "testRG", "type eq 'BackupProtectionContainerCountSummary'", null, Context.NONE); + } +} +``` + +### BackupWorkloadItems_List + +```java +import com.azure.core.util.Context; + +/** Samples for BackupWorkloadItems List. */ +public final class BackupWorkloadItemsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/BackupWorkloadItems_List.json + */ + /** + * Sample code: List Workload Items in Container. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listWorkloadItemsInContainer( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupWorkloadItems() + .list( + "suchandr-seacan-rsv", + "testRg", + "Azure", + "VMAppContainer;Compute;bvtdtestag;sqlserver-1", + "backupManagementType eq 'AzureWorkload'", + null, + Context.NONE); + } +} +``` + +### Backups_Trigger + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupRequestResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.IaasVMBackupRequest; + +/** Samples for Backups Trigger. */ +public final class BackupsTriggerSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/TriggerBackup_Post.json + */ + /** + * Sample code: Trigger Backup. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void triggerBackup( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backups() + .triggerWithResponse( + "linuxRsVault", + "linuxRsVaultRG", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;testrg;v1win2012r", + "VM;iaasvmcontainerv2;testrg;v1win2012r", + new BackupRequestResource().withProperties(new IaasVMBackupRequest()), + Context.NONE); + } +} +``` + +### BmsPrepareDataMoveOperationResult_Get + +```java +import com.azure.core.util.Context; + +/** Samples for BmsPrepareDataMoveOperationResult Get. */ +public final class BmsPrepareDataMoveOperationResultGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json + */ + /** + * Sample code: Get operation result for PrepareDataMove. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getOperationResultForPrepareDataMove( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .bmsPrepareDataMoveOperationResults() + .getWithResponse("source-rsv", "sourceRG", "00000000-0000-0000-0000-000000000000", Context.NONE); + } +} +``` + +### ExportJobsOperationResults_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ExportJobsOperationResults Get. */ +public final class ExportJobsOperationResultsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/ExportJobsOperationResult.json + */ + /** + * Sample code: Export Jobs Operation Results. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void exportJobsOperationResults( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .exportJobsOperationResults() + .getWithResponse( + "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", Context.NONE); + } +} +``` + +### FeatureSupport_Validate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.AzureVMResourceFeatureSupportRequest; + +/** Samples for FeatureSupport Validate. */ +public final class FeatureSupportValidateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/BackupFeature_Validate.json + */ + /** + * Sample code: Check Azure Vm Backup Feature Support. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void checkAzureVmBackupFeatureSupport( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .featureSupports() + .validateWithResponse( + "southeastasia", + new AzureVMResourceFeatureSupportRequest().withVmSize("Basic_A0").withVmSku("Premium"), + Context.NONE); + } +} +``` + +### ItemLevelRecoveryConnections_Provision + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.IaasVmilrRegistrationRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.IlrRequestResource; + +/** Samples for ItemLevelRecoveryConnections Provision. */ +public final class ItemLevelRecoveryConnectionsProvisionSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/Provision_Ilr.json + */ + /** + * Sample code: Provision Instant Item Level Recovery for Azure Vm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void provisionInstantItemLevelRecoveryForAzureVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .itemLevelRecoveryConnections() + .provisionWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + "Azure", + "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", + "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", + "1", + new IlrRequestResource() + .withProperties( + new IaasVmilrRegistrationRequest() + .withRecoveryPointId("38823086363464") + .withVirtualMachineId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/pysdktestrg/providers/Microsoft.Compute/virtualMachines/pysdktestv2vm1") + .withInitiatorName("Hello World") + .withRenewExistingRegistration(true)), + Context.NONE); + } +} +``` + +### ItemLevelRecoveryConnections_Revoke + +```java +import com.azure.core.util.Context; + +/** Samples for ItemLevelRecoveryConnections Revoke. */ +public final class ItemLevelRecoveryConnectionsRevokeSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/Revoke_Ilr.json + */ + /** + * Sample code: Revoke Instant Item Level Recovery for Azure Vm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void revokeInstantItemLevelRecoveryForAzureVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .itemLevelRecoveryConnections() + .revokeWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + "Azure", + "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", + "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", + "1", + Context.NONE); + } +} +``` + +### JobCancellations_Trigger + +```java +import com.azure.core.util.Context; + +/** Samples for JobCancellations Trigger. */ +public final class JobCancellationsTriggerSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/TriggerCancelJob.json + */ + /** + * Sample code: Cancel Job. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void cancelJob( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .jobCancellations() + .triggerWithResponse( + "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", Context.NONE); + } +} +``` + +### JobDetails_Get + +```java +import com.azure.core.util.Context; + +/** Samples for JobDetails Get. */ +public final class JobDetailsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/GetJobDetails.json + */ + /** + * Sample code: Get Job Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getJobDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .jobDetails() + .getWithResponse( + "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", Context.NONE); + } +} +``` + +### JobOperationResults_Get + +```java +import com.azure.core.util.Context; + +/** Samples for JobOperationResults Get. */ +public final class JobOperationResultsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/CancelJobOperationResult.json + */ + /** + * Sample code: Cancel Job Operation Result. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void cancelJobOperationResult( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .jobOperationResults() + .getWithResponse( + "NetSDKTestRsVault", + "SwaggerTestRg", + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} +``` + +### Jobs_Export + +```java +import com.azure.core.util.Context; + +/** Samples for Jobs Export. */ +public final class JobsExportSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/TriggerExportJobs.json + */ + /** + * Sample code: Export Jobs. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void exportJobs( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.jobs().exportWithResponse("NetSDKTestRsVault", "SwaggerTestRg", null, Context.NONE); + } +} +``` + +### OperationOperation_Validate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequest; + +/** Samples for OperationOperation Validate. */ +public final class OperationOperationValidateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk.json + */ + /** + * Sample code: Validate Operation. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void validateOperation( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .operationOperations() + .validateWithResponse("testVault", "testRG", new ValidateOperationRequest(), Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/ListOperations.json + */ + /** + * Sample code: ListOperations. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listOperations( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PrivateEndpoint_GetOperationStatus + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpoint GetOperationStatus. */ +public final class PrivateEndpointGetOperationStatusSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnectionOperationStatus.json + */ + /** + * Sample code: Get OperationStatus. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getOperationStatus( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .privateEndpoints() + .getOperationStatusWithResponse( + "gaallavaultbvtd2msi", + "gaallaRG", + "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", + "0f48183b-0a44-4dca-aec1-bba5daab888a", + Context.NONE); + } +} +``` + +### PrivateEndpointConnection_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnection Delete. */ +public final class PrivateEndpointConnectionDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/PrivateEndpointConnection/DeletePrivateEndpointConnection.json + */ + /** + * Sample code: Delete PrivateEndpointConnection. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void deletePrivateEndpointConnection( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .privateEndpointConnections() + .delete( + "gaallavaultbvtd2msi", "gaallaRG", "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", Context.NONE); + } +} +``` + +### PrivateEndpointConnection_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnection Get. */ +public final class PrivateEndpointConnectionGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnection.json + */ + /** + * Sample code: Get PrivateEndpointConnection. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getPrivateEndpointConnection( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .privateEndpointConnections() + .getWithResponse( + "gaallavaultbvtd2msi", "gaallaRG", "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", Context.NONE); + } +} +``` + +### PrivateEndpointConnection_Put + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpoint; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnection; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnectionResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnectionStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProvisioningState; + +/** Samples for PrivateEndpointConnection Put. */ +public final class PrivateEndpointConnectionPutSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/PrivateEndpointConnection/PutPrivateEndpointConnection.json + */ + /** + * Sample code: Update PrivateEndpointConnection. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void updatePrivateEndpointConnection( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + PrivateEndpointConnectionResource resource = + manager + .privateEndpointConnections() + .getWithResponse( + "gaallavaultbvtd2msi", + "gaallaRG", + "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", + Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new PrivateEndpointConnection() + .withProvisioningState(ProvisioningState.SUCCEEDED) + .withPrivateEndpoint( + new PrivateEndpoint() + .withId( + "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.Network/privateEndpoints/gaallatestpe3")) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@company.com"))) + .apply(); + } +} +``` + +### ProtectableContainers_List + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectableContainers List. */ +public final class ProtectableContainersListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureStorage/ProtectableContainers_List.json + */ + /** + * Sample code: List protectable items with backupManagementType filter as AzureStorage. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listProtectableItemsWithBackupManagementTypeFilterAsAzureStorage( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectableContainers() + .list( + "testvault", + "testRg", + "Azure", + "backupManagementType eq 'AzureStorage' and workloadType eq 'AzureFileShare'", + Context.NONE); + } +} +``` + +### ProtectedItemOperationResults_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectedItemOperationResults Get. */ +public final class ProtectedItemOperationResultsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectedItemOperationResults.json + */ + /** + * Sample code: Get Operation Results of Protected Vm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getOperationResultsOfProtectedVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectedItemOperationResults() + .getWithResponse( + "NetSDKTestRsVault", + "SwaggerTestRg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} +``` + +### ProtectedItemOperationStatuses_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectedItemOperationStatuses Get. */ +public final class ProtectedItemOperationStatusesGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectedItemOperationStatus.json + */ + /** + * Sample code: Get Operation Status of Protected Vm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getOperationStatusOfProtectedVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectedItemOperationStatuses() + .getWithResponse( + "NetSDKTestRsVault", + "SwaggerTestRg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} +``` + +### ProtectedItems_CreateOrUpdate + +```java +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItem; + +/** Samples for ProtectedItems CreateOrUpdate. */ +public final class ProtectedItemsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/StopProtection.json + */ + /** + * Sample code: Stop Protection with retain data on Azure IaasVm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void stopProtectionWithRetainDataOnAzureIaasVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectedItems() + .define("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1") + .withRegion((String) null) + .withExistingProtectionContainer( + "NetSDKTestRsVault", + "SwaggerTestRg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1") + .withProperties( + new ProtectedItem() + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1")) + .create(); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ConfigureProtection.json + */ + /** + * Sample code: Enable Protection on Azure IaasVm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void enableProtectionOnAzureIaasVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectedItems() + .define("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1") + .withRegion((String) null) + .withExistingProtectionContainer( + "NetSDKTestRsVault", + "SwaggerTestRg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1") + .withProperties( + new ProtectedItem() + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1") + .withPolicyId( + "/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/DefaultPolicy")) + .create(); + } +} +``` + +### ProtectedItems_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectedItems Delete. */ +public final class ProtectedItemsDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/ProtectedItem_Delete.json + */ + /** + * Sample code: Delete Protection from Azure Virtual Machine. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void deleteProtectionFromAzureVirtualMachine( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectedItems() + .deleteWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + "Azure", + "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", + "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", + Context.NONE); + } +} +``` + +### ProtectedItems_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectedItems Get. */ +public final class ProtectedItemsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ClassicCompute_ProtectedItem_Get.json + */ + /** + * Sample code: Get Protected Classic Virtual Machine Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedClassicVirtualMachineDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectedItems() + .getWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + "Azure", + "iaasvmcontainer;iaasvmcontainer;iaasvm-rg;iaasvm-1", + "vm;iaasvmcontainer;iaasvm-rg;iaasvm-1", + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/Compute_ProtectedItem_Get.json + */ + /** + * Sample code: Get Protected Virtual Machine Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedVirtualMachineDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectedItems() + .getWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + "Azure", + "iaasvmcontainer;iaasvmcontainerv2;iaasvm-rg;iaasvm-1", + "vm;iaasvmcontainerv2;iaasvm-rg;iaasvm-1", + null, + Context.NONE); + } +} +``` + +### ProtectionContainerOperationResults_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectionContainerOperationResults Get. */ +public final class ProtectionContainerOperationResultsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureStorage/ProtectionContainers_Inquire_Result.json + */ + /** + * Sample code: Get Azure Storage Protection Container Operation Result. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getAzureStorageProtectionContainerOperationResult( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionContainerOperationResults() + .getWithResponse( + "testvault", + "test-rg", + "Azure", + "VMAppContainer;Compute;testRG;testSQL", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} +``` + +### ProtectionContainerRefreshOperationResults_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectionContainerRefreshOperationResults Get. */ +public final class ProtectionContainerRefreshOperationResultsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/RefreshContainers_OperationResults.json + */ + /** + * Sample code: Azure Vm Discovery Operation Result. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void azureVmDiscoveryOperationResult( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionContainerRefreshOperationResults() + .getWithResponse( + "NetSDKTestRsVault", "SwaggerTestRg", "Azure", "00000000-0000-0000-0000-000000000000", Context.NONE); + } +} +``` + +### ProtectionContainers_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectionContainers Get. */ +public final class ProtectionContainersGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/ProtectionContainers_Get.json + */ + /** + * Sample code: Get Protection Container Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectionContainerDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionContainers() + .getWithResponse("testVault", "testRg", "Azure", "VMAppContainer;Compute;testRG;testSQL", Context.NONE); + } +} +``` + +### ProtectionContainers_Inquire + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectionContainers Inquire. */ +public final class ProtectionContainersInquireSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureStorage/ProtectionContainers_Inquire.json + */ + /** + * Sample code: Inquire Azure Storage Protection Containers. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void inquireAzureStorageProtectionContainers( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionContainers() + .inquireWithResponse( + "testvault", "test-rg", "Azure", "storagecontainer;Storage;test-rg;teststorage", null, Context.NONE); + } +} +``` + +### ProtectionContainers_Refresh + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectionContainers Refresh. */ +public final class ProtectionContainersRefreshSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/RefreshContainers.json + */ + /** + * Sample code: Trigger Azure Vm Discovery. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void triggerAzureVmDiscovery( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionContainers() + .refreshWithResponse("NetSDKTestRsVault", "SwaggerTestRg", "Azure", null, Context.NONE); + } +} +``` + +### ProtectionContainers_Register + +```java +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainer; + +/** Samples for ProtectionContainers Register. */ +public final class ProtectionContainersRegisterSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureStorage/ProtectionContainers_Register.json + */ + /** + * Sample code: RegisterAzure Storage ProtectionContainers. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void registerAzureStorageProtectionContainers( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionContainers() + .define("VMAppContainer;Compute;testRG;testSQL") + .withRegion((String) null) + .withExistingBackupFabric("testvault", "test-rg", "Azure") + .withProperties( + new ProtectionContainer() + .withFriendlyName("testSQL") + .withBackupManagementType(BackupManagementType.AZURE_WORKLOAD)) + .create(); + } +} +``` + +### ProtectionContainers_Unregister + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectionContainers Unregister. */ +public final class ProtectionContainersUnregisterSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/ProtectionContainers_Unregister.json + */ + /** + * Sample code: Unregister Protection Container. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void unregisterProtectionContainer( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionContainers() + .unregisterWithResponse( + "testVault", "testRg", "Azure", "storagecontainer;Storage;test-rg;teststorage", Context.NONE); + } +} +``` + +### ProtectionIntent_CreateOrUpdate + +```java +import com.azure.resourcemanager.recoveryservicesbackup.models.AzureResourceProtectionIntent; + +/** Samples for ProtectionIntent CreateOrUpdate. */ +public final class ProtectionIntentCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionIntent_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Azure Vm Protection Intent. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void createOrUpdateAzureVmProtectionIntent( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionIntents() + .define("vm;iaasvmcontainerv2;chamsrgtest;chamscandel") + .withRegion((String) null) + .withExistingBackupFabric("myVault", "myRG", "Azure") + .withProperties( + new AzureResourceProtectionIntent() + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/chamsrgtest/providers/Microsoft.Compute/virtualMachines/chamscandel") + .withPolicyId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy")) + .create(); + } +} +``` + +### ProtectionIntent_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectionIntent Delete. */ +public final class ProtectionIntentDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/BackupProtectionIntent_Delete.json + */ + /** + * Sample code: Delete Protection intent from item. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void deleteProtectionIntentFromItem( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionIntents() + .deleteWithResponse("myVault", "myRG", "Azure", "249D9B07-D2EF-4202-AA64-65F35418564E", Context.NONE); + } +} +``` + +### ProtectionIntent_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectionIntent Get. */ +public final class ProtectionIntentGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/BackupProtectionIntent_Get.json + */ + /** + * Sample code: Get ProtectionIntent for an item. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectionIntentForAnItem( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionIntents() + .getWithResponse("myVault", "myRG", "Azure", "249D9B07-D2EF-4202-AA64-65F35418564E", Context.NONE); + } +} +``` + +### ProtectionIntent_Validate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.DataSourceType; +import com.azure.resourcemanager.recoveryservicesbackup.models.PreValidateEnableBackupRequest; + +/** Samples for ProtectionIntent Validate. */ +public final class ProtectionIntentValidateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionIntent_Validate.json + */ + /** + * Sample code: Validate Enable Protection on Azure Vm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void validateEnableProtectionOnAzureVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionIntents() + .validateWithResponse( + "southeastasia", + new PreValidateEnableBackupRequest() + .withResourceType(DataSourceType.VM) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arunaupgrade/providers/Microsoft.Compute/VirtualMachines/upgrade1") + .withVaultId( + "/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/Vaults/myVault") + .withProperties(""), + Context.NONE); + } +} +``` + +### ProtectionPolicies_CreateOrUpdate + +```java +import com.azure.resourcemanager.recoveryservicesbackup.models.AzureIaaSvmProtectionPolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.AzureVmWorkloadProtectionPolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.DailyRetentionSchedule; +import com.azure.resourcemanager.recoveryservicesbackup.models.DayOfWeek; +import com.azure.resourcemanager.recoveryservicesbackup.models.LogSchedulePolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.LongTermRetentionPolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.MonthOfYear; +import com.azure.resourcemanager.recoveryservicesbackup.models.MonthlyRetentionSchedule; +import com.azure.resourcemanager.recoveryservicesbackup.models.PolicyType; +import com.azure.resourcemanager.recoveryservicesbackup.models.RetentionDuration; +import com.azure.resourcemanager.recoveryservicesbackup.models.RetentionDurationType; +import com.azure.resourcemanager.recoveryservicesbackup.models.RetentionScheduleFormat; +import com.azure.resourcemanager.recoveryservicesbackup.models.ScheduleRunType; +import com.azure.resourcemanager.recoveryservicesbackup.models.Settings; +import com.azure.resourcemanager.recoveryservicesbackup.models.SimpleRetentionPolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.SimpleSchedulePolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.SubProtectionPolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.WeekOfMonth; +import com.azure.resourcemanager.recoveryservicesbackup.models.WeeklyRetentionFormat; +import com.azure.resourcemanager.recoveryservicesbackup.models.WeeklyRetentionSchedule; +import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadType; +import com.azure.resourcemanager.recoveryservicesbackup.models.YearlyRetentionSchedule; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for ProtectionPolicies CreateOrUpdate. */ +public final class ProtectionPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/ProtectionPolicies_CreateOrUpdate_Complex.json + */ + /** + * Sample code: Create or Update Full Azure Workload Protection Policy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void createOrUpdateFullAzureWorkloadProtectionPolicy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionPolicies() + .define("testPolicy1") + .withRegion((String) null) + .withExistingVault("NetSDKTestRsVault", "SwaggerTestRg") + .withProperties( + new AzureVmWorkloadProtectionPolicy() + .withWorkLoadType(WorkloadType.SQLDATA_BASE) + .withSettings(new Settings().withTimeZone("Pacific Standard Time").withIssqlcompression(false)) + .withSubProtectionPolicy( + Arrays + .asList( + new SubProtectionPolicy() + .withPolicyType(PolicyType.FULL) + .withSchedulePolicy( + new SimpleSchedulePolicy() + .withScheduleRunFrequency(ScheduleRunType.WEEKLY) + .withScheduleRunDays(Arrays.asList(DayOfWeek.SUNDAY, DayOfWeek.TUESDAY)) + .withScheduleRunTimes( + Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z")))) + .withRetentionPolicy( + new LongTermRetentionPolicy() + .withWeeklySchedule( + new WeeklyRetentionSchedule() + .withDaysOfTheWeek( + Arrays.asList(DayOfWeek.SUNDAY, DayOfWeek.TUESDAY)) + .withRetentionTimes( + Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z"))) + .withRetentionDuration( + new RetentionDuration() + .withCount(2) + .withDurationType(RetentionDurationType.WEEKS))) + .withMonthlySchedule( + new MonthlyRetentionSchedule() + .withRetentionScheduleFormatType(RetentionScheduleFormat.WEEKLY) + .withRetentionScheduleWeekly( + new WeeklyRetentionFormat() + .withDaysOfTheWeek(Arrays.asList(DayOfWeek.SUNDAY)) + .withWeeksOfTheMonth(Arrays.asList(WeekOfMonth.SECOND))) + .withRetentionTimes( + Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z"))) + .withRetentionDuration( + new RetentionDuration() + .withCount(1) + .withDurationType(RetentionDurationType.MONTHS))) + .withYearlySchedule( + new YearlyRetentionSchedule() + .withRetentionScheduleFormatType(RetentionScheduleFormat.WEEKLY) + .withMonthsOfYear( + Arrays + .asList( + MonthOfYear.JANUARY, + MonthOfYear.JUNE, + MonthOfYear.DECEMBER)) + .withRetentionScheduleWeekly( + new WeeklyRetentionFormat() + .withDaysOfTheWeek(Arrays.asList(DayOfWeek.SUNDAY)) + .withWeeksOfTheMonth(Arrays.asList(WeekOfMonth.LAST))) + .withRetentionTimes( + Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z"))) + .withRetentionDuration( + new RetentionDuration() + .withCount(1) + .withDurationType(RetentionDurationType.YEARS)))), + new SubProtectionPolicy() + .withPolicyType(PolicyType.DIFFERENTIAL) + .withSchedulePolicy( + new SimpleSchedulePolicy() + .withScheduleRunFrequency(ScheduleRunType.WEEKLY) + .withScheduleRunDays(Arrays.asList(DayOfWeek.FRIDAY)) + .withScheduleRunTimes( + Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z")))) + .withRetentionPolicy( + new SimpleRetentionPolicy() + .withRetentionDuration( + new RetentionDuration() + .withCount(8) + .withDurationType(RetentionDurationType.DAYS))), + new SubProtectionPolicy() + .withPolicyType(PolicyType.LOG) + .withSchedulePolicy(new LogSchedulePolicy().withScheduleFrequencyInMins(60)) + .withRetentionPolicy( + new SimpleRetentionPolicy() + .withRetentionDuration( + new RetentionDuration() + .withCount(7) + .withDurationType(RetentionDurationType.DAYS)))))) + .create(); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Simple.json + */ + /** + * Sample code: Create or Update Simple Azure Vm Protection Policy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void createOrUpdateSimpleAzureVmProtectionPolicy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionPolicies() + .define("testPolicy1") + .withRegion((String) null) + .withExistingVault("NetSDKTestRsVault", "SwaggerTestRg") + .withProperties( + new AzureIaaSvmProtectionPolicy() + .withSchedulePolicy( + new SimpleSchedulePolicy() + .withScheduleRunFrequency(ScheduleRunType.DAILY) + .withScheduleRunTimes(Arrays.asList(OffsetDateTime.parse("2018-01-24T02:00:00Z")))) + .withRetentionPolicy( + new LongTermRetentionPolicy() + .withDailySchedule( + new DailyRetentionSchedule() + .withRetentionTimes(Arrays.asList(OffsetDateTime.parse("2018-01-24T02:00:00Z"))) + .withRetentionDuration( + new RetentionDuration() + .withCount(1) + .withDurationType(RetentionDurationType.DAYS)))) + .withTimeZone("Pacific Standard Time")) + .create(); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Complex.json + */ + /** + * Sample code: Create or Update Full Azure Vm Protection Policy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void createOrUpdateFullAzureVmProtectionPolicy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionPolicies() + .define("testPolicy1") + .withRegion((String) null) + .withExistingVault("NetSDKTestRsVault", "SwaggerTestRg") + .withProperties( + new AzureIaaSvmProtectionPolicy() + .withSchedulePolicy( + new SimpleSchedulePolicy() + .withScheduleRunFrequency(ScheduleRunType.WEEKLY) + .withScheduleRunDays( + Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY)) + .withScheduleRunTimes(Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z")))) + .withRetentionPolicy( + new LongTermRetentionPolicy() + .withWeeklySchedule( + new WeeklyRetentionSchedule() + .withDaysOfTheWeek( + Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY)) + .withRetentionTimes(Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z"))) + .withRetentionDuration( + new RetentionDuration() + .withCount(1) + .withDurationType(RetentionDurationType.WEEKS))) + .withMonthlySchedule( + new MonthlyRetentionSchedule() + .withRetentionScheduleFormatType(RetentionScheduleFormat.WEEKLY) + .withRetentionScheduleWeekly( + new WeeklyRetentionFormat() + .withDaysOfTheWeek(Arrays.asList(DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY)) + .withWeeksOfTheMonth(Arrays.asList(WeekOfMonth.FIRST, WeekOfMonth.THIRD))) + .withRetentionTimes(Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z"))) + .withRetentionDuration( + new RetentionDuration() + .withCount(2) + .withDurationType(RetentionDurationType.MONTHS))) + .withYearlySchedule( + new YearlyRetentionSchedule() + .withRetentionScheduleFormatType(RetentionScheduleFormat.WEEKLY) + .withMonthsOfYear(Arrays.asList(MonthOfYear.FEBRUARY, MonthOfYear.NOVEMBER)) + .withRetentionScheduleWeekly( + new WeeklyRetentionFormat() + .withDaysOfTheWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.THURSDAY)) + .withWeeksOfTheMonth(Arrays.asList(WeekOfMonth.FOURTH))) + .withRetentionTimes(Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z"))) + .withRetentionDuration( + new RetentionDuration() + .withCount(4) + .withDurationType(RetentionDurationType.YEARS)))) + .withTimeZone("Pacific Standard Time")) + .create(); + } +} +``` + +### ProtectionPolicies_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectionPolicies Delete. */ +public final class ProtectionPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionPolicies_Delete.json + */ + /** + * Sample code: Delete Azure Vm Protection Policy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void deleteAzureVmProtectionPolicy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.protectionPolicies().delete("NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", Context.NONE); + } +} +``` + +### ProtectionPolicies_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectionPolicies Get. */ +public final class ProtectionPoliciesGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionPolicies_Get.json + */ + /** + * Sample code: Get Azure IaasVm Protection Policy Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getAzureIaasVmProtectionPolicyDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.protectionPolicies().getWithResponse("NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", Context.NONE); + } +} +``` + +### ProtectionPolicyOperationResults_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectionPolicyOperationResults Get. */ +public final class ProtectionPolicyOperationResultsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionPolicyOperationResults_Get.json + */ + /** + * Sample code: Get Protection Policy Operation Results. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectionPolicyOperationResults( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionPolicyOperationResults() + .getWithResponse( + "NetSDKTestRsVault", + "SwaggerTestRg", + "testPolicy1", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} +``` + +### ProtectionPolicyOperationStatuses_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ProtectionPolicyOperationStatuses Get. */ +public final class ProtectionPolicyOperationStatusesGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionPolicyOperationStatuses_Get.json + */ + /** + * Sample code: Get Protection Policy Operation Status. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectionPolicyOperationStatus( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionPolicyOperationStatuses() + .getWithResponse( + "NetSDKTestRsVault", + "SwaggerTestRg", + "testPolicy1", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} +``` + +### RecoveryPoints_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RecoveryPoints Get. */ +public final class RecoveryPointsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/RecoveryPoints_Get.json + */ + /** + * Sample code: Get Azure Vm Recovery Point Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getAzureVmRecoveryPointDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .recoveryPoints() + .getWithResponse( + "rshvault", + "rshhtestmdvmrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", + "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", + "26083826328862", + Context.NONE); + } +} +``` + +### RecoveryPoints_List + +```java +import com.azure.core.util.Context; + +/** Samples for RecoveryPoints List. */ +public final class RecoveryPointsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/RecoveryPoints_List.json + */ + /** + * Sample code: Get Protected Azure Vm Recovery Points. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedAzureVmRecoveryPoints( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .recoveryPoints() + .list( + "rshvault", + "rshhtestmdvmrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", + "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", + null, + Context.NONE); + } +} +``` + +### RecoveryPointsRecommendedForMove_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.ListRecoveryPointsRecommendedForMoveRequest; +import java.util.Arrays; + +/** Samples for RecoveryPointsRecommendedForMove List. */ +public final class RecoveryPointsRecommendedForMoveListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/RecoveryPointsRecommendedForMove_List.json + */ + /** + * Sample code: Get Protected Azure Vm Recovery Points Recommended for Move. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedAzureVmRecoveryPointsRecommendedForMove( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .recoveryPointsRecommendedForMoves() + .list( + "rshvault", + "rshhtestmdvmrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", + "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", + new ListRecoveryPointsRecommendedForMoveRequest() + .withObjectType("ListRecoveryPointsRecommendedForMoveRequest") + .withExcludedRPList(Arrays.asList("348916168024334", "348916168024335")), + Context.NONE); + } +} +``` + +### ResourceGuardProxies_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceGuardProxies Get. */ +public final class ResourceGuardProxiesGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json + */ + /** + * Sample code: Get VaultGuardProxies. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getVaultGuardProxies( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.resourceGuardProxies().get("sampleVault", "SampleResourceGroup", Context.NONE); + } +} +``` + +### ResourceGuardProxyOperation_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceGuardProxyOperation Delete. */ +public final class ResourceGuardProxyOperationDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json + */ + /** + * Sample code: Delete ResourceGuardProxy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void deleteResourceGuardProxy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceGuardProxyOperations() + .deleteWithResponse("sampleVault", "SampleResourceGroup", "swaggerExample", Context.NONE); + } +} +``` + +### ResourceGuardProxyOperation_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceGuardProxyOperation Get. */ +public final class ResourceGuardProxyOperationGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json + */ + /** + * Sample code: Get ResourceGuardProxy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getResourceGuardProxy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceGuardProxyOperations() + .getWithResponse("sampleVault", "SampleResourceGroup", "swaggerExample", Context.NONE); + } +} +``` + +### ResourceGuardProxyOperation_Put + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceGuardProxyOperation Put. */ +public final class ResourceGuardProxyOperationPutSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json + */ + /** + * Sample code: Create ResourceGuardProxy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void createResourceGuardProxy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceGuardProxyOperations() + .putWithResponse("sampleVault", "SampleResourceGroup", "swaggerExample", Context.NONE); + } +} +``` + +### ResourceGuardProxyOperation_UnlockDelete + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.UnlockDeleteRequest; +import java.util.Arrays; + +/** Samples for ResourceGuardProxyOperation UnlockDelete. */ +public final class ResourceGuardProxyOperationUnlockDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json + */ + /** + * Sample code: UnlockDelete ResourceGuardProxy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void unlockDeleteResourceGuardProxy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceGuardProxyOperations() + .unlockDeleteWithResponse( + "sampleVault", + "SampleResourceGroup", + "swaggerExample", + new UnlockDeleteRequest() + .withResourceGuardOperationRequests( + Arrays + .asList( + "/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteProtectedItemRequests/default")) + .withResourceToBeDeleted( + "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/gaallarg/providers/Microsoft.RecoveryServices/vaults/MercuryCrrVault/backupFabrics/Azure/protectionContainers/VMAppContainer;compute;crrtestrg;crrtestvm/protectedItems/SQLDataBase;mssqlserver;testdb"), + Context.NONE); + } +} +``` + +### ResourceProvider_BmsPrepareDataMove + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.DataMoveLevel; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrepareDataMoveRequest; + +/** Samples for ResourceProvider BmsPrepareDataMove. */ +public final class ResourceProviderBmsPrepareDataMoveSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/BackupDataMove/PrepareDataMove_Post.json + */ + /** + * Sample code: Prepare Data Move. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void prepareDataMove( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceProviders() + .bmsPrepareDataMove( + "source-rsv", + "sourceRG", + new PrepareDataMoveRequest() + .withTargetResourceId( + "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/targetRG/providers/Microsoft.RecoveryServices/vaults/target-rsv") + .withTargetRegion("USGov Virginia") + .withDataMoveLevel(DataMoveLevel.VAULT), + Context.NONE); + } +} +``` + +### ResourceProvider_BmsTriggerDataMove + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.DataMoveLevel; +import com.azure.resourcemanager.recoveryservicesbackup.models.TriggerDataMoveRequest; + +/** Samples for ResourceProvider BmsTriggerDataMove. */ +public final class ResourceProviderBmsTriggerDataMoveSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/BackupDataMove/TriggerDataMove_Post.json + */ + /** + * Sample code: Trigger Data Move. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void triggerDataMove( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceProviders() + .bmsTriggerDataMove( + "target-rsv", + "targetRG", + new TriggerDataMoveRequest() + .withSourceResourceId( + "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/sourceRG/providers/Microsoft.RecoveryServices/vaults/source-rsv") + .withSourceRegion("USGov Iowa") + .withDataMoveLevel(DataMoveLevel.VAULT) + .withCorrelationId("MTg2OTcyMzM4NzYyMjc1NDY3Nzs1YmUzYmVmNi04YjJiLTRhOTItOTllYi01NTM0MDllYjk2NjE="), + Context.NONE); + } +} +``` + +### ResourceProvider_GetOperationStatus + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceProvider GetOperationStatus. */ +public final class ResourceProviderGetOperationStatusSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json + */ + /** + * Sample code: Get OperationStatus. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getOperationStatus( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceProviders() + .getOperationStatusWithResponse( + "source-rsv", "sourceRG", "00000000-0000-0000-0000-000000000000", Context.NONE); + } +} +``` + +### ResourceProvider_MoveRecoveryPoint + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.MoveRPAcrossTiersRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointTierType; + +/** Samples for ResourceProvider MoveRecoveryPoint. */ +public final class ResourceProviderMoveRecoveryPointSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/TriggerRecoveryPointMove_Post.json + */ + /** + * Sample code: Trigger RP Move Operation. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void triggerRPMoveOperation( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceProviders() + .moveRecoveryPoint( + "testVault", + "netsdktestrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "348916168024334", + new MoveRPAcrossTiersRequest() + .withObjectType("MoveRPAcrossTiersRequest") + .withSourceTierType(RecoveryPointTierType.HARDENED_RP) + .withTargetTierType(RecoveryPointTierType.ARCHIVED_RP), + Context.NONE); + } +} +``` + +### Restores_Trigger + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.EncryptionDetails; +import com.azure.resourcemanager.recoveryservicesbackup.models.IaasVMRestoreRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.IdentityInfo; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryType; +import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestResource; + +/** Samples for Restores Trigger. */ +public final class RestoresTriggerSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreWithRehydrationRequest.json + */ + /** + * Sample code: Restore to New Azure IaasVm with IaasVMRestoreWithRehydrationRequest. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void restoreToNewAzureIaasVmWithIaasVMRestoreWithRehydrationRequest( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .restores() + .trigger( + "testVault", + "netsdktestrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "348916168024334", + new RestoreRequestResource().withProperties(new RestoreRequest()), + Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest.json + */ + /** + * Sample code: Restore to New Azure IaasVm with IaasVMRestoreRequest. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void restoreToNewAzureIaasVmWithIaasVMRestoreRequest( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .restores() + .trigger( + "testVault", + "netsdktestrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "348916168024334", + new RestoreRequestResource() + .withProperties( + new IaasVMRestoreRequest() + .withRecoveryPointId("348916168024334") + .withRecoveryType(RecoveryType.ALTERNATE_LOCATION) + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1") + .withTargetVirtualMachineId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2/providers/Microsoft.Compute/virtualmachines/RSMDALRVM981435") + .withTargetResourceGroupId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2") + .withStorageAccountId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Storage/storageAccounts/testingAccount") + .withVirtualNetworkId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet") + .withSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet/subnets/default") + .withRegion("southeastasia") + .withCreateNewCloudService(false) + .withOriginalStorageAccountOption(false) + .withEncryptionDetails(new EncryptionDetails().withEncryptionEnabled(false)) + .withIdentityInfo(new IdentityInfo().withIsSystemAssignedIdentity(true))), + Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreWithRehydrationRequest.json + */ + /** + * Sample code: Restore Disks with IaasVMRestoreWithRehydrationRequest. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void restoreDisksWithIaasVMRestoreWithRehydrationRequest( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .restores() + .trigger( + "testVault", + "netsdktestrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "348916168024334", + new RestoreRequestResource().withProperties(new RestoreRequest()), + Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest.json + */ + /** + * Sample code: Restore Disks with IaasVMRestoreRequest. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void restoreDisksWithIaasVMRestoreRequest( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .restores() + .trigger( + "testVault", + "netsdktestrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "348916168024334", + new RestoreRequestResource() + .withProperties( + new IaasVMRestoreRequest() + .withRecoveryPointId("348916168024334") + .withRecoveryType(RecoveryType.RESTORE_DISKS) + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1") + .withStorageAccountId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount") + .withRegion("southeastasia") + .withCreateNewCloudService(true) + .withOriginalStorageAccountOption(false) + .withEncryptionDetails(new EncryptionDetails().withEncryptionEnabled(false)) + .withIdentityInfo( + new IdentityInfo() + .withIsSystemAssignedIdentity(false) + .withManagedIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"))), + Context.NONE); + } +} +``` + +### SecurityPINs_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityPINs Get. */ +public final class SecurityPINsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupSecurityPin_Get.json + */ + /** + * Sample code: Get Vault Security Pin. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getVaultSecurityPin( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.securityPINs().getWithResponse("SwaggerTest", "SwaggerTestRg", null, Context.NONE); + } +} +``` + diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/pom.xml b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/pom.xml index 6529fd0a10d97..aa03c1ec741fa 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/pom.xml +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/pom.xml @@ -1,58 +1,81 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-recoveryservicesbackup - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-recoveryservicesbackup + 1.0.0-beta.2 + jar - Microsoft Azure SDK for RecoveryServicesBackup Management - This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-2021-01. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for RecoveryServicesBackup Management + This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-2021-08. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + 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 - true + + 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 + true false - - - - com.azure - azure-core - 1.22.0 - - - com.azure - azure-core-management - 1.4.3 - - + + + + com.azure + azure-core + 1.22.0 + + + com.azure + azure-core-management + 1.4.3 + + + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java index a0f76d117657d..54f3b7c3ef54a 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java @@ -8,8 +8,8 @@ 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.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,35 +17,28 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryServicesBackupClient; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.AadPropertiesOperationsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupCrrJobDetailsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupCrrJobsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupEnginesImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupJobsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupOperationResultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupOperationStatusesImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupPoliciesImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectableItemsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectedItemsCrrsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectedItemsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectionContainersImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectionIntentsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceEncryptionConfigsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceStorageConfigsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceStorageConfigsNonCrrsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceVaultConfigsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupStatusImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupUsageSummariesCrrsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupUsageSummariesImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupWorkloadItemsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BmsPrepareDataMoveOperationResultsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossRegionRestoresImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.CrrOperationResultsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.CrrOperationStatusImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ExportJobsOperationResultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.FeatureSupportsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ItemLevelRecoveryConnectionsImpl; @@ -53,8 +46,8 @@ import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobDetailsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobOperationResultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationOperationsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationsOperationsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.PrivateEndpointsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectableContainersImpl; @@ -68,16 +61,14 @@ import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPoliciesImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPolicyOperationResultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPolicyOperationStatusesImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryPointsCrrsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryPointsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryPointsRecommendedForMovesImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryServicesBackupClientBuilder; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ResourceGuardProxiesImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ResourceGuardProxyOperationsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ResourceProvidersImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.RestoresImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.SecurityPINsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.models.AadPropertiesOperations; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupCrrJobDetails; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupCrrJobs; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngines; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupJobs; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupOperationResults; @@ -85,21 +76,16 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.BackupPolicies; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectableItems; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectedItems; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectedItemsCrrs; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectionContainers; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectionIntents; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigs; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceStorageConfigs; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceStorageConfigsNonCrrs; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfigs; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatus; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupUsageSummaries; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupUsageSummariesCrrs; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupWorkloadItems; import com.azure.resourcemanager.recoveryservicesbackup.models.Backups; import com.azure.resourcemanager.recoveryservicesbackup.models.BmsPrepareDataMoveOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrossRegionRestores; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrrOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrrOperationStatus; import com.azure.resourcemanager.recoveryservicesbackup.models.ExportJobsOperationResults; import com.azure.resourcemanager.recoveryservicesbackup.models.FeatureSupports; import com.azure.resourcemanager.recoveryservicesbackup.models.ItemLevelRecoveryConnections; @@ -107,8 +93,8 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.JobDetails; import com.azure.resourcemanager.recoveryservicesbackup.models.JobOperationResults; import com.azure.resourcemanager.recoveryservicesbackup.models.Jobs; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationOperations; import com.azure.resourcemanager.recoveryservicesbackup.models.Operations; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationsOperations; import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnections; import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpoints; import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainers; @@ -123,8 +109,9 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyOperationResults; import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyOperationStatuses; import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPoints; -import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointsCrrs; import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointsRecommendedForMoves; +import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxies; +import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyOperations; import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceProviders; import com.azure.resourcemanager.recoveryservicesbackup.models.Restores; import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPINs; @@ -133,9 +120,24 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to RecoveryServicesBackupManager. Open API 2.0 Specs for Azure RecoveryServices Backup service. */ public final class RecoveryServicesBackupManager { + private BackupResourceStorageConfigsNonCrrs backupResourceStorageConfigsNonCrrs; + + private ProtectionIntents protectionIntents; + + private BackupStatus backupStatus; + + private FeatureSupports featureSupports; + + private BackupProtectionIntents backupProtectionIntents; + + private BackupUsageSummaries backupUsageSummaries; + + private Operations operations; + private BackupResourceVaultConfigs backupResourceVaultConfigs; private BackupResourceEncryptionConfigs backupResourceEncryptionConfigs; @@ -176,7 +178,7 @@ public final class RecoveryServicesBackupManager { private BackupProtectedItems backupProtectedItems; - private Operations operations; + private OperationOperations operationOperations; private BackupEngines backupEngines; @@ -210,37 +212,9 @@ public final class RecoveryServicesBackupManager { private RecoveryPointsRecommendedForMoves recoveryPointsRecommendedForMoves; - private BackupUsageSummariesCrrs backupUsageSummariesCrrs; - - private AadPropertiesOperations aadPropertiesOperations; - - private CrossRegionRestores crossRegionRestores; - - private BackupCrrJobDetails backupCrrJobDetails; - - private BackupCrrJobs backupCrrJobs; - - private CrrOperationResults crrOperationResults; - - private CrrOperationStatus crrOperationStatus; - - private BackupResourceStorageConfigs backupResourceStorageConfigs; + private ResourceGuardProxies resourceGuardProxies; - private RecoveryPointsCrrs recoveryPointsCrrs; - - private BackupProtectedItemsCrrs backupProtectedItemsCrrs; - - private ProtectionIntents protectionIntents; - - private BackupStatus backupStatus; - - private FeatureSupports featureSupports; - - private BackupProtectionIntents backupProtectionIntents; - - private BackupUsageSummaries backupUsageSummaries; - - private OperationsOperations operationsOperations; + private ResourceGuardProxyOperations resourceGuardProxyOperations; private final RecoveryServicesBackupClient clientObject; @@ -287,6 +261,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -326,6 +301,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { 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. * @@ -382,20 +368,33 @@ public RecoveryServicesBackupManager authenticate(TokenCredential credential, Az userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); 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 ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.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 = @@ -407,6 +406,65 @@ public RecoveryServicesBackupManager authenticate(TokenCredential credential, Az } } + /** @return Resource collection API of BackupResourceStorageConfigsNonCrrs. */ + public BackupResourceStorageConfigsNonCrrs backupResourceStorageConfigsNonCrrs() { + if (this.backupResourceStorageConfigsNonCrrs == null) { + this.backupResourceStorageConfigsNonCrrs = + new BackupResourceStorageConfigsNonCrrsImpl( + clientObject.getBackupResourceStorageConfigsNonCrrs(), this); + } + return backupResourceStorageConfigsNonCrrs; + } + + /** @return Resource collection API of ProtectionIntents. */ + public ProtectionIntents protectionIntents() { + if (this.protectionIntents == null) { + this.protectionIntents = new ProtectionIntentsImpl(clientObject.getProtectionIntents(), this); + } + return protectionIntents; + } + + /** @return Resource collection API of BackupStatus. */ + public BackupStatus backupStatus() { + if (this.backupStatus == null) { + this.backupStatus = new BackupStatusImpl(clientObject.getBackupStatus(), this); + } + return backupStatus; + } + + /** @return Resource collection API of FeatureSupports. */ + public FeatureSupports featureSupports() { + if (this.featureSupports == null) { + this.featureSupports = new FeatureSupportsImpl(clientObject.getFeatureSupports(), this); + } + return featureSupports; + } + + /** @return Resource collection API of BackupProtectionIntents. */ + public BackupProtectionIntents backupProtectionIntents() { + if (this.backupProtectionIntents == null) { + this.backupProtectionIntents = + new BackupProtectionIntentsImpl(clientObject.getBackupProtectionIntents(), this); + } + return backupProtectionIntents; + } + + /** @return Resource collection API of BackupUsageSummaries. */ + public BackupUsageSummaries backupUsageSummaries() { + if (this.backupUsageSummaries == null) { + this.backupUsageSummaries = new BackupUsageSummariesImpl(clientObject.getBackupUsageSummaries(), this); + } + return backupUsageSummaries; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + /** @return Resource collection API of BackupResourceVaultConfigs. */ public BackupResourceVaultConfigs backupResourceVaultConfigs() { if (this.backupResourceVaultConfigs == null) { @@ -574,12 +632,12 @@ public BackupProtectedItems backupProtectedItems() { return backupProtectedItems; } - /** @return Resource collection API of Operations. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + /** @return Resource collection API of OperationOperations. */ + public OperationOperations operationOperations() { + if (this.operationOperations == null) { + this.operationOperations = new OperationOperationsImpl(clientObject.getOperationOperations(), this); } - return operations; + return operationOperations; } /** @return Resource collection API of BackupEngines. */ @@ -722,137 +780,21 @@ public RecoveryPointsRecommendedForMoves recoveryPointsRecommendedForMoves() { return recoveryPointsRecommendedForMoves; } - /** @return Resource collection API of BackupUsageSummariesCrrs. */ - public BackupUsageSummariesCrrs backupUsageSummariesCrrs() { - if (this.backupUsageSummariesCrrs == null) { - this.backupUsageSummariesCrrs = - new BackupUsageSummariesCrrsImpl(clientObject.getBackupUsageSummariesCrrs(), this); - } - return backupUsageSummariesCrrs; - } - - /** @return Resource collection API of AadPropertiesOperations. */ - public AadPropertiesOperations aadPropertiesOperations() { - if (this.aadPropertiesOperations == null) { - this.aadPropertiesOperations = - new AadPropertiesOperationsImpl(clientObject.getAadPropertiesOperations(), this); - } - return aadPropertiesOperations; - } - - /** @return Resource collection API of CrossRegionRestores. */ - public CrossRegionRestores crossRegionRestores() { - if (this.crossRegionRestores == null) { - this.crossRegionRestores = new CrossRegionRestoresImpl(clientObject.getCrossRegionRestores(), this); - } - return crossRegionRestores; - } - - /** @return Resource collection API of BackupCrrJobDetails. */ - public BackupCrrJobDetails backupCrrJobDetails() { - if (this.backupCrrJobDetails == null) { - this.backupCrrJobDetails = new BackupCrrJobDetailsImpl(clientObject.getBackupCrrJobDetails(), this); - } - return backupCrrJobDetails; - } - - /** @return Resource collection API of BackupCrrJobs. */ - public BackupCrrJobs backupCrrJobs() { - if (this.backupCrrJobs == null) { - this.backupCrrJobs = new BackupCrrJobsImpl(clientObject.getBackupCrrJobs(), this); - } - return backupCrrJobs; - } - - /** @return Resource collection API of CrrOperationResults. */ - public CrrOperationResults crrOperationResults() { - if (this.crrOperationResults == null) { - this.crrOperationResults = new CrrOperationResultsImpl(clientObject.getCrrOperationResults(), this); - } - return crrOperationResults; - } - - /** @return Resource collection API of CrrOperationStatus. */ - public CrrOperationStatus crrOperationStatus() { - if (this.crrOperationStatus == null) { - this.crrOperationStatus = new CrrOperationStatusImpl(clientObject.getCrrOperationStatus(), this); - } - return crrOperationStatus; - } - - /** @return Resource collection API of BackupResourceStorageConfigs. */ - public BackupResourceStorageConfigs backupResourceStorageConfigs() { - if (this.backupResourceStorageConfigs == null) { - this.backupResourceStorageConfigs = - new BackupResourceStorageConfigsImpl(clientObject.getBackupResourceStorageConfigs(), this); - } - return backupResourceStorageConfigs; - } - - /** @return Resource collection API of RecoveryPointsCrrs. */ - public RecoveryPointsCrrs recoveryPointsCrrs() { - if (this.recoveryPointsCrrs == null) { - this.recoveryPointsCrrs = new RecoveryPointsCrrsImpl(clientObject.getRecoveryPointsCrrs(), this); - } - return recoveryPointsCrrs; - } - - /** @return Resource collection API of BackupProtectedItemsCrrs. */ - public BackupProtectedItemsCrrs backupProtectedItemsCrrs() { - if (this.backupProtectedItemsCrrs == null) { - this.backupProtectedItemsCrrs = - new BackupProtectedItemsCrrsImpl(clientObject.getBackupProtectedItemsCrrs(), this); + /** @return Resource collection API of ResourceGuardProxies. */ + public ResourceGuardProxies resourceGuardProxies() { + if (this.resourceGuardProxies == null) { + this.resourceGuardProxies = new ResourceGuardProxiesImpl(clientObject.getResourceGuardProxies(), this); } - return backupProtectedItemsCrrs; - } - - /** @return Resource collection API of ProtectionIntents. */ - public ProtectionIntents protectionIntents() { - if (this.protectionIntents == null) { - this.protectionIntents = new ProtectionIntentsImpl(clientObject.getProtectionIntents(), this); - } - return protectionIntents; - } - - /** @return Resource collection API of BackupStatus. */ - public BackupStatus backupStatus() { - if (this.backupStatus == null) { - this.backupStatus = new BackupStatusImpl(clientObject.getBackupStatus(), this); - } - return backupStatus; - } - - /** @return Resource collection API of FeatureSupports. */ - public FeatureSupports featureSupports() { - if (this.featureSupports == null) { - this.featureSupports = new FeatureSupportsImpl(clientObject.getFeatureSupports(), this); - } - return featureSupports; - } - - /** @return Resource collection API of BackupProtectionIntents. */ - public BackupProtectionIntents backupProtectionIntents() { - if (this.backupProtectionIntents == null) { - this.backupProtectionIntents = - new BackupProtectionIntentsImpl(clientObject.getBackupProtectionIntents(), this); - } - return backupProtectionIntents; - } - - /** @return Resource collection API of BackupUsageSummaries. */ - public BackupUsageSummaries backupUsageSummaries() { - if (this.backupUsageSummaries == null) { - this.backupUsageSummaries = new BackupUsageSummariesImpl(clientObject.getBackupUsageSummaries(), this); - } - return backupUsageSummaries; + return resourceGuardProxies; } - /** @return Resource collection API of OperationsOperations. */ - public OperationsOperations operationsOperations() { - if (this.operationsOperations == null) { - this.operationsOperations = new OperationsOperationsImpl(clientObject.getOperationsOperations(), this); + /** @return Resource collection API of ResourceGuardProxyOperations. */ + public ResourceGuardProxyOperations resourceGuardProxyOperations() { + if (this.resourceGuardProxyOperations == null) { + this.resourceGuardProxyOperations = + new ResourceGuardProxyOperationsImpl(clientObject.getResourceGuardProxyOperations(), this); } - return operationsOperations; + return resourceGuardProxyOperations; } /** diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/AadPropertiesOperationsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/AadPropertiesOperationsClient.java deleted file mode 100644 index 9fe3d38dd0c4b..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/AadPropertiesOperationsClient.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.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. - * - * @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); - - /** - * Fetches the AAD properties from target region BCM stamp. - * - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String azureRegion, String filter, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupCrrJobDetailsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupCrrJobDetailsClient.java deleted file mode 100644 index c5c5b84baf21c..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupCrrJobDetailsClient.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.JobResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.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. - * @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); - - /** - * 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String azureRegion, CrrJobRequest parameters, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupCrrJobsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupCrrJobsClient.java deleted file mode 100644 index 2f119b05a218b..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupCrrJobsClient.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.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 Backup 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.COLLECTION) - PagedIterable list(String azureRegion, CrrJobRequest parameters); - - /** - * Gets the list of CRR jobs from the target region. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Backup 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. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String azureRegion, CrrJobRequest parameters, String filter, String skipToken, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceEncryptionConfigsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceEncryptionConfigsClient.java index f3a81d0a093f3..1532b546fcbc0 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceEncryptionConfigsClient.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceEncryptionConfigsClient.java @@ -8,7 +8,8 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigExtendedResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource; /** An instance of this class provides access to all the operations defined in BackupResourceEncryptionConfigsClient. */ public interface BackupResourceEncryptionConfigsClient { @@ -23,7 +24,7 @@ public interface BackupResourceEncryptionConfigsClient { * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - BackupResourceEncryptionConfigResourceInner get(String vaultName, String resourceGroupName); + BackupResourceEncryptionConfigExtendedResourceInner get(String vaultName, String resourceGroupName); /** * Fetches Vault Encryption config. @@ -37,7 +38,7 @@ public interface BackupResourceEncryptionConfigsClient { * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( + Response getWithResponse( String vaultName, String resourceGroupName, Context context); /** @@ -51,7 +52,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void update(String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResourceInner parameters); + void update(String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResource parameters); /** * Updates Vault encryption config. @@ -67,8 +68,5 @@ Response getWithResponse( */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( - String vaultName, - String resourceGroupName, - BackupResourceEncryptionConfigResourceInner parameters, - Context context); + String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResource parameters, Context context); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceStorageConfigsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceStorageConfigsNonCrrsClient.java similarity index 96% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceStorageConfigsClient.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceStorageConfigsNonCrrsClient.java index bade3bb243375..56025e9b5d3af 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceStorageConfigsClient.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceStorageConfigsNonCrrsClient.java @@ -10,8 +10,10 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; -/** An instance of this class provides access to all the operations defined in BackupResourceStorageConfigsClient. */ -public interface BackupResourceStorageConfigsClient { +/** + * An instance of this class provides access to all the operations defined in BackupResourceStorageConfigsNonCrrsClient. + */ +public interface BackupResourceStorageConfigsNonCrrsClient { /** * Fetches resource storage config. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossRegionRestoresClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossRegionRestoresClient.java deleted file mode 100644 index 205895fb11ea4..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossRegionRestoresClient.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.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. - * @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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginTrigger(String azureRegion, CrossRegionRestoreRequest parameters); - - /** - * 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginTrigger( - 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); - - /** - * 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void trigger(String azureRegion, CrossRegionRestoreRequest parameters, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrrOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrrOperationResultsClient.java deleted file mode 100644 index 7a7e412099f7c..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrrOperationResultsClient.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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 { - /** - * @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); - - /** - * @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 response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String azureRegion, String operationId, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrrOperationStatusClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrrOperationStatusClient.java deleted file mode 100644 index 4ebd835ffe0f4..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrrOperationStatusClient.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.OperationStatusInner; - -/** An instance of this class provides access to all the operations defined in CrrOperationStatusClient. */ -public interface CrrOperationStatusClient { - /** - * @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); - - /** - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String azureRegion, String operationId, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsCrrsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationOperationsClient.java similarity index 60% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsCrrsClient.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationOperationsClient.java index c6a27d9105b0b..3464c8afe2189 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsCrrsClient.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationOperationsClient.java @@ -6,39 +6,41 @@ 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.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequest; -/** An instance of this class provides access to all the operations defined in BackupProtectedItemsCrrsClient. */ -public interface BackupProtectedItemsCrrsClient { +/** An instance of this class provides access to all the operations defined in OperationOperationsClient. */ +public interface OperationOperationsClient { /** - * Provides a pageable list of all items that are backed up within a vault. + * Validate operation for specified backed up item. This is a synchronous operation. * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation 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 list of ProtectedItem resources. + * @return the response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateOperationsResponseInner validate( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters); /** - * Provides a pageable list of all items that are backed up within a vault. + * Validate operation for specified backed up item. This is a synchronous operation. * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param filter OData filter options. - * @param skipToken skipToken Filter. + * @param parameters resource validate operation 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 list of ProtectedItem resources. + * @return the response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String vaultName, String resourceGroupName, String filter, String skipToken, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateWithResponse( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsClient.java index 81d4d9b71a78f..d1a8170127b77 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsClient.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsClient.java @@ -6,41 +6,31 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequest; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; /** An instance of this class provides access to all the operations defined in OperationsClient. */ public interface OperationsClient { /** - * Validate operation for specified backed up item. This is a synchronous operation. + * Returns the list of available operations. * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param parameters resource validate operation 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 response. + * @return operations List response which contains list of available APIs. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ValidateOperationsResponseInner validate( - String vaultName, String resourceGroupName, ValidateOperationRequest parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Validate operation for specified backed up item. This is a synchronous operation. + * Returns the list of available operations. * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param parameters resource validate operation 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 response. + * @return operations List response which contains list of available APIs. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateWithResponse( - String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsOperationsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsOperationsClient.java deleted file mode 100644 index 69497872e4fa0..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsOperationsClient.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; - -/** An instance of this class provides access to all the operations defined in OperationsOperationsClient. */ -public interface OperationsOperationsClient { - /** - * Returns the list of available operations. - * - * @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 operations List response which contains list of available APIs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Returns the list of available operations. - * - * @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 operations List response which contains list of available APIs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointConnectionsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointConnectionsClient.java index 3aeaf4c01a7f5..5c49c98aecdd2 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointConnectionsClient.java @@ -57,7 +57,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private Endpoint Connection Response Properties. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionResourceInner> beginPut( String vaultName, String resourceGroupName, @@ -77,7 +77,7 @@ SyncPoller, PrivateEndpointCo * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private Endpoint Connection Response Properties. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionResourceInner> beginPut( String vaultName, String resourceGroupName, @@ -136,7 +136,7 @@ PrivateEndpointConnectionResourceInner put( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String vaultName, String resourceGroupName, String privateEndpointConnectionName); @@ -152,7 +152,7 @@ SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPoliciesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPoliciesClient.java index c3b32d225f8f2..6bb91e15b8939 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPoliciesClient.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPoliciesClient.java @@ -97,7 +97,7 @@ Response createOrUpdateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String vaultName, String resourceGroupName, String policyName); /** @@ -113,7 +113,7 @@ Response createOrUpdateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String vaultName, String resourceGroupName, String policyName, Context context); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java index 37306762572bc..1d56e463f0196 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java @@ -9,8 +9,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrrAccessTokenResourceInner; import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; /** An instance of this class provides access to all the operations defined in RecoveryPointsClient. */ @@ -106,56 +104,4 @@ Response getWithResponse( String protectedItemName, String recoveryPointId, Context context); - - /** - * Returns the Access token for communication between BMS and Protection service. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CrrAccessTokenResourceInner getAccessToken( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String recoveryPointId, - AadPropertiesResourceInner parameters); - - /** - * Returns the Access token for communication between BMS and Protection service. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAccessTokenWithResponse( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String recoveryPointId, - AadPropertiesResourceInner parameters, - Context context); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsCrrsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsCrrsClient.java deleted file mode 100644 index aec79d56dfecb..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsCrrsClient.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; - -/** An instance of this class provides access to all the operations defined in RecoveryPointsCrrsClient. */ -public interface RecoveryPointsCrrsClient { - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name associated with the backed up item. - * @param containerName Container name associated with the backed up item. - * @param protectedItemName Backed up item whose backup copies are to be fetched. - * @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. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName); - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name associated with the backed up item. - * @param containerName Container name associated with the backed up item. - * @param protectedItemName Backed up item whose backup copies are to be fetched. - * @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. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String filter, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupClient.java index a07639990acd4..4a3c8e247989b 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupClient.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupClient.java @@ -23,6 +23,13 @@ public interface RecoveryServicesBackupClient { */ String getEndpoint(); + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + /** * Gets The HTTP pipeline to send requests through. * @@ -37,6 +44,55 @@ public interface RecoveryServicesBackupClient { */ Duration getDefaultPollInterval(); + /** + * Gets the BackupResourceStorageConfigsNonCrrsClient object to access its operations. + * + * @return the BackupResourceStorageConfigsNonCrrsClient object. + */ + BackupResourceStorageConfigsNonCrrsClient getBackupResourceStorageConfigsNonCrrs(); + + /** + * Gets the ProtectionIntentsClient object to access its operations. + * + * @return the ProtectionIntentsClient object. + */ + ProtectionIntentsClient getProtectionIntents(); + + /** + * Gets the BackupStatusClient object to access its operations. + * + * @return the BackupStatusClient object. + */ + BackupStatusClient getBackupStatus(); + + /** + * Gets the FeatureSupportsClient object to access its operations. + * + * @return the FeatureSupportsClient object. + */ + FeatureSupportsClient getFeatureSupports(); + + /** + * Gets the BackupProtectionIntentsClient object to access its operations. + * + * @return the BackupProtectionIntentsClient object. + */ + BackupProtectionIntentsClient getBackupProtectionIntents(); + + /** + * Gets the BackupUsageSummariesClient object to access its operations. + * + * @return the BackupUsageSummariesClient object. + */ + BackupUsageSummariesClient getBackupUsageSummaries(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + /** * Gets the BackupResourceVaultConfigsClient object to access its operations. * @@ -178,11 +234,11 @@ public interface RecoveryServicesBackupClient { BackupProtectedItemsClient getBackupProtectedItems(); /** - * Gets the OperationsClient object to access its operations. + * Gets the OperationOperationsClient object to access its operations. * - * @return the OperationsClient object. + * @return the OperationOperationsClient object. */ - OperationsClient getOperations(); + OperationOperationsClient getOperationOperations(); /** * Gets the BackupEnginesClient object to access its operations. @@ -297,114 +353,16 @@ public interface RecoveryServicesBackupClient { RecoveryPointsRecommendedForMovesClient getRecoveryPointsRecommendedForMoves(); /** - * 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 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 BackupProtectedItemsCrrsClient object to access its operations. - * - * @return the BackupProtectedItemsCrrsClient object. - */ - BackupProtectedItemsCrrsClient getBackupProtectedItemsCrrs(); - - /** - * Gets the ProtectionIntentsClient object to access its operations. - * - * @return the ProtectionIntentsClient object. - */ - ProtectionIntentsClient getProtectionIntents(); - - /** - * Gets the BackupStatusClient object to access its operations. + * Gets the ResourceGuardProxiesClient object to access its operations. * - * @return the BackupStatusClient object. - */ - BackupStatusClient getBackupStatus(); - - /** - * Gets the FeatureSupportsClient object to access its operations. - * - * @return the FeatureSupportsClient object. + * @return the ResourceGuardProxiesClient object. */ - FeatureSupportsClient getFeatureSupports(); - - /** - * Gets the BackupProtectionIntentsClient object to access its operations. - * - * @return the BackupProtectionIntentsClient object. - */ - BackupProtectionIntentsClient getBackupProtectionIntents(); - - /** - * Gets the BackupUsageSummariesClient object to access its operations. - * - * @return the BackupUsageSummariesClient object. - */ - BackupUsageSummariesClient getBackupUsageSummaries(); + ResourceGuardProxiesClient getResourceGuardProxies(); /** - * Gets the OperationsOperationsClient object to access its operations. + * Gets the ResourceGuardProxyOperationsClient object to access its operations. * - * @return the OperationsOperationsClient object. + * @return the ResourceGuardProxyOperationsClient object. */ - OperationsOperationsClient getOperationsOperations(); + ResourceGuardProxyOperationsClient getResourceGuardProxyOperations(); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupUsageSummariesCrrsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceGuardProxiesClient.java similarity index 70% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupUsageSummariesCrrsClient.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceGuardProxiesClient.java index cddd4bda4b184..7ca607cf387a1 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupUsageSummariesCrrsClient.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceGuardProxiesClient.java @@ -8,37 +8,34 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; -/** An instance of this class provides access to all the operations defined in BackupUsageSummariesCrrsClient. */ -public interface BackupUsageSummariesCrrsClient { +/** An instance of this class provides access to all the operations defined in ResourceGuardProxiesClient. */ +public interface ResourceGuardProxiesClient { /** - * Fetches the backup management usage summaries of the vault. + * List the ResourceGuardProxies under vault. * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. * @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. + * @return list of ResourceGuardProxyBase resources. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName); + PagedIterable get(String vaultName, String resourceGroupName); /** - * Fetches the backup management usage summaries of the vault. + * List the ResourceGuardProxies under vault. * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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. + * @return list of ResourceGuardProxyBase resources. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String vaultName, String resourceGroupName, String filter, String skipToken, Context context); + PagedIterable get(String vaultName, String resourceGroupName, Context context); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceGuardProxyOperationsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceGuardProxyOperationsClient.java new file mode 100644 index 0000000000000..c048b67e4f275 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceGuardProxyOperationsClient.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.UnlockDeleteResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.UnlockDeleteRequest; + +/** An instance of this class provides access to all the operations defined in ResourceGuardProxyOperationsClient. */ +public interface ResourceGuardProxyOperationsClient { + /** + * Returns ResourceGuardProxy under vault and with the name referenced in request. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceGuardProxyBaseResourceInner get(String vaultName, String resourceGroupName, String resourceGuardProxyName); + + /** + * Returns ResourceGuardProxy under vault and with the name referenced in request. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context); + + /** + * Add or Update ResourceGuardProxy under vault Secures vault critical operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceGuardProxyBaseResourceInner put(String vaultName, String resourceGroupName, String resourceGuardProxyName); + + /** + * Add or Update ResourceGuardProxy under vault Secures vault critical operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context); + + /** + * Delete ResourceGuardProxy under vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 delete(String vaultName, String resourceGroupName, String resourceGuardProxyName); + + /** + * Delete ResourceGuardProxy under vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context); + + /** + * Secures delete ResourceGuardProxy operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName parameter. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of Unlock Delete API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UnlockDeleteResponseInner unlockDelete( + String vaultName, String resourceGroupName, String resourceGuardProxyName, UnlockDeleteRequest parameters); + + /** + * Secures delete ResourceGuardProxy operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName parameter. + * @param parameters Request body for operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of Unlock Delete API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response unlockDeleteWithResponse( + String vaultName, + String resourceGroupName, + String resourceGuardProxyName, + UnlockDeleteRequest parameters, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceProvidersClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceProvidersClient.java index 3b758f9f69e2f..f70075ad3bf75 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceProvidersClient.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceProvidersClient.java @@ -58,7 +58,7 @@ Response getOperationStatusWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginBmsPrepareDataMove( String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters); @@ -74,7 +74,7 @@ SyncPoller, Void> beginBmsPrepareDataMove( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginBmsPrepareDataMove( String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, Context context); @@ -117,7 +117,7 @@ void bmsPrepareDataMove( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginBmsTriggerDataMove( String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters); @@ -133,7 +133,7 @@ SyncPoller, Void> beginBmsTriggerDataMove( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginBmsTriggerDataMove( String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, Context context); @@ -180,7 +180,7 @@ void bmsTriggerDataMove( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginMoveRecoveryPoint( String vaultName, String resourceGroupName, @@ -206,7 +206,7 @@ SyncPoller, Void> beginMoveRecoveryPoint( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginMoveRecoveryPoint( String vaultName, String resourceGroupName, diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RestoresClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RestoresClient.java index de7f8b5894512..61a29245fd767 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RestoresClient.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RestoresClient.java @@ -29,7 +29,7 @@ public interface RestoresClient { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginTrigger( String vaultName, String resourceGroupName, @@ -56,7 +56,7 @@ SyncPoller, Void> beginTrigger( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginTrigger( String vaultName, String resourceGroupName, diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/SecurityPINsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/SecurityPINsClient.java index 6365bdedc379e..368843af92ab2 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/SecurityPINsClient.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/SecurityPINsClient.java @@ -9,6 +9,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPinBase; /** An instance of this class provides access to all the operations defined in SecurityPINsClient. */ public interface SecurityPINsClient { @@ -30,6 +31,7 @@ public interface SecurityPINsClient { * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters security pin 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. @@ -37,5 +39,6 @@ public interface SecurityPINsClient { * @return the security PIN. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, Context context); + Response getWithResponse( + String vaultName, String resourceGroupName, SecurityPinBase parameters, Context context); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AadPropertiesResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AadPropertiesResourceInner.java deleted file mode 100644 index bc98b5015b8a0..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AadPropertiesResourceInner.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.models.AadProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The AadPropertiesResource model. */ -@Fluent -public final class AadPropertiesResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AadPropertiesResourceInner.class); - - /* - * AADPropertiesResource properties - */ - @JsonProperty(value = "properties") - private AadProperties properties; - - /* - * Optional ETag. - */ - @JsonProperty(value = "eTag") - private String etag; - - /** - * 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; - } - - /** {@inheritDoc} */ - @Override - public AadPropertiesResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AadPropertiesResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigExtendedResourceInner.java similarity index 61% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigResourceInner.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigExtendedResourceInner.java index 13013f6d80689..248ad0d4a921f 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigResourceInner.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigExtendedResourceInner.java @@ -7,21 +7,22 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfig; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigExtended; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** The BackupResourceEncryptionConfigResource model. */ +/** The BackupResourceEncryptionConfigExtendedResource model. */ @Fluent -public final class BackupResourceEncryptionConfigResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceEncryptionConfigResourceInner.class); +public final class BackupResourceEncryptionConfigExtendedResourceInner extends Resource { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(BackupResourceEncryptionConfigExtendedResourceInner.class); /* - * BackupResourceEncryptionConfigResource properties + * BackupResourceEncryptionConfigExtendedResource properties */ @JsonProperty(value = "properties") - private BackupResourceEncryptionConfig properties; + private BackupResourceEncryptionConfigExtended properties; /* * Optional ETag. @@ -30,21 +31,22 @@ public final class BackupResourceEncryptionConfigResourceInner extends Resource private String etag; /** - * Get the properties property: BackupResourceEncryptionConfigResource properties. + * Get the properties property: BackupResourceEncryptionConfigExtendedResource properties. * * @return the properties value. */ - public BackupResourceEncryptionConfig properties() { + public BackupResourceEncryptionConfigExtended properties() { return this.properties; } /** - * Set the properties property: BackupResourceEncryptionConfigResource properties. + * Set the properties property: BackupResourceEncryptionConfigExtendedResource properties. * * @param properties the properties value to set. - * @return the BackupResourceEncryptionConfigResourceInner object itself. + * @return the BackupResourceEncryptionConfigExtendedResourceInner object itself. */ - public BackupResourceEncryptionConfigResourceInner withProperties(BackupResourceEncryptionConfig properties) { + public BackupResourceEncryptionConfigExtendedResourceInner withProperties( + BackupResourceEncryptionConfigExtended properties) { this.properties = properties; return this; } @@ -62,23 +64,23 @@ public String etag() { * Set the etag property: Optional ETag. * * @param etag the etag value to set. - * @return the BackupResourceEncryptionConfigResourceInner object itself. + * @return the BackupResourceEncryptionConfigExtendedResourceInner object itself. */ - public BackupResourceEncryptionConfigResourceInner withEtag(String etag) { + public BackupResourceEncryptionConfigExtendedResourceInner withEtag(String etag) { this.etag = etag; return this; } /** {@inheritDoc} */ @Override - public BackupResourceEncryptionConfigResourceInner withLocation(String location) { + public BackupResourceEncryptionConfigExtendedResourceInner withLocation(String location) { super.withLocation(location); return this; } /** {@inheritDoc} */ @Override - public BackupResourceEncryptionConfigResourceInner withTags(Map tags) { + public BackupResourceEncryptionConfigExtendedResourceInner withTags(Map tags) { super.withTags(tags); return this; } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/CrrAccessTokenResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ResourceGuardProxyBaseResourceInner.java similarity index 62% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/CrrAccessTokenResourceInner.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ResourceGuardProxyBaseResourceInner.java index 0cd561edb40c8..9c0885478cc8a 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/CrrAccessTokenResourceInner.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ResourceGuardProxyBaseResourceInner.java @@ -7,21 +7,21 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrrAccessToken; +import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyBase; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** The CrrAccessTokenResource model. */ +/** The ResourceGuardProxyBaseResource model. */ @Fluent -public final class CrrAccessTokenResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CrrAccessTokenResourceInner.class); +public final class ResourceGuardProxyBaseResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGuardProxyBaseResourceInner.class); /* - * CrrAccessTokenResource properties + * ResourceGuardProxyBaseResource properties */ @JsonProperty(value = "properties") - private CrrAccessToken properties; + private ResourceGuardProxyBase properties; /* * Optional ETag. @@ -30,21 +30,21 @@ public final class CrrAccessTokenResourceInner extends Resource { private String etag; /** - * Get the properties property: CrrAccessTokenResource properties. + * Get the properties property: ResourceGuardProxyBaseResource properties. * * @return the properties value. */ - public CrrAccessToken properties() { + public ResourceGuardProxyBase properties() { return this.properties; } /** - * Set the properties property: CrrAccessTokenResource properties. + * Set the properties property: ResourceGuardProxyBaseResource properties. * * @param properties the properties value to set. - * @return the CrrAccessTokenResourceInner object itself. + * @return the ResourceGuardProxyBaseResourceInner object itself. */ - public CrrAccessTokenResourceInner withProperties(CrrAccessToken properties) { + public ResourceGuardProxyBaseResourceInner withProperties(ResourceGuardProxyBase properties) { this.properties = properties; return this; } @@ -62,23 +62,23 @@ public String etag() { * Set the etag property: Optional ETag. * * @param etag the etag value to set. - * @return the CrrAccessTokenResourceInner object itself. + * @return the ResourceGuardProxyBaseResourceInner object itself. */ - public CrrAccessTokenResourceInner withEtag(String etag) { + public ResourceGuardProxyBaseResourceInner withEtag(String etag) { this.etag = etag; return this; } /** {@inheritDoc} */ @Override - public CrrAccessTokenResourceInner withLocation(String location) { + public ResourceGuardProxyBaseResourceInner withLocation(String location) { super.withLocation(location); return this; } /** {@inheritDoc} */ @Override - public CrrAccessTokenResourceInner withTags(Map tags) { + public ResourceGuardProxyBaseResourceInner withTags(Map tags) { super.withTags(tags); return this; } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/UnlockDeleteResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/UnlockDeleteResponseInner.java new file mode 100644 index 0000000000000..7c782e59a5865 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/UnlockDeleteResponseInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response of Unlock Delete API. */ +@Fluent +public final class UnlockDeleteResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UnlockDeleteResponseInner.class); + + /* + * This is the time when unlock delete privileges will get expired. + */ + @JsonProperty(value = "unlockDeleteExpiryTime") + private String unlockDeleteExpiryTime; + + /** + * Get the unlockDeleteExpiryTime property: This is the time when unlock delete privileges will get expired. + * + * @return the unlockDeleteExpiryTime value. + */ + public String unlockDeleteExpiryTime() { + return this.unlockDeleteExpiryTime; + } + + /** + * Set the unlockDeleteExpiryTime property: This is the time when unlock delete privileges will get expired. + * + * @param unlockDeleteExpiryTime the unlockDeleteExpiryTime value to set. + * @return the UnlockDeleteResponseInner object itself. + */ + public UnlockDeleteResponseInner withUnlockDeleteExpiryTime(String unlockDeleteExpiryTime) { + this.unlockDeleteExpiryTime = unlockDeleteExpiryTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesOperationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesOperationsClientImpl.java deleted file mode 100644 index 77771c68c7bd2..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesOperationsClientImpl.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.AadPropertiesOperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.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 { - private final ClientLogger logger = new ClientLogger(AadPropertiesOperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AadPropertiesOperationsService service; - - /** The service client containing this operation class. */ - private final RecoveryServicesBackupClientImpl client; - - /** - * Initializes an instance of AadPropertiesOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AadPropertiesOperationsClientImpl(RecoveryServicesBackupClientImpl client) { - this.service = - RestProxy - .create(AadPropertiesOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupClientAadPropertiesOperations to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "RecoveryServicesBack") - private interface AadPropertiesOperationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}" - + "/backupAadProperties") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("azureRegion") String azureRegion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Fetches the AAD properties from target region BCM stamp. - * - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String azureRegion, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (azureRegion == null) { - return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - azureRegion, - this.client.getSubscriptionId(), - filter, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches the AAD properties from target region BCM stamp. - * - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String azureRegion, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (azureRegion == null) { - return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - azureRegion, - this.client.getSubscriptionId(), - filter, - accept, - context); - } - - /** - * Fetches the AAD properties from target region BCM stamp. - * - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String azureRegion, String filter) { - return getWithResponseAsync(azureRegion, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Fetches the AAD properties from target region BCM stamp. - * - * @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) - private Mono getAsync(String azureRegion) { - final String filter = null; - return getWithResponseAsync(azureRegion, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Fetches the AAD properties from target region BCM stamp. - * - * @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 getAsync(azureRegion, filter).block(); - } - - /** - * Fetches the AAD properties from target region BCM stamp. - * - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String azureRegion, String filter, Context context) { - return getWithResponseAsync(azureRegion, filter, context).block(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesOperationsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesOperationsImpl.java deleted file mode 100644 index 7a880a00a4675..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesOperationsImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.AadPropertiesOperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.AadPropertiesOperations; -import com.azure.resourcemanager.recoveryservicesbackup.models.AadPropertiesResource; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class AadPropertiesOperationsImpl implements AadPropertiesOperations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AadPropertiesOperationsImpl.class); - - private final AadPropertiesOperationsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public AadPropertiesOperationsImpl( - AadPropertiesOperationsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public AadPropertiesResource get(String azureRegion) { - AadPropertiesResourceInner inner = this.serviceClient().get(azureRegion); - if (inner != null) { - return new AadPropertiesResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String azureRegion, String filter, Context context) { - Response inner = this.serviceClient().getWithResponse(azureRegion, filter, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AadPropertiesResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private AadPropertiesOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesResourceImpl.java deleted file mode 100644 index 321ca02ab486e..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesResourceImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.AadProperties; -import com.azure.resourcemanager.recoveryservicesbackup.models.AadPropertiesResource; -import java.util.Collections; -import java.util.Map; - -public final class AadPropertiesResourceImpl implements AadPropertiesResource { - private AadPropertiesResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - AadPropertiesResourceImpl( - AadPropertiesResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager 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.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobDetailsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobDetailsImpl.java deleted file mode 100644 index 2a18f1cde5f90..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobDetailsImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.BackupCrrJobDetailsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupCrrJobDetails; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrrJobRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.JobResource; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class BackupCrrJobDetailsImpl implements BackupCrrJobDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupCrrJobDetailsImpl.class); - - private final BackupCrrJobDetailsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupCrrJobDetailsImpl( - BackupCrrJobDetailsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - 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; - } - } - - public Response getWithResponse(String azureRegion, CrrJobRequest parameters, Context context) { - Response inner = this.serviceClient().getWithResponse(azureRegion, parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new JobResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private BackupCrrJobDetailsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobsClientImpl.java deleted file mode 100644 index 28e8a7d7ae977..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobsClientImpl.java +++ /dev/null @@ -1,383 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.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.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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupCrrJobsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrrJobRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.JobResourceList; -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 { - private final ClientLogger logger = new ClientLogger(BackupCrrJobsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BackupCrrJobsService service; - - /** The service client containing this operation class. */ - private final RecoveryServicesBackupClientImpl client; - - /** - * Initializes an instance of BackupCrrJobsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupCrrJobsClientImpl(RecoveryServicesBackupClientImpl client) { - this.service = - RestProxy.create(BackupCrrJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupClientBackupCrrJobs to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "RecoveryServicesBack") - private interface BackupCrrJobsService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}" - + "/backupCrrJobs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("azureRegion") String azureRegion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @QueryParam("$skipToken") String skipToken, - @BodyParam("application/json") CrrJobRequest parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the list of CRR jobs from the target region. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Backup 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String azureRegion, CrrJobRequest parameters, String filter, String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (azureRegion == null) { - return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - azureRegion, - this.client.getSubscriptionId(), - filter, - skipToken, - parameters, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .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 Backup 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String azureRegion, CrrJobRequest parameters, String filter, String skipToken, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (azureRegion == null) { - return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - azureRegion, - this.client.getSubscriptionId(), - filter, - skipToken, - parameters, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the list of CRR jobs from the target region. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Backup 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. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String azureRegion, CrrJobRequest parameters, String filter, String skipToken) { - return new PagedFlux<>( - () -> listSinglePageAsync(azureRegion, parameters, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of CRR jobs from the target region. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Backup 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.COLLECTION) - private PagedFlux listAsync(String azureRegion, CrrJobRequest parameters) { - final String filter = null; - final String skipToken = null; - return new PagedFlux<>( - () -> listSinglePageAsync(azureRegion, parameters, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of CRR jobs from the target region. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Backup 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. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String azureRegion, CrrJobRequest parameters, String filter, String skipToken, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(azureRegion, parameters, filter, skipToken, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the list of CRR jobs from the target region. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Backup 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.COLLECTION) - public PagedIterable list(String azureRegion, CrrJobRequest parameters) { - final String filter = null; - final String skipToken = null; - return new PagedIterable<>(listAsync(azureRegion, parameters, filter, skipToken)); - } - - /** - * Gets the list of CRR jobs from the target region. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Backup 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. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String azureRegion, CrrJobRequest parameters, String filter, String skipToken, Context context) { - return new PagedIterable<>(listAsync(azureRegion, parameters, filter, skipToken, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink 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 list of Job resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink 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 list of Job resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobsImpl.java deleted file mode 100644 index e1b822bf755d3..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobsImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupCrrJobsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupCrrJobs; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrrJobRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.JobResource; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class BackupCrrJobsImpl implements BackupCrrJobs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupCrrJobsImpl.class); - - private final BackupCrrJobsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupCrrJobsImpl( - BackupCrrJobsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String azureRegion, CrrJobRequest parameters) { - PagedIterable inner = this.serviceClient().list(azureRegion, parameters); - return Utils.mapPage(inner, inner1 -> new JobResourceImpl(inner1, this.manager())); - } - - public PagedIterable list( - String azureRegion, CrrJobRequest parameters, String filter, String skipToken, Context context) { - PagedIterable inner = - this.serviceClient().list(azureRegion, parameters, filter, skipToken, context); - return Utils.mapPage(inner, inner1 -> new JobResourceImpl(inner1, this.manager())); - } - - private BackupCrrJobsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java index 10eca34be43f9..693f48139a31d 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java @@ -139,7 +139,6 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -147,7 +146,7 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -202,13 +201,12 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -362,7 +360,6 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter backupEngineName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -370,7 +367,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -427,13 +424,12 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter backupEngineName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java index ebee30211e676..d6abd904f030a 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java @@ -121,7 +121,6 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -129,7 +128,7 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -184,13 +183,12 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsClientImpl.java index a5a06443ab6af..62cd1201922c8 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsClientImpl.java @@ -109,7 +109,6 @@ private Mono> getWithResponseAsync(String vaultName, String resou if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -117,7 +116,7 @@ private Mono> getWithResponseAsync(String vaultName, String resou service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -167,13 +166,12 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesClientImpl.java index 5b5c0f3073076..cb8e472840f19 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesClientImpl.java @@ -110,7 +110,6 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -118,7 +117,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -167,13 +166,12 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java index c119cd2f9f2bf..f047fe99d30af 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java @@ -120,7 +120,6 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -128,7 +127,7 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -182,13 +181,12 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java index 88562b612fcf3..5f08c97b20182 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java @@ -123,7 +123,6 @@ private Mono> listSinglePage new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -131,7 +130,7 @@ private Mono> listSinglePage service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -187,13 +186,12 @@ private Mono> listSinglePage new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java index 96df489941278..bfaf3b784fe56 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java @@ -122,7 +122,6 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -130,7 +129,7 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -185,13 +184,12 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsCrrsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsCrrsImpl.java deleted file mode 100644 index bc2dfe696734b..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsCrrsImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsCrrsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectedItemsCrrs; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResource; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class BackupProtectedItemsCrrsImpl implements BackupProtectedItemsCrrs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupProtectedItemsCrrsImpl.class); - - private final BackupProtectedItemsCrrsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupProtectedItemsCrrsImpl( - BackupProtectedItemsCrrsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String vaultName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); - return Utils.mapPage(inner, inner1 -> new ProtectedItemResourceImpl(inner1, this.manager())); - } - - public PagedIterable list( - String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { - PagedIterable inner = - this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); - return Utils.mapPage(inner, inner1 -> new ProtectedItemResourceImpl(inner1, this.manager())); - } - - private BackupProtectedItemsCrrsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java index 823d4ecbbbd60..2110e229ed921 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java @@ -121,7 +121,6 @@ private Mono> listSinglePageAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -129,7 +128,7 @@ private Mono> listSinglePageAsyn service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -182,13 +181,12 @@ private Mono> listSinglePageAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java index fbbf246f87736..0753ae4388749 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java @@ -122,7 +122,6 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2017-07-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -130,7 +129,7 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -185,13 +184,12 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2017-07-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigExtendedResourceImpl.java similarity index 72% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigResourceImpl.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigExtendedResourceImpl.java index a9348ea5cdc10..c84fdfdd56c59 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigResourceImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigExtendedResourceImpl.java @@ -4,19 +4,20 @@ package com.azure.resourcemanager.recoveryservicesbackup.implementation; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfig; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigExtendedResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigExtended; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigExtendedResource; import java.util.Collections; import java.util.Map; -public final class BackupResourceEncryptionConfigResourceImpl implements BackupResourceEncryptionConfigResource { - private BackupResourceEncryptionConfigResourceInner innerObject; +public final class BackupResourceEncryptionConfigExtendedResourceImpl + implements BackupResourceEncryptionConfigExtendedResource { + private BackupResourceEncryptionConfigExtendedResourceInner innerObject; private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - BackupResourceEncryptionConfigResourceImpl( - BackupResourceEncryptionConfigResourceInner innerObject, + BackupResourceEncryptionConfigExtendedResourceImpl( + BackupResourceEncryptionConfigExtendedResourceInner innerObject, com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -47,7 +48,7 @@ public Map tags() { } } - public BackupResourceEncryptionConfig properties() { + public BackupResourceEncryptionConfigExtended properties() { return this.innerModel().properties(); } @@ -55,7 +56,7 @@ public String etag() { return this.innerModel().etag(); } - public BackupResourceEncryptionConfigResourceInner innerModel() { + public BackupResourceEncryptionConfigExtendedResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsClientImpl.java index 0bc8650e23f26..6a2a4e24180d2 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsClientImpl.java @@ -25,7 +25,8 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceEncryptionConfigsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigExtendedResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in BackupResourceEncryptionConfigsClient. */ @@ -66,7 +67,7 @@ private interface BackupResourceEncryptionConfigsService { + "/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, @@ -87,7 +88,7 @@ Mono> update( @PathParam("vaultName") String vaultName, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") BackupResourceEncryptionConfigResourceInner parameters, + @BodyParam("application/json") BackupResourceEncryptionConfigResource parameters, @HeaderParam("Accept") String accept, Context context); } @@ -103,7 +104,7 @@ Mono> update( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( + private Mono> getWithResponseAsync( String vaultName, String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono @@ -124,7 +125,6 @@ private Mono> getWithRespo new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -132,7 +132,7 @@ private Mono> getWithRespo service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -153,7 +153,7 @@ private Mono> getWithRespo * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( + private Mono> getWithResponseAsync( String vaultName, String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -174,13 +174,12 @@ private Mono> getWithRespo new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -199,10 +198,11 @@ private Mono> getWithRespo * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName) { + private Mono getAsync( + String vaultName, String resourceGroupName) { return getWithResponseAsync(vaultName, resourceGroupName) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -222,7 +222,7 @@ private Mono getAsync(String vaultN * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BackupResourceEncryptionConfigResourceInner get(String vaultName, String resourceGroupName) { + public BackupResourceEncryptionConfigExtendedResourceInner get(String vaultName, String resourceGroupName) { return getAsync(vaultName, resourceGroupName).block(); } @@ -238,7 +238,7 @@ public BackupResourceEncryptionConfigResourceInner get(String vaultName, String * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( + public Response getWithResponse( String vaultName, String resourceGroupName, Context context) { return getWithResponseAsync(vaultName, resourceGroupName, context).block(); } @@ -256,7 +256,7 @@ public Response getWithResponse( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( - String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResourceInner parameters) { + String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResource parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -281,7 +281,6 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -289,7 +288,7 @@ private Mono> updateWithResponseAsync( service .update( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -315,7 +314,7 @@ private Mono> updateWithResponseAsync( private Mono> updateWithResponseAsync( String vaultName, String resourceGroupName, - BackupResourceEncryptionConfigResourceInner parameters, + BackupResourceEncryptionConfigResource parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -341,13 +340,12 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -369,7 +367,7 @@ private Mono> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( - String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResourceInner parameters) { + String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResource parameters) { return updateWithResponseAsync(vaultName, resourceGroupName, parameters) .flatMap((Response res) -> Mono.empty()); } @@ -385,8 +383,7 @@ private Mono updateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void update( - String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResourceInner parameters) { + public void update(String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResource parameters) { updateAsync(vaultName, resourceGroupName, parameters).block(); } @@ -406,7 +403,7 @@ public void update( public Response updateWithResponse( String vaultName, String resourceGroupName, - BackupResourceEncryptionConfigResourceInner parameters, + BackupResourceEncryptionConfigResource parameters, Context context) { return updateWithResponseAsync(vaultName, resourceGroupName, parameters, context).block(); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsImpl.java index 004b68190cef3..9bee7c6c8da6b 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsImpl.java @@ -9,7 +9,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceEncryptionConfigsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigExtendedResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigExtendedResource; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigs; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -28,39 +29,39 @@ public BackupResourceEncryptionConfigsImpl( this.serviceManager = serviceManager; } - public BackupResourceEncryptionConfigResource get(String vaultName, String resourceGroupName) { - BackupResourceEncryptionConfigResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName); + public BackupResourceEncryptionConfigExtendedResource get(String vaultName, String resourceGroupName) { + BackupResourceEncryptionConfigExtendedResourceInner inner = + this.serviceClient().get(vaultName, resourceGroupName); if (inner != null) { - return new BackupResourceEncryptionConfigResourceImpl(inner, this.manager()); + return new BackupResourceEncryptionConfigExtendedResourceImpl(inner, this.manager()); } else { return null; } } - public Response getWithResponse( + public Response getWithResponse( String vaultName, String resourceGroupName, Context context) { - Response inner = + Response inner = this.serviceClient().getWithResponse(vaultName, resourceGroupName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new BackupResourceEncryptionConfigResourceImpl(inner.getValue(), this.manager())); + new BackupResourceEncryptionConfigExtendedResourceImpl(inner.getValue(), this.manager())); } else { return null; } } - public void update( - String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResourceInner parameters) { + public void update(String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResource parameters) { this.serviceClient().update(vaultName, resourceGroupName, parameters); } public Response updateWithResponse( String vaultName, String resourceGroupName, - BackupResourceEncryptionConfigResourceInner parameters, + BackupResourceEncryptionConfigResource parameters, Context context) { return this.serviceClient().updateWithResponse(vaultName, resourceGroupName, parameters, context); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsClientImpl.java similarity index 94% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsClientImpl.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsClientImpl.java index b777db670f478..88088793d7ba4 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsClientImpl.java @@ -25,43 +25,47 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceStorageConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceStorageConfigsNonCrrsClient; import com.azure.resourcemanager.recoveryservicesbackup.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 { - private final ClientLogger logger = new ClientLogger(BackupResourceStorageConfigsClientImpl.class); +/** + * An instance of this class provides access to all the operations defined in BackupResourceStorageConfigsNonCrrsClient. + */ +public final class BackupResourceStorageConfigsNonCrrsClientImpl implements BackupResourceStorageConfigsNonCrrsClient { + private final ClientLogger logger = new ClientLogger(BackupResourceStorageConfigsNonCrrsClientImpl.class); /** The proxy service used to perform REST calls. */ - private final BackupResourceStorageConfigsService service; + private final BackupResourceStorageConfigsNonCrrsService service; /** The service client containing this operation class. */ private final RecoveryServicesBackupClientImpl client; /** - * Initializes an instance of BackupResourceStorageConfigsClientImpl. + * Initializes an instance of BackupResourceStorageConfigsNonCrrsClientImpl. * * @param client the instance of the service client containing this operation class. */ - BackupResourceStorageConfigsClientImpl(RecoveryServicesBackupClientImpl client) { + BackupResourceStorageConfigsNonCrrsClientImpl(RecoveryServicesBackupClientImpl client) { this.service = RestProxy .create( - BackupResourceStorageConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + BackupResourceStorageConfigsNonCrrsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for RecoveryServicesBackupClientBackupResourceStorageConfigs to be used - * by the proxy service to perform REST calls. + * The interface defining all the services for RecoveryServicesBackupClientBackupResourceStorageConfigsNonCrrs to be + * used by the proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "RecoveryServicesBack") - private interface BackupResourceStorageConfigsService { + private interface BackupResourceStorageConfigsNonCrrsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + "/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -76,7 +80,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + "/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -92,7 +96,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + "/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") @ExpectedResponses({204}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -139,7 +143,6 @@ private Mono> getWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2018-12-20"; final String accept = "application/json"; return FluxUtil .withContext( @@ -147,7 +150,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -189,13 +192,12 @@ private Mono> getWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2018-12-20"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -296,7 +298,6 @@ private Mono> updateWithResponseAsyn } else { parameters.validate(); } - final String apiVersion = "2018-12-20"; final String accept = "application/json"; return FluxUtil .withContext( @@ -304,7 +305,7 @@ private Mono> updateWithResponseAsyn service .update( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -353,13 +354,12 @@ private Mono> updateWithResponseAsyn } else { parameters.validate(); } - final String apiVersion = "2018-12-20"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -466,7 +466,6 @@ private Mono> patchWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2018-12-20"; final String accept = "application/json"; return FluxUtil .withContext( @@ -474,7 +473,7 @@ private Mono> patchWithResponseAsync( service .patch( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -523,13 +522,12 @@ private Mono> patchWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2018-12-20"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .patch( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsImpl.java similarity index 88% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsImpl.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsImpl.java index 5ff2bdec8ce19..dfd195905eb1c 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsImpl.java @@ -8,21 +8,21 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceStorageConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceStorageConfigsNonCrrsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceConfigResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceStorageConfigs; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceStorageConfigsNonCrrs; import com.fasterxml.jackson.annotation.JsonIgnore; -public final class BackupResourceStorageConfigsImpl implements BackupResourceStorageConfigs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceStorageConfigsImpl.class); +public final class BackupResourceStorageConfigsNonCrrsImpl implements BackupResourceStorageConfigsNonCrrs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceStorageConfigsNonCrrsImpl.class); - private final BackupResourceStorageConfigsClient innerClient; + private final BackupResourceStorageConfigsNonCrrsClient innerClient; private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - public BackupResourceStorageConfigsImpl( - BackupResourceStorageConfigsClient innerClient, + public BackupResourceStorageConfigsNonCrrsImpl( + BackupResourceStorageConfigsNonCrrsClient innerClient, com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -86,7 +86,7 @@ public Response patchWithResponse( return this.serviceClient().patchWithResponse(vaultName, resourceGroupName, parameters, context); } - private BackupResourceStorageConfigsClient serviceClient() { + private BackupResourceStorageConfigsNonCrrsClient serviceClient() { return this.innerClient; } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsClientImpl.java index 31c00591ce301..5cbd71f9d48a7 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsClientImpl.java @@ -139,7 +139,6 @@ private Mono> getWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -147,7 +146,7 @@ private Mono> getWithResponseAs service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -189,13 +188,12 @@ private Mono> getWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -296,7 +294,6 @@ private Mono> updateWithRespons } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -304,7 +301,7 @@ private Mono> updateWithRespons service .update( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -356,13 +353,12 @@ private Mono> updateWithRespons } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -472,7 +468,6 @@ private Mono> putWithResponseAs } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -480,7 +475,7 @@ private Mono> putWithResponseAs service .put( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -532,13 +527,12 @@ private Mono> putWithResponseAs } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .put( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusClientImpl.java index 84436e2cc1f42..400fb4d1bb4a3 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusClientImpl.java @@ -104,7 +104,6 @@ private Mono> getWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2017-07-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -112,7 +111,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), azureRegion, this.client.getSubscriptionId(), parameters, @@ -155,13 +154,12 @@ private Mono> getWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2017-07-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), azureRegion, this.client.getSubscriptionId(), parameters, diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesClientImpl.java index 47c6ec55d22e5..cbec3d34b2977 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesClientImpl.java @@ -112,7 +112,6 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2017-07-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -120,7 +119,7 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -170,13 +169,12 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2017-07-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesCrrsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesCrrsClientImpl.java deleted file mode 100644 index 60886763722f1..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesCrrsClientImpl.java +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupUsageSummariesCrrsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementUsageList; -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 { - private final ClientLogger logger = new ClientLogger(BackupUsageSummariesCrrsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BackupUsageSummariesCrrsService service; - - /** The service client containing this operation class. */ - private final RecoveryServicesBackupClientImpl client; - - /** - * Initializes an instance of BackupUsageSummariesCrrsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupUsageSummariesCrrsClientImpl(RecoveryServicesBackupClientImpl client) { - this.service = - RestProxy - .create(BackupUsageSummariesCrrsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupClientBackupUsageSummariesCrrs to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "RecoveryServicesBack") - private 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("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String vaultName, String resourceGroupName, String filter, String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - vaultName, - resourceGroupName, - this.client.getSubscriptionId(), - filter, - skipToken, - 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())); - } - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - vaultName, - resourceGroupName, - this.client.getSubscriptionId(), - filter, - skipToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String vaultName, String resourceGroupName, String filter, String skipToken) { - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken)); - } - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken)); - } - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken, context)); - } - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken)); - } - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { - return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken, context)); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesCrrsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesCrrsImpl.java deleted file mode 100644 index 571531cfadce9..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesCrrsImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupUsageSummariesCrrsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementUsage; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupUsageSummariesCrrs; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class BackupUsageSummariesCrrsImpl implements BackupUsageSummariesCrrs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupUsageSummariesCrrsImpl.class); - - private final BackupUsageSummariesCrrsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupUsageSummariesCrrsImpl( - BackupUsageSummariesCrrsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String vaultName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); - return Utils.mapPage(inner, inner1 -> new BackupManagementUsageImpl(inner1, this.manager())); - } - - public PagedIterable list( - String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { - PagedIterable inner = - this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); - return Utils.mapPage(inner, inner1 -> new BackupManagementUsageImpl(inner1, this.manager())); - } - - private BackupUsageSummariesCrrsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java index f1db06b8ccff9..47beceef27c27 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java @@ -137,7 +137,6 @@ private Mono> listSinglePageAsync( if (containerName == null) { return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -145,7 +144,7 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -217,13 +216,12 @@ private Mono> listSinglePageAsync( if (containerName == null) { return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsClientImpl.java index 73abd39bea995..ed69fa38f6d29 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsClientImpl.java @@ -132,7 +132,6 @@ private Mono> triggerWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -140,7 +139,7 @@ private Mono> triggerWithResponseAsync( service .trigger( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -212,13 +211,12 @@ private Mono> triggerWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .trigger( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsClientImpl.java index 8a30b07b0b1c5..a798243451e06 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsClientImpl.java @@ -113,7 +113,6 @@ private Mono> getWithRe if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -121,7 +120,7 @@ private Mono> getWithRe service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -168,13 +167,12 @@ private Mono> getWithRe if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossRegionRestoresClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossRegionRestoresClientImpl.java deleted file mode 100644 index 30aeaa5e3e256..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossRegionRestoresClientImpl.java +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossRegionRestoresClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrossRegionRestoreRequest; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -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 { - private final ClientLogger logger = new ClientLogger(CrossRegionRestoresClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final CrossRegionRestoresService service; - - /** The service client containing this operation class. */ - private final RecoveryServicesBackupClientImpl client; - - /** - * Initializes an instance of CrossRegionRestoresClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CrossRegionRestoresClientImpl(RecoveryServicesBackupClientImpl client) { - this.service = - RestProxy.create(CrossRegionRestoresService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupClientCrossRegionRestores to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "RecoveryServicesBack") - private interface CrossRegionRestoresService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}" - + "/backupCrossRegionRestore") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> trigger( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("azureRegion") String azureRegion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") CrossRegionRestoreRequest parameters, - @HeaderParam("Accept") String accept, - 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> triggerWithResponseAsync( - String azureRegion, CrossRegionRestoreRequest parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (azureRegion == null) { - return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .trigger( - this.client.getEndpoint(), - apiVersion, - azureRegion, - this.client.getSubscriptionId(), - parameters, - accept, - 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. - * @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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> triggerWithResponseAsync( - String azureRegion, CrossRegionRestoreRequest parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (azureRegion == null) { - return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .trigger( - this.client.getEndpoint(), - apiVersion, - azureRegion, - this.client.getSubscriptionId(), - parameters, - accept, - 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginTriggerAsync( - String azureRegion, CrossRegionRestoreRequest parameters) { - Mono>> mono = triggerWithResponseAsync(azureRegion, parameters); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginTriggerAsync( - String azureRegion, CrossRegionRestoreRequest parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = triggerWithResponseAsync(azureRegion, parameters, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginTrigger(String azureRegion, CrossRegionRestoreRequest parameters) { - return beginTriggerAsync(azureRegion, parameters).getSyncPoller(); - } - - /** - * 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginTrigger( - String azureRegion, CrossRegionRestoreRequest parameters, Context context) { - return beginTriggerAsync(azureRegion, parameters, context).getSyncPoller(); - } - - /** - * 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono triggerAsync(String azureRegion, CrossRegionRestoreRequest parameters) { - return beginTriggerAsync(azureRegion, parameters).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono triggerAsync(String azureRegion, CrossRegionRestoreRequest parameters, Context context) { - return beginTriggerAsync(azureRegion, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * 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) { - triggerAsync(azureRegion, parameters).block(); - } - - /** - * 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void trigger(String azureRegion, CrossRegionRestoreRequest parameters, Context context) { - triggerAsync(azureRegion, parameters, context).block(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossRegionRestoresImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossRegionRestoresImpl.java deleted file mode 100644 index fa4303d6e2786..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossRegionRestoresImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossRegionRestoresClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrossRegionRestoreRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrossRegionRestores; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class CrossRegionRestoresImpl implements CrossRegionRestores { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CrossRegionRestoresImpl.class); - - private final CrossRegionRestoresClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public CrossRegionRestoresImpl( - CrossRegionRestoresClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void trigger(String azureRegion, CrossRegionRestoreRequest parameters) { - this.serviceClient().trigger(azureRegion, parameters); - } - - public void trigger(String azureRegion, CrossRegionRestoreRequest parameters, Context context) { - this.serviceClient().trigger(azureRegion, parameters, context); - } - - private CrossRegionRestoresClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationResultsClientImpl.java deleted file mode 100644 index 15fc0fe06906b..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationResultsClientImpl.java +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.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 { - private final ClientLogger logger = new ClientLogger(CrrOperationResultsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final CrrOperationResultsService service; - - /** The service client containing this operation class. */ - private final RecoveryServicesBackupClientImpl client; - - /** - * Initializes an instance of CrrOperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CrrOperationResultsClientImpl(RecoveryServicesBackupClientImpl client) { - this.service = - RestProxy.create(CrrOperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupClientCrrOperationResults to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "RecoveryServicesBack") - private interface CrrOperationResultsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}" - + "/backupCrrOperationResults/{operationId}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") 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); - } - - /** - * @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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String azureRegion, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (azureRegion == null) { - return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - azureRegion, - this.client.getSubscriptionId(), - operationId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * @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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String azureRegion, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (azureRegion == null) { - return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - azureRegion, - this.client.getSubscriptionId(), - operationId, - accept, - context); - } - - /** - * @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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String azureRegion, String operationId) { - return getWithResponseAsync(azureRegion, operationId).flatMap((Response res) -> Mono.empty()); - } - - /** - * @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) { - getAsync(azureRegion, operationId).block(); - } - - /** - * @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 response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String azureRegion, String operationId, Context context) { - return getWithResponseAsync(azureRegion, operationId, context).block(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationResultsImpl.java deleted file mode 100644 index 585cec7b18a4d..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationResultsImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.CrrOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrrOperationResults; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class CrrOperationResultsImpl implements CrrOperationResults { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CrrOperationResultsImpl.class); - - private final CrrOperationResultsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public CrrOperationResultsImpl( - CrrOperationResultsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void get(String azureRegion, String operationId) { - this.serviceClient().get(azureRegion, operationId); - } - - public Response getWithResponse(String azureRegion, String operationId, Context context) { - return this.serviceClient().getWithResponse(azureRegion, operationId, context); - } - - private CrrOperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationStatusClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationStatusClientImpl.java deleted file mode 100644 index a57fdd21ae14e..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationStatusClientImpl.java +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrrOperationStatusClient; -import com.azure.resourcemanager.recoveryservicesbackup.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 { - private final ClientLogger logger = new ClientLogger(CrrOperationStatusClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final CrrOperationStatusService service; - - /** The service client containing this operation class. */ - private final RecoveryServicesBackupClientImpl client; - - /** - * Initializes an instance of CrrOperationStatusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CrrOperationStatusClientImpl(RecoveryServicesBackupClientImpl client) { - this.service = - RestProxy.create(CrrOperationStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupClientCrrOperationStatus to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "RecoveryServicesBack") - private 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("$host") 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); - } - - /** - * @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) - private Mono> getWithResponseAsync(String azureRegion, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (azureRegion == null) { - return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - azureRegion, - this.client.getSubscriptionId(), - operationId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String azureRegion, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (azureRegion == null) { - return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - azureRegion, - this.client.getSubscriptionId(), - operationId, - accept, - context); - } - - /** - * @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) - private Mono getAsync(String azureRegion, String operationId) { - return getWithResponseAsync(azureRegion, operationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * @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 getAsync(azureRegion, operationId).block(); - } - - /** - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String azureRegion, String operationId, Context context) { - return getWithResponseAsync(azureRegion, operationId, context).block(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsClientImpl.java index d25ec78c0d095..b5ea629a1d812 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsClientImpl.java @@ -111,7 +111,6 @@ private Mono> getWithResponseAsyn if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -119,7 +118,7 @@ private Mono> getWithResponseAsyn service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -168,13 +167,12 @@ private Mono> getWithResponseAsyn if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsClientImpl.java index fd362449ff2ca..d897b807b4136 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsClientImpl.java @@ -105,7 +105,6 @@ private Mono> validateWithR } else { parameters.validate(); } - final String apiVersion = "2017-07-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -113,7 +112,7 @@ private Mono> validateWithR service .validate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), azureRegion, this.client.getSubscriptionId(), parameters, @@ -156,13 +155,12 @@ private Mono> validateWithR } else { parameters.validate(); } - final String apiVersion = "2017-07-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .validate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), azureRegion, this.client.getSubscriptionId(), parameters, diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsClientImpl.java index 839c6a266c0af..2d4fe1bca30dd 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsClientImpl.java @@ -164,7 +164,6 @@ private Mono> provisionWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -172,7 +171,7 @@ private Mono> provisionWithResponseAsync( service .provision( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -253,13 +252,12 @@ private Mono> provisionWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .provision( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -433,7 +431,6 @@ private Mono> revokeWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -441,7 +438,7 @@ private Mono> revokeWithResponseAsync( service .revoke( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -513,13 +510,12 @@ private Mono> revokeWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .revoke( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsClientImpl.java index 9b75b70f9ed1b..37e7faf7fa41d 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsClientImpl.java @@ -106,7 +106,6 @@ private Mono> triggerWithResponseAsync(String vaultName, String r if (jobName == null) { return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -114,7 +113,7 @@ private Mono> triggerWithResponseAsync(String vaultName, String r service .trigger( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -162,13 +161,12 @@ private Mono> triggerWithResponseAsync( if (jobName == null) { return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .trigger( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsClientImpl.java index 9c2e77b885549..f56ecf081d90e 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsClientImpl.java @@ -107,7 +107,6 @@ private Mono> getWithResponseAsync( if (jobName == null) { return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -115,7 +114,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -162,13 +161,12 @@ private Mono> getWithResponseAsync( if (jobName == null) { return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsClientImpl.java index 713cca38d69c8..0609070396f07 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsClientImpl.java @@ -111,7 +111,6 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -119,7 +118,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -171,13 +170,12 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsClientImpl.java index 9ed5cf355b5d7..7153e551b8aca 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsClientImpl.java @@ -101,7 +101,6 @@ private Mono> exportWithResponseAsync(String vaultName, String re new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -109,7 +108,7 @@ private Mono> exportWithResponseAsync(String vaultName, String re service .export( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -153,13 +152,12 @@ private Mono> exportWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .export( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobDetailsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationOperationsClientImpl.java similarity index 57% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobDetailsClientImpl.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationOperationsClientImpl.java index 85a79b8a32bce..3c335865159f5 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobDetailsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationOperationsClientImpl.java @@ -23,74 +23,82 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupCrrJobDetailsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrrJobRequest; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequest; 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 { - private final ClientLogger logger = new ClientLogger(BackupCrrJobDetailsClientImpl.class); +/** An instance of this class provides access to all the operations defined in OperationOperationsClient. */ +public final class OperationOperationsClientImpl implements OperationOperationsClient { + private final ClientLogger logger = new ClientLogger(OperationOperationsClientImpl.class); /** The proxy service used to perform REST calls. */ - private final BackupCrrJobDetailsService service; + private final OperationOperationsService service; /** The service client containing this operation class. */ private final RecoveryServicesBackupClientImpl client; /** - * Initializes an instance of BackupCrrJobDetailsClientImpl. + * Initializes an instance of OperationOperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - BackupCrrJobDetailsClientImpl(RecoveryServicesBackupClientImpl client) { + OperationOperationsClientImpl(RecoveryServicesBackupClientImpl client) { this.service = - RestProxy.create(BackupCrrJobDetailsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + RestProxy.create(OperationOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for RecoveryServicesBackupClientBackupCrrJobDetails to be used by the + * The interface defining all the services for RecoveryServicesBackupClientOperationOperations to be used by the * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "RecoveryServicesBack") - private interface BackupCrrJobDetailsService { + private interface OperationOperationsService { @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupValidateOperation") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> validate( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("azureRegion") String azureRegion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") CrrJobRequest parameters, + @BodyParam("application/json") ValidateOperationRequest parameters, @HeaderParam("Accept") String accept, Context context); } /** - * Get CRR job details from target region. + * Validate operation for specified backed up item. This is a synchronous operation. * - * @param azureRegion Azure region to hit Api. - * @param parameters CRR Job request. + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation 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. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String azureRegion, CrrJobRequest parameters) { + private Mono> validateWithResponseAsync( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (azureRegion == null) { - return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -103,16 +111,16 @@ private Mono> getWithResponseAsync(String azureRegion } else { parameters.validate(); } - final String apiVersion = "2018-12-20"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .get( + .validate( this.client.getEndpoint(), - apiVersion, - azureRegion, + this.client.getApiVersion(), + vaultName, + resourceGroupName, this.client.getSubscriptionId(), parameters, accept, @@ -121,27 +129,32 @@ private Mono> getWithResponseAsync(String azureRegion } /** - * Get CRR job details from target region. + * Validate operation for specified backed up item. This is a synchronous operation. * - * @param azureRegion Azure region to hit Api. - * @param parameters CRR Job request. + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation 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. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String azureRegion, CrrJobRequest parameters, Context context) { + private Mono> validateWithResponseAsync( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (azureRegion == null) { - return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -154,14 +167,14 @@ private Mono> getWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2018-12-20"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .get( + .validate( this.client.getEndpoint(), - apiVersion, - azureRegion, + this.client.getApiVersion(), + vaultName, + resourceGroupName, this.client.getSubscriptionId(), parameters, accept, @@ -169,20 +182,22 @@ private Mono> getWithResponseAsync( } /** - * Get CRR job details from target region. + * Validate operation for specified backed up item. This is a synchronous operation. * - * @param azureRegion Azure region to hit Api. - * @param parameters CRR Job request. + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation 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. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String azureRegion, CrrJobRequest parameters) { - return getWithResponseAsync(azureRegion, parameters) + private Mono validateAsync( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { + return validateWithResponseAsync(vaultName, resourceGroupName, parameters) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -192,33 +207,37 @@ private Mono getAsync(String azureRegion, CrrJobRequest parame } /** - * Get CRR job details from target region. + * Validate operation for specified backed up item. This is a synchronous operation. * - * @param azureRegion Azure region to hit Api. - * @param parameters CRR Job request. + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation 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. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JobResourceInner get(String azureRegion, CrrJobRequest parameters) { - return getAsync(azureRegion, parameters).block(); + public ValidateOperationsResponseInner validate( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { + return validateAsync(vaultName, resourceGroupName, parameters).block(); } /** - * Get CRR job details from target region. + * Validate operation for specified backed up item. This is a synchronous operation. * - * @param azureRegion Azure region to hit Api. - * @param parameters CRR Job request. + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation 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. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String azureRegion, CrrJobRequest parameters, Context context) { - return getWithResponseAsync(azureRegion, parameters, context).block(); + public Response validateWithResponse( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context) { + return validateWithResponseAsync(vaultName, resourceGroupName, parameters, context).block(); } } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationStatusImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationOperationsImpl.java similarity index 51% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationStatusImpl.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationOperationsImpl.java index a8bf82153f8a0..9236ff19cfee4 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationStatusImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationOperationsImpl.java @@ -8,49 +8,53 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrrOperationStatusClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrrOperationStatus; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationOperations; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationsResponse; import com.fasterxml.jackson.annotation.JsonIgnore; -public final class CrrOperationStatusImpl implements CrrOperationStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CrrOperationStatusImpl.class); +public final class OperationOperationsImpl implements OperationOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationOperationsImpl.class); - private final CrrOperationStatusClient innerClient; + private final OperationOperationsClient innerClient; private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - public CrrOperationStatusImpl( - CrrOperationStatusClient innerClient, + public OperationOperationsImpl( + OperationOperationsClient innerClient, com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public OperationStatus get(String azureRegion, String operationId) { - OperationStatusInner inner = this.serviceClient().get(azureRegion, operationId); + public ValidateOperationsResponse validate( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { + ValidateOperationsResponseInner inner = this.serviceClient().validate(vaultName, resourceGroupName, parameters); if (inner != null) { - return new OperationStatusImpl(inner, this.manager()); + return new ValidateOperationsResponseImpl(inner, this.manager()); } else { return null; } } - public Response getWithResponse(String azureRegion, String operationId, Context context) { - Response inner = this.serviceClient().getWithResponse(azureRegion, operationId, context); + public Response validateWithResponse( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context) { + Response inner = + this.serviceClient().validateWithResponse(vaultName, resourceGroupName, parameters, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusImpl(inner.getValue(), this.manager())); + new ValidateOperationsResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - private CrrOperationStatusClient serviceClient() { + private OperationOperationsClient serviceClient() { return this.innerClient; } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java index 5d57267552175..c8a5d507506de 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.recoveryservicesbackup.implementation; -import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.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.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; @@ -24,8 +27,8 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequest; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryResponse; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationsClient. */ @@ -57,189 +60,211 @@ public final class OperationsClientImpl implements OperationsClient { @ServiceInterface(name = "RecoveryServicesBack") private interface OperationsService { @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" - + "/vaults/{vaultName}/backupValidateOperation") + @Get("/providers/Microsoft.RecoveryServices/operations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validate( + Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ValidateOperationRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Validate operation for specified backed up item. This is a synchronous operation. + * Returns the list of available operations. * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param parameters resource validate operation 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 response. + * @return operations List response which contains list of available APIs. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync( - String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .validate( - this.client.getEndpoint(), - apiVersion, - vaultName, - resourceGroupName, - this.client.getSubscriptionId(), - parameters, - accept, - context)) + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Validate operation for specified backed up item. This is a synchronous operation. + * Returns the list of available operations. * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param parameters resource validate operation 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 response. + * @return operations List response which contains list of available APIs. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync( - String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .validate( - this.client.getEndpoint(), - apiVersion, - vaultName, - resourceGroupName, - this.client.getSubscriptionId(), - parameters, - accept, - context); + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Validate operation for specified backed up item. This is a synchronous operation. + * Returns the list of available operations. * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param parameters resource validate operation request. + * @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 operations List response which contains list of available APIs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns the list of available operations. + * + * @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. + * @return operations List response which contains list of available APIs. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAsync( - String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { - return validateWithResponseAsync(vaultName, resourceGroupName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Validate operation for specified backed up item. This is a synchronous operation. + * Returns the list of available operations. * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param parameters resource validate operation request. + * @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 operations List response which contains list of available APIs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Returns the list of available operations. + * + * @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. + * @return operations List response which contains list of available APIs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink 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 operations List response which contains list of available APIs. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ValidateOperationsResponseInner validate( - String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { - return validateAsync(vaultName, resourceGroupName, parameters).block(); + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Validate operation for specified backed up item. This is a synchronous operation. + * Get the next page of items. * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param parameters resource validate operation request. + * @param nextLink The nextLink 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 response. + * @return operations List response which contains list of available APIs. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateWithResponse( - String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context) { - return validateWithResponseAsync(vaultName, resourceGroupName, parameters, context).block(); + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsImpl.java index 26b4097213b5e..52ce425f547ef 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsImpl.java @@ -4,15 +4,13 @@ package com.azure.resourcemanager.recoveryservicesbackup.implementation; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryValueForSingleApi; import com.azure.resourcemanager.recoveryservicesbackup.models.Operations; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationsResponse; import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { @@ -29,29 +27,14 @@ public OperationsImpl( this.serviceManager = serviceManager; } - public ValidateOperationsResponse validate( - String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { - ValidateOperationsResponseInner inner = this.serviceClient().validate(vaultName, resourceGroupName, parameters); - if (inner != null) { - return new ValidateOperationsResponseImpl(inner, this.manager()); - } else { - return null; - } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ClientDiscoveryValueForSingleApiImpl(inner1, this.manager())); } - public Response validateWithResponse( - String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context) { - Response inner = - this.serviceClient().validateWithResponse(vaultName, resourceGroupName, parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ValidateOperationsResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ClientDiscoveryValueForSingleApiImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsOperationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsOperationsClientImpl.java deleted file mode 100644 index af4e5b0de8ffd..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsOperationsClientImpl.java +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsOperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryResponse; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsOperationsClient. */ -public final class OperationsOperationsClientImpl implements OperationsOperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsOperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OperationsOperationsService service; - - /** The service client containing this operation class. */ - private final RecoveryServicesBackupClientImpl client; - - /** - * Initializes an instance of OperationsOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsOperationsClientImpl(RecoveryServicesBackupClientImpl client) { - this.service = - RestProxy - .create(OperationsOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupClientOperationsOperations to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "RecoveryServicesBack") - private interface OperationsOperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.RecoveryServices/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Returns the list of available operations. - * - * @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 operations List response which contains list of available APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2016-08-10"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the list of available operations. - * - * @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 operations List response which contains list of available APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2016-08-10"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns the list of available operations. - * - * @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 operations List response which contains list of available APIs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns the list of available operations. - * - * @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 operations List response which contains list of available APIs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns the list of available operations. - * - * @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 operations List response which contains list of available APIs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Returns the list of available operations. - * - * @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 operations List response which contains list of available APIs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink 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 operations List response which contains list of available APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink 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 operations List response which contains list of available APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsOperationsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsOperationsImpl.java deleted file mode 100644 index f47b287a17cbc..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsOperationsImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsOperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryValueForSingleApi; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationsOperations; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class OperationsOperationsImpl implements OperationsOperations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsOperationsImpl.class); - - private final OperationsOperationsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public OperationsOperationsImpl( - OperationsOperationsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ClientDiscoveryValueForSingleApiImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ClientDiscoveryValueForSingleApiImpl(inner1, this.manager())); - } - - private OperationsOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsClientImpl.java index 47b54106822be..2c309c94af8f3 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsClientImpl.java @@ -153,7 +153,6 @@ private Mono> getWithResponseAs new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -161,7 +160,7 @@ private Mono> getWithResponseAs service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -211,13 +210,12 @@ private Mono> getWithResponseAs new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -334,7 +332,6 @@ private Mono>> putWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -342,7 +339,7 @@ private Mono>> putWithResponseAsync( service .put( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -403,13 +400,12 @@ private Mono>> putWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .put( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -431,7 +427,7 @@ private Mono>> putWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private Endpoint Connection Response Properties. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionResourceInner> beginPutAsync( String vaultName, @@ -463,7 +459,7 @@ private Mono>> putWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private Endpoint Connection Response Properties. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionResourceInner> beginPutAsync( String vaultName, @@ -496,7 +492,7 @@ private Mono>> putWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private Endpoint Connection Response Properties. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionResourceInner> beginPut( String vaultName, @@ -519,7 +515,7 @@ private Mono>> putWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private Endpoint Connection Response Properties. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionResourceInner> beginPut( String vaultName, @@ -662,7 +658,6 @@ private Mono>> deleteWithResponseAsync( new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -670,7 +665,7 @@ private Mono>> deleteWithResponseAsync( service .delete( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -720,13 +715,12 @@ private Mono>> deleteWithResponseAsync( new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -746,7 +740,7 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String vaultName, String resourceGroupName, String privateEndpointConnectionName) { Mono>> mono = @@ -768,7 +762,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context) { context = this.client.mergeContext(context); @@ -790,7 +784,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String vaultName, String resourceGroupName, String privateEndpointConnectionName) { return beginDeleteAsync(vaultName, resourceGroupName, privateEndpointConnectionName).getSyncPoller(); @@ -808,7 +802,7 @@ public SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context) { return beginDeleteAsync(vaultName, resourceGroupName, privateEndpointConnectionName, context).getSyncPoller(); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsClientImpl.java index d7264242d9c0d..53dcbf1264ae5 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsClientImpl.java @@ -116,7 +116,6 @@ private Mono> getOperationStatusWithResponseAsync if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -124,7 +123,7 @@ private Mono> getOperationStatusWithResponseAsync service .getOperationStatus( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -183,13 +182,12 @@ private Mono> getOperationStatusWithResponseAsync if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .getOperationStatus( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java index 589c59d023273..bc4823b96b0d6 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java @@ -125,7 +125,6 @@ private Mono> listSinglePageAsy if (fabricName == null) { return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -133,7 +132,7 @@ private Mono> listSinglePageAsy service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -191,13 +190,12 @@ private Mono> listSinglePageAsy if (fabricName == null) { return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsClientImpl.java index 2686b088d7e5c..8240608c00809 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsClientImpl.java @@ -133,7 +133,6 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -141,7 +140,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -210,13 +209,12 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesClientImpl.java index b4d8a6b31d640..b36503a38764e 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesClientImpl.java @@ -135,7 +135,6 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -143,7 +142,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -214,13 +213,12 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsClientImpl.java index a12a3bed50bfc..7f808d5710df5 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsClientImpl.java @@ -169,7 +169,6 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -177,7 +176,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -244,13 +243,12 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -433,7 +431,6 @@ private Mono> createOrUpdateWithResponseAsy } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -441,7 +438,7 @@ private Mono> createOrUpdateWithResponseAsy service .createOrUpdate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -513,13 +510,12 @@ private Mono> createOrUpdateWithResponseAsy } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -670,7 +666,6 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -678,7 +673,7 @@ private Mono> deleteWithResponseAsync( service .delete( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -742,13 +737,12 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsImpl.java index 4adf30622a85f..338d0ba504771 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsImpl.java @@ -217,8 +217,7 @@ public void deleteById(String id) { } this .deleteWithResponse( - vaultName, resourceGroupName, fabricName, containerName, protectedItemName, Context.NONE) - .getValue(); + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsClientImpl.java index e304ccaecbbc8..82fee7672b7ed 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsClientImpl.java @@ -124,7 +124,6 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -132,7 +131,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -194,13 +193,12 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsClientImpl.java index 8aa1a8d8b9b5b..8eaf842613c86 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsClientImpl.java @@ -120,7 +120,6 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -128,7 +127,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -180,13 +179,12 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersClientImpl.java index 6ccb751eecfc2..037d1f5bfc809 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersClientImpl.java @@ -187,7 +187,6 @@ private Mono> getWithResponseAsync( if (containerName == null) { return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -195,7 +194,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -247,13 +246,12 @@ private Mono> getWithResponseAsync( if (containerName == null) { return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -377,7 +375,6 @@ private Mono> registerWithResponseAsy } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -385,7 +382,7 @@ private Mono> registerWithResponseAsy service .register( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -450,13 +447,12 @@ private Mono> registerWithResponseAsy } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .register( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -592,7 +588,6 @@ private Mono> unregisterWithResponseAsync( if (containerName == null) { return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -600,7 +595,7 @@ private Mono> unregisterWithResponseAsync( service .unregister( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -654,13 +649,12 @@ private Mono> unregisterWithResponseAsync( if (containerName == null) { return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .unregister( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -771,7 +765,6 @@ private Mono> inquireWithResponseAsync( if (containerName == null) { return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -779,7 +772,7 @@ private Mono> inquireWithResponseAsync( service .inquire( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -838,13 +831,12 @@ private Mono> inquireWithResponseAsync( if (containerName == null) { return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .inquire( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -976,7 +968,6 @@ private Mono> refreshWithResponseAsync( if (fabricName == null) { return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -984,7 +975,7 @@ private Mono> refreshWithResponseAsync( service .refresh( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -1034,13 +1025,12 @@ private Mono> refreshWithResponseAsync( if (fabricName == null) { return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .refresh( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsClientImpl.java index 8f89a284b4e2c..3935423b9e858 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsClientImpl.java @@ -161,7 +161,6 @@ private Mono> validateWithRespons } else { parameters.validate(); } - final String apiVersion = "2017-07-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -169,7 +168,7 @@ private Mono> validateWithRespons service .validate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), azureRegion, this.client.getSubscriptionId(), parameters, @@ -213,13 +212,12 @@ private Mono> validateWithRespons } else { parameters.validate(); } - final String apiVersion = "2017-07-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .validate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), azureRegion, this.client.getSubscriptionId(), parameters, @@ -329,7 +327,6 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter intentObjectName is required and cannot be null.")); } - final String apiVersion = "2017-07-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -337,7 +334,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -391,13 +388,12 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter intentObjectName is required and cannot be null.")); } - final String apiVersion = "2017-07-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -524,7 +520,6 @@ private Mono> createOrUpdateWithResponse } else { parameters.validate(); } - final String apiVersion = "2017-07-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -532,7 +527,7 @@ private Mono> createOrUpdateWithResponse service .createOrUpdate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -597,13 +592,12 @@ private Mono> createOrUpdateWithResponse } else { parameters.validate(); } - final String apiVersion = "2017-07-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -736,14 +730,13 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter intentObjectName is required and cannot be null.")); } - final String apiVersion = "2017-07-01"; return FluxUtil .withContext( context -> service .delete( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -795,12 +788,11 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter intentObjectName is required and cannot be null.")); } - final String apiVersion = "2017-07-01"; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsImpl.java index ba84db430dedf..7f63688df9c1e 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsImpl.java @@ -199,7 +199,7 @@ public void deleteById(String id) { "The resource ID '%s' is not valid. Missing path segment 'backupProtectionIntent'.", id))); } - this.deleteWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, Context.NONE).getValue(); + this.deleteWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesClientImpl.java index d5dea5bfdaa25..26ccb905c60ac 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesClientImpl.java @@ -149,7 +149,6 @@ private Mono> getWithResponseAsync( if (policyName == null) { return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -157,7 +156,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -205,13 +204,12 @@ private Mono> getWithResponseAsync( if (policyName == null) { return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -325,7 +323,6 @@ private Mono> createOrUpdateWithResponse } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -333,7 +330,7 @@ private Mono> createOrUpdateWithResponse service .createOrUpdate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -392,13 +389,12 @@ private Mono> createOrUpdateWithResponse } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -515,7 +511,6 @@ private Mono>> deleteWithResponseAsync( if (policyName == null) { return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -523,7 +518,7 @@ private Mono>> deleteWithResponseAsync( service .delete( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -571,13 +566,12 @@ private Mono>> deleteWithResponseAsync( if (policyName == null) { return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -598,7 +592,7 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String vaultName, String resourceGroupName, String policyName) { Mono>> mono = deleteWithResponseAsync(vaultName, resourceGroupName, policyName); @@ -620,7 +614,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String vaultName, String resourceGroupName, String policyName, Context context) { context = this.client.mergeContext(context); @@ -643,7 +637,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String vaultName, String resourceGroupName, String policyName) { return beginDeleteAsync(vaultName, resourceGroupName, policyName).getSyncPoller(); @@ -662,7 +656,7 @@ public SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String vaultName, String resourceGroupName, String policyName, Context context) { return beginDeleteAsync(vaultName, resourceGroupName, policyName, context).getSyncPoller(); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsClientImpl.java index d72672781cce7..3f3293fbfc2d9 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsClientImpl.java @@ -118,7 +118,6 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -126,7 +125,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -178,13 +177,12 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesClientImpl.java index 8449442d27241..d17825da682ab 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesClientImpl.java @@ -120,7 +120,6 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -128,7 +127,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -182,13 +181,12 @@ private Mono> getWithResponseAsync( if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java index 39f621bd1522b..03e0ba23439c3 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.recoveryservicesbackup.implementation; -import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; @@ -12,7 +11,6 @@ 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; @@ -29,8 +27,6 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrrAccessTokenResourceInner; import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResourceList; import reactor.core.publisher.Mono; @@ -103,27 +99,6 @@ Mono> get( @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" - + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" - + "/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken") - @ExpectedResponses({200, 400}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAccessToken( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("fabricName") String fabricName, - @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, - @PathParam("recoveryPointId") String recoveryPointId, - @BodyParam("application/json") AadPropertiesResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -186,7 +161,6 @@ private Mono> listSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -194,7 +168,7 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -269,13 +243,12 @@ private Mono> listSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -483,7 +456,6 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -491,7 +463,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -562,13 +534,12 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -672,276 +643,6 @@ public Response getWithResponse( .block(); } - /** - * Returns the Access token for communication between BMS and Protection service. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAccessTokenWithResponseAsync( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String recoveryPointId, - AadPropertiesResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (protectedItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); - } - if (recoveryPointId == null) { - return Mono - .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAccessToken( - this.client.getEndpoint(), - apiVersion, - vaultName, - resourceGroupName, - this.client.getSubscriptionId(), - fabricName, - containerName, - protectedItemName, - recoveryPointId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the Access token for communication between BMS and Protection service. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAccessTokenWithResponseAsync( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String recoveryPointId, - AadPropertiesResourceInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (protectedItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); - } - if (recoveryPointId == null) { - return Mono - .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAccessToken( - this.client.getEndpoint(), - apiVersion, - vaultName, - resourceGroupName, - this.client.getSubscriptionId(), - fabricName, - containerName, - protectedItemName, - recoveryPointId, - parameters, - accept, - context); - } - - /** - * Returns the Access token for communication between BMS and Protection service. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAccessTokenAsync( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String recoveryPointId, - AadPropertiesResourceInner parameters) { - return getAccessTokenWithResponseAsync( - vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns the Access token for communication between BMS and Protection service. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CrrAccessTokenResourceInner getAccessToken( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String recoveryPointId, - AadPropertiesResourceInner parameters) { - return getAccessTokenAsync( - vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters) - .block(); - } - - /** - * Returns the Access token for communication between BMS and Protection service. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAccessTokenWithResponse( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String recoveryPointId, - AadPropertiesResourceInner parameters, - Context context) { - return getAccessTokenWithResponseAsync( - vaultName, - resourceGroupName, - fabricName, - containerName, - protectedItemName, - recoveryPointId, - parameters, - context) - .block(); - } - /** * Get the next page of items. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsCrrsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsCrrsClientImpl.java deleted file mode 100644 index a7a49edfe2c4c..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsCrrsClientImpl.java +++ /dev/null @@ -1,455 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsCrrsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.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 { - private final ClientLogger logger = new ClientLogger(RecoveryPointsCrrsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final RecoveryPointsCrrsService service; - - /** The service client containing this operation class. */ - private final RecoveryServicesBackupClientImpl client; - - /** - * Initializes an instance of RecoveryPointsCrrsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RecoveryPointsCrrsClientImpl(RecoveryServicesBackupClientImpl client) { - this.service = - RestProxy.create(RecoveryPointsCrrsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupClientRecoveryPointsCrrs to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "RecoveryServicesBack") - private interface RecoveryPointsCrrsService { - @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("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @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("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name associated with the backed up item. - * @param containerName Container name associated with the backed up item. - * @param protectedItemName Backed up item whose backup copies are to be fetched. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (protectedItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - vaultName, - resourceGroupName, - this.client.getSubscriptionId(), - fabricName, - containerName, - protectedItemName, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name associated with the backed up item. - * @param containerName Container name associated with the backed up item. - * @param protectedItemName Backed up item whose backup copies are to be fetched. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (protectedItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); - } - final String apiVersion = "2018-12-20"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - vaultName, - resourceGroupName, - this.client.getSubscriptionId(), - fabricName, - containerName, - protectedItemName, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name associated with the backed up item. - * @param containerName Container name associated with the backed up item. - * @param protectedItemName Backed up item whose backup copies are to be fetched. - * @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. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String filter) { - return new PagedFlux<>( - () -> - listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name associated with the backed up item. - * @param containerName Container name associated with the backed up item. - * @param protectedItemName Backed up item whose backup copies are to be fetched. - * @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. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { - final String filter = null; - return new PagedFlux<>( - () -> - listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name associated with the backed up item. - * @param containerName Container name associated with the backed up item. - * @param protectedItemName Backed up item whose backup copies are to be fetched. - * @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. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String filter, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name associated with the backed up item. - * @param containerName Container name associated with the backed up item. - * @param protectedItemName Backed up item whose backup copies are to be fetched. - * @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. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { - final String filter = null; - return new PagedIterable<>( - listAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter)); - } - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name associated with the backed up item. - * @param containerName Container name associated with the backed up item. - * @param protectedItemName Backed up item whose backup copies are to be fetched. - * @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. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String filter, - Context context) { - return new PagedIterable<>( - listAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink 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 list of RecoveryPoint resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink 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 list of RecoveryPoint resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsCrrsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsCrrsImpl.java deleted file mode 100644 index 84d65594d0265..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsCrrsImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsCrrsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointsCrrs; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class RecoveryPointsCrrsImpl implements RecoveryPointsCrrs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointsCrrsImpl.class); - - private final RecoveryPointsCrrsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public RecoveryPointsCrrsImpl( - RecoveryPointsCrrsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list( - String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { - PagedIterable inner = - this.serviceClient().list(vaultName, resourceGroupName, fabricName, containerName, protectedItemName); - return Utils.mapPage(inner, inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); - } - - public PagedIterable list( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String filter, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, context); - return Utils.mapPage(inner, inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); - } - - private RecoveryPointsCrrsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java index b336d3e30642e..220d008aa51bd 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java @@ -10,10 +10,7 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrrAccessTokenResourceInner; import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrrAccessTokenResource; import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResource; import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPoints; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -102,64 +99,6 @@ public Response getWithResponse( } } - public CrrAccessTokenResource getAccessToken( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String recoveryPointId, - AadPropertiesResourceInner parameters) { - CrrAccessTokenResourceInner inner = - this - .serviceClient() - .getAccessToken( - vaultName, - resourceGroupName, - fabricName, - containerName, - protectedItemName, - recoveryPointId, - parameters); - if (inner != null) { - return new CrrAccessTokenResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getAccessTokenWithResponse( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String recoveryPointId, - AadPropertiesResourceInner parameters, - Context context) { - Response inner = - this - .serviceClient() - .getAccessTokenWithResponse( - vaultName, - resourceGroupName, - fabricName, - containerName, - protectedItemName, - recoveryPointId, - parameters, - context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CrrAccessTokenResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - private RecoveryPointsClient serviceClient() { return this.innerClient; } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java index 8786f7152bb9e..d71517ee5769a 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java @@ -155,7 +155,6 @@ private Mono> listSinglePageAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -163,7 +162,7 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -243,13 +242,12 @@ private Mono> listSinglePageAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupClientImpl.java index f8ad2d541c332..9fc649622a23a 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupClientImpl.java @@ -21,9 +21,6 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.AadPropertiesOperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupCrrJobDetailsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupCrrJobsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupEnginesClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupJobsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupOperationResultsClient; @@ -31,21 +28,16 @@ import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupPoliciesClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectableItemsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsCrrsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionContainersClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionIntentsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceEncryptionConfigsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceStorageConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceStorageConfigsNonCrrsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceVaultConfigsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupStatusClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupUsageSummariesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupUsageSummariesCrrsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupWorkloadItemsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BmsPrepareDataMoveOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossRegionRestoresClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrrOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrrOperationStatusClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ExportJobsOperationResultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.FeatureSupportsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ItemLevelRecoveryConnectionsClient; @@ -53,8 +45,8 @@ import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobDetailsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobOperationResultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationOperationsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsOperationsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.PrivateEndpointsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectableContainersClient; @@ -69,9 +61,10 @@ import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPolicyOperationResultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPolicyOperationStatusesClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsCrrsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsRecommendedForMovesClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryServicesBackupClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceGuardProxiesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceGuardProxyOperationsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceProvidersClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.RestoresClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.SecurityPINsClient; @@ -114,6 +107,18 @@ public String getEndpoint() { return this.endpoint; } + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** The HTTP pipeline to send requests through. */ private final HttpPipeline httpPipeline; @@ -150,6 +155,90 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** The BackupResourceStorageConfigsNonCrrsClient object to access its operations. */ + private final BackupResourceStorageConfigsNonCrrsClient backupResourceStorageConfigsNonCrrs; + + /** + * Gets the BackupResourceStorageConfigsNonCrrsClient object to access its operations. + * + * @return the BackupResourceStorageConfigsNonCrrsClient object. + */ + public BackupResourceStorageConfigsNonCrrsClient getBackupResourceStorageConfigsNonCrrs() { + return this.backupResourceStorageConfigsNonCrrs; + } + + /** The ProtectionIntentsClient object to access its operations. */ + private final ProtectionIntentsClient protectionIntents; + + /** + * Gets the ProtectionIntentsClient object to access its operations. + * + * @return the ProtectionIntentsClient object. + */ + public ProtectionIntentsClient getProtectionIntents() { + return this.protectionIntents; + } + + /** The BackupStatusClient object to access its operations. */ + private final BackupStatusClient backupStatus; + + /** + * Gets the BackupStatusClient object to access its operations. + * + * @return the BackupStatusClient object. + */ + public BackupStatusClient getBackupStatus() { + return this.backupStatus; + } + + /** The FeatureSupportsClient object to access its operations. */ + private final FeatureSupportsClient featureSupports; + + /** + * Gets the FeatureSupportsClient object to access its operations. + * + * @return the FeatureSupportsClient object. + */ + public FeatureSupportsClient getFeatureSupports() { + return this.featureSupports; + } + + /** The BackupProtectionIntentsClient object to access its operations. */ + private final BackupProtectionIntentsClient backupProtectionIntents; + + /** + * Gets the BackupProtectionIntentsClient object to access its operations. + * + * @return the BackupProtectionIntentsClient object. + */ + public BackupProtectionIntentsClient getBackupProtectionIntents() { + return this.backupProtectionIntents; + } + + /** The BackupUsageSummariesClient object to access its operations. */ + private final BackupUsageSummariesClient backupUsageSummaries; + + /** + * Gets the BackupUsageSummariesClient object to access its operations. + * + * @return the BackupUsageSummariesClient object. + */ + public BackupUsageSummariesClient getBackupUsageSummaries() { + return this.backupUsageSummaries; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + /** The BackupResourceVaultConfigsClient object to access its operations. */ private final BackupResourceVaultConfigsClient backupResourceVaultConfigs; @@ -390,16 +479,16 @@ public BackupProtectedItemsClient getBackupProtectedItems() { return this.backupProtectedItems; } - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; + /** The OperationOperationsClient object to access its operations. */ + private final OperationOperationsClient operationOperations; /** - * Gets the OperationsClient object to access its operations. + * Gets the OperationOperationsClient object to access its operations. * - * @return the OperationsClient object. + * @return the OperationOperationsClient object. */ - public OperationsClient getOperations() { - return this.operations; + public OperationOperationsClient getOperationOperations() { + return this.operationOperations; } /** The BackupEnginesClient object to access its operations. */ @@ -594,196 +683,28 @@ public RecoveryPointsRecommendedForMovesClient getRecoveryPointsRecommendedForMo return this.recoveryPointsRecommendedForMoves; } - /** 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; + /** The ResourceGuardProxiesClient object to access its operations. */ + private final ResourceGuardProxiesClient resourceGuardProxies; /** - * Gets the BackupCrrJobDetailsClient object to access its operations. + * Gets the ResourceGuardProxiesClient object to access its operations. * - * @return the BackupCrrJobDetailsClient object. + * @return the ResourceGuardProxiesClient object. */ - public BackupCrrJobDetailsClient getBackupCrrJobDetails() { - return this.backupCrrJobDetails; + public ResourceGuardProxiesClient getResourceGuardProxies() { + return this.resourceGuardProxies; } - /** The BackupCrrJobsClient object to access its operations. */ - private final BackupCrrJobsClient backupCrrJobs; + /** The ResourceGuardProxyOperationsClient object to access its operations. */ + private final ResourceGuardProxyOperationsClient resourceGuardProxyOperations; /** - * Gets the BackupCrrJobsClient object to access its operations. + * Gets the ResourceGuardProxyOperationsClient object to access its operations. * - * @return the BackupCrrJobsClient object. + * @return the ResourceGuardProxyOperationsClient 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 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 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; - } - - /** The ProtectionIntentsClient object to access its operations. */ - private final ProtectionIntentsClient protectionIntents; - - /** - * Gets the ProtectionIntentsClient object to access its operations. - * - * @return the ProtectionIntentsClient object. - */ - public ProtectionIntentsClient getProtectionIntents() { - return this.protectionIntents; - } - - /** The BackupStatusClient object to access its operations. */ - private final BackupStatusClient backupStatus; - - /** - * Gets the BackupStatusClient object to access its operations. - * - * @return the BackupStatusClient object. - */ - public BackupStatusClient getBackupStatus() { - return this.backupStatus; - } - - /** The FeatureSupportsClient object to access its operations. */ - private final FeatureSupportsClient featureSupports; - - /** - * Gets the FeatureSupportsClient object to access its operations. - * - * @return the FeatureSupportsClient object. - */ - public FeatureSupportsClient getFeatureSupports() { - return this.featureSupports; - } - - /** The BackupProtectionIntentsClient object to access its operations. */ - private final BackupProtectionIntentsClient backupProtectionIntents; - - /** - * Gets the BackupProtectionIntentsClient object to access its operations. - * - * @return the BackupProtectionIntentsClient object. - */ - public BackupProtectionIntentsClient getBackupProtectionIntents() { - return this.backupProtectionIntents; - } - - /** The BackupUsageSummariesClient object to access its operations. */ - private final BackupUsageSummariesClient backupUsageSummaries; - - /** - * Gets the BackupUsageSummariesClient object to access its operations. - * - * @return the BackupUsageSummariesClient object. - */ - public BackupUsageSummariesClient getBackupUsageSummaries() { - return this.backupUsageSummaries; - } - - /** The OperationsOperationsClient object to access its operations. */ - private final OperationsOperationsClient operationsOperations; - - /** - * Gets the OperationsOperationsClient object to access its operations. - * - * @return the OperationsOperationsClient object. - */ - public OperationsOperationsClient getOperationsOperations() { - return this.operationsOperations; + public ResourceGuardProxyOperationsClient getResourceGuardProxyOperations() { + return this.resourceGuardProxyOperations; } /** @@ -808,6 +729,14 @@ public OperationsOperationsClient getOperationsOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = "2021-08-01"; + this.backupResourceStorageConfigsNonCrrs = new BackupResourceStorageConfigsNonCrrsClientImpl(this); + this.protectionIntents = new ProtectionIntentsClientImpl(this); + this.backupStatus = new BackupStatusClientImpl(this); + this.featureSupports = new FeatureSupportsClientImpl(this); + this.backupProtectionIntents = new BackupProtectionIntentsClientImpl(this); + this.backupUsageSummaries = new BackupUsageSummariesClientImpl(this); + this.operations = new OperationsClientImpl(this); this.backupResourceVaultConfigs = new BackupResourceVaultConfigsClientImpl(this); this.backupResourceEncryptionConfigs = new BackupResourceEncryptionConfigsClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); @@ -828,7 +757,7 @@ public OperationsOperationsClient getOperationsOperations() { this.exportJobsOperationResults = new ExportJobsOperationResultsClientImpl(this); this.jobs = new JobsClientImpl(this); this.backupProtectedItems = new BackupProtectedItemsClientImpl(this); - this.operations = new OperationsClientImpl(this); + this.operationOperations = new OperationOperationsClientImpl(this); this.backupEngines = new BackupEnginesClientImpl(this); this.protectionContainerRefreshOperationResults = new ProtectionContainerRefreshOperationResultsClientImpl(this); @@ -846,22 +775,8 @@ public OperationsOperationsClient getOperationsOperations() { this.backupProtectionContainers = new BackupProtectionContainersClientImpl(this); this.securityPINs = new SecurityPINsClientImpl(this); this.recoveryPointsRecommendedForMoves = new RecoveryPointsRecommendedForMovesClientImpl(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.backupResourceStorageConfigs = new BackupResourceStorageConfigsClientImpl(this); - this.recoveryPointsCrrs = new RecoveryPointsCrrsClientImpl(this); - this.backupProtectedItemsCrrs = new BackupProtectedItemsCrrsClientImpl(this); - this.protectionIntents = new ProtectionIntentsClientImpl(this); - this.backupStatus = new BackupStatusClientImpl(this); - this.featureSupports = new FeatureSupportsClientImpl(this); - this.backupProtectionIntents = new BackupProtectionIntentsClientImpl(this); - this.backupUsageSummaries = new BackupUsageSummariesClientImpl(this); - this.operationsOperations = new OperationsOperationsClientImpl(this); + this.resourceGuardProxies = new ResourceGuardProxiesClientImpl(this); + this.resourceGuardProxyOperations = new ResourceGuardProxyOperationsClientImpl(this); } /** diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsCrrsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxiesClientImpl.java similarity index 67% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsCrrsClientImpl.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxiesClientImpl.java index 2e5c2bf1c1921..e19fda331f420 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsCrrsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxiesClientImpl.java @@ -26,54 +26,52 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsCrrsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResourceList; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceGuardProxiesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyBaseResourceList; 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 { - private final ClientLogger logger = new ClientLogger(BackupProtectedItemsCrrsClientImpl.class); +/** An instance of this class provides access to all the operations defined in ResourceGuardProxiesClient. */ +public final class ResourceGuardProxiesClientImpl implements ResourceGuardProxiesClient { + private final ClientLogger logger = new ClientLogger(ResourceGuardProxiesClientImpl.class); /** The proxy service used to perform REST calls. */ - private final BackupProtectedItemsCrrsService service; + private final ResourceGuardProxiesService service; /** The service client containing this operation class. */ private final RecoveryServicesBackupClientImpl client; /** - * Initializes an instance of BackupProtectedItemsCrrsClientImpl. + * Initializes an instance of ResourceGuardProxiesClientImpl. * * @param client the instance of the service client containing this operation class. */ - BackupProtectedItemsCrrsClientImpl(RecoveryServicesBackupClientImpl client) { + ResourceGuardProxiesClientImpl(RecoveryServicesBackupClientImpl client) { this.service = RestProxy - .create(BackupProtectedItemsCrrsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + .create(ResourceGuardProxiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for RecoveryServicesBackupClientBackupProtectedItemsCrrs to be used by - * the proxy service to perform REST calls. + * The interface defining all the services for RecoveryServicesBackupClientResourceGuardProxies to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "RecoveryServicesBack") - private interface BackupProtectedItemsCrrsService { + private interface ResourceGuardProxiesService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" - + "/vaults/{vaultName}/backupProtectedItems/") + + "/vaults/{vaultName}/backupResourceGuardProxies") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); @@ -81,7 +79,7 @@ Mono> list( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> getNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -89,20 +87,18 @@ Mono> listNext( } /** - * Provides a pageable list of all items that are backed up within a vault. + * List the ResourceGuardProxies under vault. * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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. + * @return list of ResourceGuardProxyBase resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String vaultName, String resourceGroupName, String filter, String skipToken) { + private Mono> getSinglePageAsync( + String vaultName, String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -122,23 +118,20 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2018-12-20"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( + .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), - filter, - skipToken, accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -151,21 +144,19 @@ private Mono> listSinglePageAsync( } /** - * Provides a pageable list of all items that are backed up within a vault. + * List the ResourceGuardProxies under vault. * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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. + * @return list of ResourceGuardProxyBase resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + private Mono> getSinglePageAsync( + String vaultName, String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -185,18 +176,15 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2018-12-20"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( + .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), - filter, - skipToken, accept, context) .map( @@ -211,99 +199,70 @@ private Mono> listSinglePageAsync( } /** - * Provides a pageable list of all items that are backed up within a vault. + * List the ResourceGuardProxies under vault. * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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. + * @return list of ResourceGuardProxyBase resources. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String vaultName, String resourceGroupName, String filter, String skipToken) { + private PagedFlux getAsync(String vaultName, String resourceGroupName) { return new PagedFlux<>( - () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); + () -> getSinglePageAsync(vaultName, resourceGroupName), nextLink -> getNextSinglePageAsync(nextLink)); } /** - * Provides a pageable list of all items that are backed up within a vault. + * List the ResourceGuardProxies under vault. * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedFlux<>( - () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Provides a pageable list of all items that are backed up within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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. + * @return list of ResourceGuardProxyBase resources. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + private PagedFlux getAsync( + String vaultName, String resourceGroupName, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> getSinglePageAsync(vaultName, resourceGroupName, context), + nextLink -> getNextSinglePageAsync(nextLink, context)); } /** - * Provides a pageable list of all items that are backed up within a vault. + * List the ResourceGuardProxies under vault. * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. * @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. + * @return list of ResourceGuardProxyBase resources. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken)); + public PagedIterable get(String vaultName, String resourceGroupName) { + return new PagedIterable<>(getAsync(vaultName, resourceGroupName)); } /** - * Provides a pageable list of all items that are backed up within a vault. + * List the ResourceGuardProxies under vault. * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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. + * @return list of ResourceGuardProxyBase resources. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { - return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken, context)); + public PagedIterable get( + String vaultName, String resourceGroupName, Context context) { + return new PagedIterable<>(getAsync(vaultName, resourceGroupName, context)); } /** @@ -313,10 +272,10 @@ public PagedIterable list( * @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. + * @return list of ResourceGuardProxyBase resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> getNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -328,8 +287,8 @@ private Mono> listNextSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .withContext(context -> service.getNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -349,10 +308,11 @@ private Mono> listNextSinglePageAsync( * @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. + * @return list of ResourceGuardProxyBase resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> getNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -365,7 +325,7 @@ private Mono> listNextSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) + .getNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxiesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxiesImpl.java new file mode 100644 index 0000000000000..6080262ce19e8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxiesImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceGuardProxiesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxies; +import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyBaseResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ResourceGuardProxiesImpl implements ResourceGuardProxies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGuardProxiesImpl.class); + + private final ResourceGuardProxiesClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public ResourceGuardProxiesImpl( + ResourceGuardProxiesClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable get(String vaultName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().get(vaultName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ResourceGuardProxyBaseResourceImpl(inner1, this.manager())); + } + + public PagedIterable get( + String vaultName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().get(vaultName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ResourceGuardProxyBaseResourceImpl(inner1, this.manager())); + } + + private ResourceGuardProxiesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrAccessTokenResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyBaseResourceImpl.java similarity index 72% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrAccessTokenResourceImpl.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyBaseResourceImpl.java index abc2f4a4cc7d4..de4e507bdae90 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrAccessTokenResourceImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyBaseResourceImpl.java @@ -4,19 +4,19 @@ package com.azure.resourcemanager.recoveryservicesbackup.implementation; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrrAccessTokenResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrrAccessToken; -import com.azure.resourcemanager.recoveryservicesbackup.models.CrrAccessTokenResource; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyBase; +import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyBaseResource; import java.util.Collections; import java.util.Map; -public final class CrrAccessTokenResourceImpl implements CrrAccessTokenResource { - private CrrAccessTokenResourceInner innerObject; +public final class ResourceGuardProxyBaseResourceImpl implements ResourceGuardProxyBaseResource { + private ResourceGuardProxyBaseResourceInner innerObject; private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - CrrAccessTokenResourceImpl( - CrrAccessTokenResourceInner innerObject, + ResourceGuardProxyBaseResourceImpl( + ResourceGuardProxyBaseResourceInner innerObject, com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -47,7 +47,7 @@ public Map tags() { } } - public CrrAccessToken properties() { + public ResourceGuardProxyBase properties() { return this.innerModel().properties(); } @@ -55,7 +55,7 @@ public String etag() { return this.innerModel().etag(); } - public CrrAccessTokenResourceInner innerModel() { + public ResourceGuardProxyBaseResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsClientImpl.java new file mode 100644 index 0000000000000..c1856ce3ca81c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsClientImpl.java @@ -0,0 +1,818 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +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.Post; +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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceGuardProxyOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.UnlockDeleteResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.UnlockDeleteRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceGuardProxyOperationsClient. */ +public final class ResourceGuardProxyOperationsClientImpl implements ResourceGuardProxyOperationsClient { + private final ClientLogger logger = new ClientLogger(ResourceGuardProxyOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ResourceGuardProxyOperationsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ResourceGuardProxyOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceGuardProxyOperationsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + ResourceGuardProxyOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientResourceGuardProxyOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ResourceGuardProxyOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGuardProxyName") String resourceGuardProxyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGuardProxyName") String resourceGuardProxyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGuardProxyName") String resourceGuardProxyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}/unlockDelete") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> unlockDelete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGuardProxyName") String resourceGuardProxyName, + @BodyParam("application/json") UnlockDeleteRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns ResourceGuardProxy under vault and with the name referenced in request. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String resourceGuardProxyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGuardProxyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter resourceGuardProxyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + resourceGuardProxyName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns ResourceGuardProxy under vault and with the name referenced in request. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGuardProxyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter resourceGuardProxyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + resourceGuardProxyName, + accept, + context); + } + + /** + * Returns ResourceGuardProxy under vault and with the name referenced in request. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, String resourceGroupName, String resourceGuardProxyName) { + return getWithResponseAsync(vaultName, resourceGroupName, resourceGuardProxyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns ResourceGuardProxy under vault and with the name referenced in request. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceGuardProxyBaseResourceInner get( + String vaultName, String resourceGroupName, String resourceGuardProxyName) { + return getAsync(vaultName, resourceGroupName, resourceGuardProxyName).block(); + } + + /** + * Returns ResourceGuardProxy under vault and with the name referenced in request. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, resourceGuardProxyName, context).block(); + } + + /** + * Add or Update ResourceGuardProxy under vault Secures vault critical operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String vaultName, String resourceGroupName, String resourceGuardProxyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGuardProxyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter resourceGuardProxyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + this.client.getApiVersion(), + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + resourceGuardProxyName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Add or Update ResourceGuardProxy under vault Secures vault critical operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGuardProxyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter resourceGuardProxyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + this.client.getApiVersion(), + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + resourceGuardProxyName, + accept, + context); + } + + /** + * Add or Update ResourceGuardProxy under vault Secures vault critical operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String vaultName, String resourceGroupName, String resourceGuardProxyName) { + return putWithResponseAsync(vaultName, resourceGroupName, resourceGuardProxyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Add or Update ResourceGuardProxy under vault Secures vault critical operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceGuardProxyBaseResourceInner put( + String vaultName, String resourceGroupName, String resourceGuardProxyName) { + return putAsync(vaultName, resourceGroupName, resourceGuardProxyName).block(); + } + + /** + * Add or Update ResourceGuardProxy under vault Secures vault critical operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context) { + return putWithResponseAsync(vaultName, resourceGroupName, resourceGuardProxyName, context).block(); + } + + /** + * Delete ResourceGuardProxy under vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String vaultName, String resourceGroupName, String resourceGuardProxyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGuardProxyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter resourceGuardProxyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + resourceGuardProxyName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete ResourceGuardProxy under vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGuardProxyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter resourceGuardProxyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + resourceGuardProxyName, + accept, + context); + } + + /** + * Delete ResourceGuardProxy under vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String vaultName, String resourceGroupName, String resourceGuardProxyName) { + return deleteWithResponseAsync(vaultName, resourceGroupName, resourceGuardProxyName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete ResourceGuardProxy under vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 delete(String vaultName, String resourceGroupName, String resourceGuardProxyName) { + deleteAsync(vaultName, resourceGroupName, resourceGuardProxyName).block(); + } + + /** + * Delete ResourceGuardProxy under vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context) { + return deleteWithResponseAsync(vaultName, resourceGroupName, resourceGuardProxyName, context).block(); + } + + /** + * Secures delete ResourceGuardProxy operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName parameter. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of Unlock Delete API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> unlockDeleteWithResponseAsync( + String vaultName, String resourceGroupName, String resourceGuardProxyName, UnlockDeleteRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGuardProxyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter resourceGuardProxyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .unlockDelete( + this.client.getEndpoint(), + this.client.getApiVersion(), + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + resourceGuardProxyName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Secures delete ResourceGuardProxy operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName parameter. + * @param parameters Request body for operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of Unlock Delete API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> unlockDeleteWithResponseAsync( + String vaultName, + String resourceGroupName, + String resourceGuardProxyName, + UnlockDeleteRequest parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGuardProxyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter resourceGuardProxyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .unlockDelete( + this.client.getEndpoint(), + this.client.getApiVersion(), + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + resourceGuardProxyName, + parameters, + accept, + context); + } + + /** + * Secures delete ResourceGuardProxy operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName parameter. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of Unlock Delete API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono unlockDeleteAsync( + String vaultName, String resourceGroupName, String resourceGuardProxyName, UnlockDeleteRequest parameters) { + return unlockDeleteWithResponseAsync(vaultName, resourceGroupName, resourceGuardProxyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Secures delete ResourceGuardProxy operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName parameter. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of Unlock Delete API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UnlockDeleteResponseInner unlockDelete( + String vaultName, String resourceGroupName, String resourceGuardProxyName, UnlockDeleteRequest parameters) { + return unlockDeleteAsync(vaultName, resourceGroupName, resourceGuardProxyName, parameters).block(); + } + + /** + * Secures delete ResourceGuardProxy operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName parameter. + * @param parameters Request body for operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of Unlock Delete API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response unlockDeleteWithResponse( + String vaultName, + String resourceGroupName, + String resourceGuardProxyName, + UnlockDeleteRequest parameters, + Context context) { + return unlockDeleteWithResponseAsync(vaultName, resourceGroupName, resourceGuardProxyName, parameters, context) + .block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsImpl.java new file mode 100644 index 0000000000000..71becedd8f1e8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsImpl.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.ResourceGuardProxyOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.UnlockDeleteResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyBaseResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyOperations; +import com.azure.resourcemanager.recoveryservicesbackup.models.UnlockDeleteRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.UnlockDeleteResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ResourceGuardProxyOperationsImpl implements ResourceGuardProxyOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGuardProxyOperationsImpl.class); + + private final ResourceGuardProxyOperationsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public ResourceGuardProxyOperationsImpl( + ResourceGuardProxyOperationsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ResourceGuardProxyBaseResource get( + String vaultName, String resourceGroupName, String resourceGuardProxyName) { + ResourceGuardProxyBaseResourceInner inner = + this.serviceClient().get(vaultName, resourceGroupName, resourceGuardProxyName); + if (inner != null) { + return new ResourceGuardProxyBaseResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ResourceGuardProxyBaseResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ResourceGuardProxyBaseResource put( + String vaultName, String resourceGroupName, String resourceGuardProxyName) { + ResourceGuardProxyBaseResourceInner inner = + this.serviceClient().put(vaultName, resourceGroupName, resourceGuardProxyName); + if (inner != null) { + return new ResourceGuardProxyBaseResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response putWithResponse( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context) { + Response inner = + this.serviceClient().putWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ResourceGuardProxyBaseResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String vaultName, String resourceGroupName, String resourceGuardProxyName) { + this.serviceClient().delete(vaultName, resourceGroupName, resourceGuardProxyName); + } + + public Response deleteWithResponse( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context) { + return this.serviceClient().deleteWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, context); + } + + public UnlockDeleteResponse unlockDelete( + String vaultName, String resourceGroupName, String resourceGuardProxyName, UnlockDeleteRequest parameters) { + UnlockDeleteResponseInner inner = + this.serviceClient().unlockDelete(vaultName, resourceGroupName, resourceGuardProxyName, parameters); + if (inner != null) { + return new UnlockDeleteResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response unlockDeleteWithResponse( + String vaultName, + String resourceGroupName, + String resourceGuardProxyName, + UnlockDeleteRequest parameters, + Context context) { + Response inner = + this + .serviceClient() + .unlockDeleteWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UnlockDeleteResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ResourceGuardProxyOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersClientImpl.java index 08c2706beb9b3..a3ba8ffa28dc1 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersClientImpl.java @@ -170,7 +170,6 @@ private Mono> getOperationStatusWithResponseAsync if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -178,7 +177,7 @@ private Mono> getOperationStatusWithResponseAsync service .getOperationStatus( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -225,13 +224,12 @@ private Mono> getOperationStatusWithResponseAsync if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .getOperationStatus( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -337,7 +335,6 @@ private Mono>> bmsPrepareDataMoveWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -345,7 +342,7 @@ private Mono>> bmsPrepareDataMoveWithResponseAsync( service .bmsPrepareDataMove( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -394,13 +391,12 @@ private Mono>> bmsPrepareDataMoveWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .bmsPrepareDataMove( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -420,7 +416,7 @@ private Mono>> bmsPrepareDataMoveWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginBmsPrepareDataMoveAsync( String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters) { Mono>> mono = @@ -442,7 +438,7 @@ private PollerFlux, Void> beginBmsPrepareDataMoveAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginBmsPrepareDataMoveAsync( String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, Context context) { context = this.client.mergeContext(context); @@ -464,7 +460,7 @@ private PollerFlux, Void> beginBmsPrepareDataMoveAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginBmsPrepareDataMove( String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters) { return beginBmsPrepareDataMoveAsync(vaultName, resourceGroupName, parameters).getSyncPoller(); @@ -482,7 +478,7 @@ public SyncPoller, Void> beginBmsPrepareDataMove( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginBmsPrepareDataMove( String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, Context context) { return beginBmsPrepareDataMoveAsync(vaultName, resourceGroupName, parameters, context).getSyncPoller(); @@ -597,7 +593,6 @@ private Mono>> bmsTriggerDataMoveWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -605,7 +600,7 @@ private Mono>> bmsTriggerDataMoveWithResponseAsync( service .bmsTriggerDataMove( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -654,13 +649,12 @@ private Mono>> bmsTriggerDataMoveWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .bmsTriggerDataMove( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -680,7 +674,7 @@ private Mono>> bmsTriggerDataMoveWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginBmsTriggerDataMoveAsync( String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters) { Mono>> mono = @@ -702,7 +696,7 @@ private PollerFlux, Void> beginBmsTriggerDataMoveAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginBmsTriggerDataMoveAsync( String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, Context context) { context = this.client.mergeContext(context); @@ -724,7 +718,7 @@ private PollerFlux, Void> beginBmsTriggerDataMoveAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginBmsTriggerDataMove( String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters) { return beginBmsTriggerDataMoveAsync(vaultName, resourceGroupName, parameters).getSyncPoller(); @@ -742,7 +736,7 @@ public SyncPoller, Void> beginBmsTriggerDataMove( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginBmsTriggerDataMove( String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, Context context) { return beginBmsTriggerDataMoveAsync(vaultName, resourceGroupName, parameters, context).getSyncPoller(); @@ -881,7 +875,6 @@ private Mono>> moveRecoveryPointWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -889,7 +882,7 @@ private Mono>> moveRecoveryPointWithResponseAsync( service .moveRecoveryPoint( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -967,13 +960,12 @@ private Mono>> moveRecoveryPointWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .moveRecoveryPoint( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -1001,7 +993,7 @@ private Mono>> moveRecoveryPointWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginMoveRecoveryPointAsync( String vaultName, String resourceGroupName, @@ -1040,7 +1032,7 @@ private PollerFlux, Void> beginMoveRecoveryPointAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginMoveRecoveryPointAsync( String vaultName, String resourceGroupName, @@ -1081,7 +1073,7 @@ private PollerFlux, Void> beginMoveRecoveryPointAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginMoveRecoveryPoint( String vaultName, String resourceGroupName, @@ -1111,7 +1103,7 @@ public SyncPoller, Void> beginMoveRecoveryPoint( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginMoveRecoveryPoint( String vaultName, String resourceGroupName, diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresClientImpl.java index da8cf759c029a..4d18b373372ce 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresClientImpl.java @@ -144,7 +144,6 @@ private Mono>> triggerWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -152,7 +151,7 @@ private Mono>> triggerWithResponseAsync( service .trigger( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -231,13 +230,12 @@ private Mono>> triggerWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .trigger( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), @@ -266,7 +264,7 @@ private Mono>> triggerWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTriggerAsync( String vaultName, String resourceGroupName, @@ -306,7 +304,7 @@ private PollerFlux, Void> beginTriggerAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTriggerAsync( String vaultName, String resourceGroupName, @@ -348,7 +346,7 @@ private PollerFlux, Void> beginTriggerAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTrigger( String vaultName, String resourceGroupName, @@ -379,7 +377,7 @@ public SyncPoller, Void> beginTrigger( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTrigger( String vaultName, String resourceGroupName, diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsClientImpl.java index 134627bfbb416..1a045362a40cc 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsClientImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.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; @@ -24,6 +25,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservicesbackup.fluent.SecurityPINsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPinBase; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in SecurityPINsClient. */ @@ -66,6 +68,7 @@ Mono> get( @PathParam("vaultName") String vaultName, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SecurityPinBase parameters, @HeaderParam("Accept") String accept, Context context); } @@ -75,13 +78,15 @@ Mono> get( * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters security pin 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 security PIN. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, String resourceGroupName) { + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, SecurityPinBase parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -101,7 +106,9 @@ private Mono> getWithResponseAsync(String vaultN new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + if (parameters != null) { + parameters.validate(); + } final String accept = "application/json"; return FluxUtil .withContext( @@ -109,10 +116,11 @@ private Mono> getWithResponseAsync(String vaultN service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), + parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -123,6 +131,7 @@ private Mono> getWithResponseAsync(String vaultN * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters security pin 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. @@ -131,7 +140,7 @@ private Mono> getWithResponseAsync(String vaultN */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String vaultName, String resourceGroupName, Context context) { + String vaultName, String resourceGroupName, SecurityPinBase parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -151,20 +160,48 @@ private Mono> getWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + if (parameters != null) { + parameters.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), + parameters, accept, context); } + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters security pin 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 security PIN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, String resourceGroupName, SecurityPinBase parameters) { + return getWithResponseAsync(vaultName, resourceGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + /** * Get the security PIN. * @@ -177,7 +214,8 @@ private Mono> getWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String vaultName, String resourceGroupName) { - return getWithResponseAsync(vaultName, resourceGroupName) + final SecurityPinBase parameters = null; + return getWithResponseAsync(vaultName, resourceGroupName, parameters) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -200,7 +238,8 @@ private Mono getAsync(String vaultName, String resourceGr */ @ServiceMethod(returns = ReturnType.SINGLE) public TokenInformationInner get(String vaultName, String resourceGroupName) { - return getAsync(vaultName, resourceGroupName).block(); + final SecurityPinBase parameters = null; + return getAsync(vaultName, resourceGroupName, parameters).block(); } /** @@ -208,6 +247,7 @@ public TokenInformationInner get(String vaultName, String resourceGroupName) { * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters security pin 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. @@ -216,7 +256,7 @@ public TokenInformationInner get(String vaultName, String resourceGroupName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String vaultName, String resourceGroupName, Context context) { - return getWithResponseAsync(vaultName, resourceGroupName, context).block(); + String vaultName, String resourceGroupName, SecurityPinBase parameters, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, parameters, context).block(); } } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java index 8097d0964a4b5..210e2beeab5d1 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.recoveryservicesbackup.fluent.SecurityPINsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner; import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPINs; +import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPinBase; import com.azure.resourcemanager.recoveryservicesbackup.models.TokenInformation; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -37,9 +38,10 @@ public TokenInformation get(String vaultName, String resourceGroupName) { } } - public Response getWithResponse(String vaultName, String resourceGroupName, Context context) { + public Response getWithResponse( + String vaultName, String resourceGroupName, SecurityPinBase parameters, Context context) { Response inner = - this.serviceClient().getWithResponse(vaultName, resourceGroupName, context); + this.serviceClient().getWithResponse(vaultName, resourceGroupName, parameters, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/UnlockDeleteResponseImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/UnlockDeleteResponseImpl.java new file mode 100644 index 0000000000000..4fde943640b3e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/UnlockDeleteResponseImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.UnlockDeleteResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.UnlockDeleteResponse; + +public final class UnlockDeleteResponseImpl implements UnlockDeleteResponse { + private UnlockDeleteResponseInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + UnlockDeleteResponseImpl( + UnlockDeleteResponseInner innerObject, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String unlockDeleteExpiryTime() { + return this.innerModel().unlockDeleteExpiryTime(); + } + + public UnlockDeleteResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadProperties.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadProperties.java deleted file mode 100644 index 3ab3cbc42d0f5..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadProperties.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The AadProperties model. */ -@Fluent -public final class AadProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AadProperties.class); - - /* - * The servicePrincipalClientId property. - */ - @JsonProperty(value = "servicePrincipalClientId") - private String servicePrincipalClientId; - - /* - * The tenantId property. - */ - @JsonProperty(value = "tenantId") - private String tenantId; - - /* - * The authority property. - */ - @JsonProperty(value = "authority") - private String authority; - - /* - * The audience property. - */ - @JsonProperty(value = "audience") - private String audience; - - /* - * The servicePrincipalObjectId property. - */ - @JsonProperty(value = "servicePrincipalObjectId") - private String servicePrincipalObjectId; - - /** - * 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadPropertiesOperations.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadPropertiesOperations.java deleted file mode 100644 index 8d3881a72b7ee..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadPropertiesOperations.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.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. - * - * @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); - - /** - * Fetches the AAD properties from target region BCM stamp. - * - * @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. - */ - Response getWithResponse(String azureRegion, String filter, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java index 480df590f0a86..a2cc88aed11e1 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -14,7 +14,7 @@ /** AzureBackupServer (DPMVenus) workload-specific protection container. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") @JsonTypeName("AzureBackupServerContainer") -@Immutable +@Fluent public final class AzureBackupServerContainer extends DpmContainer { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupServerContainer.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java index 977a67f1e67e8..594242c20809a 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Backup engine type when Azure Backup Server is used to manage the backups. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupEngineType") @JsonTypeName("AzureBackupServerEngine") -@Immutable +@Fluent public final class AzureBackupServerEngine extends BackupEngineBase { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupServerEngine.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java index 51e4f17335f46..1ff9832dacbe4 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** AzureStorage backup policy. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType") @@ -130,6 +131,14 @@ public AzureFileShareProtectionPolicy withProtectedItemsCount(Integer protectedI return this; } + /** {@inheritDoc} */ + @Override + public AzureFileShareProtectionPolicy withResourceGuardOperationRequests( + List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPointAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPointAutoGenerated.java deleted file mode 100644 index 3a1bc5dd464c0..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPointAutoGenerated.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; - -/** Azure File Share workload specific backup copy. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("AzureFileShareRecoveryPoint") -@Immutable -public final class AzureFileShareRecoveryPointAutoGenerated extends RecoveryPoint { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileShareRecoveryPointAutoGenerated.class); - - /* - * Type of the backup copy. Specifies whether it is a crash consistent - * backup or app consistent. - */ - @JsonProperty(value = "recoveryPointType", access = JsonProperty.Access.WRITE_ONLY) - private String recoveryPointType; - - /* - * Time at which this backup copy was created. - */ - @JsonProperty(value = "recoveryPointTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime recoveryPointTime; - - /* - * Contains Url to the snapshot of fileshare, if applicable - */ - @JsonProperty(value = "fileShareSnapshotUri", access = JsonProperty.Access.WRITE_ONLY) - private String fileShareSnapshotUri; - - /* - * Contains recovery point size - */ - @JsonProperty(value = "recoveryPointSizeInGB", access = JsonProperty.Access.WRITE_ONLY) - private Integer recoveryPointSizeInGB; - - /** - * 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java index 014a1e81bd813..1029362683078 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java @@ -7,10 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Azure File Share workload-specific backup item. */ @@ -54,6 +56,7 @@ public final class AzureFileshareProtectedItem extends ProtectedItem { * Health details of different KPIs */ @JsonProperty(value = "kpisHealths") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map kpisHealths; /* @@ -293,6 +296,13 @@ public AzureFileshareProtectedItem withIsRehydrate(Boolean isRehydrate) { return this; } + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItem withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemAutoGenerated.java deleted file mode 100644 index a14f75db8f00c..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemAutoGenerated.java +++ /dev/null @@ -1,350 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Azure File Share workload-specific backup item. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") -@JsonTypeName("AzureFileShareProtectedItem") -@Fluent -public final class AzureFileshareProtectedItemAutoGenerated extends ProtectedItem { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileshareProtectedItemAutoGenerated.class); - - /* - * Friendly name of the fileshare represented by this backup item. - */ - @JsonProperty(value = "friendlyName") - private String friendlyName; - - /* - * Backup status of this backup item. - */ - @JsonProperty(value = "protectionStatus") - private String protectionStatus; - - /* - * Backup state of this backup item. - */ - @JsonProperty(value = "protectionState") - private ProtectionState protectionState; - - /* - * backups running status for this backup item. - */ - @JsonProperty(value = "healthStatus") - private HealthStatus healthStatus; - - /* - * Last backup operation status. Possible values: Healthy, Unhealthy. - */ - @JsonProperty(value = "lastBackupStatus") - private String lastBackupStatus; - - /* - * Timestamp of the last backup operation on this backup item. - */ - @JsonProperty(value = "lastBackupTime") - private OffsetDateTime lastBackupTime; - - /* - * Health details of different KPIs - */ - @JsonProperty(value = "kpisHealths") - private Map kpisHealths; - - /* - * Additional information with this backup item. - */ - @JsonProperty(value = "extendedInfo") - private AzureFileshareProtectedItemExtendedInfo extendedInfo; - - /** - * Get the friendlyName property: Friendly name of the fileshare represented by this backup item. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: Friendly name of the fileshare represented by this backup item. - * - * @param friendlyName the friendlyName value to set. - * @return the AzureFileshareProtectedItemAutoGenerated object itself. - */ - public AzureFileshareProtectedItemAutoGenerated withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - 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 AzureFileshareProtectedItemAutoGenerated object itself. - */ - public AzureFileshareProtectedItemAutoGenerated 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 AzureFileshareProtectedItemAutoGenerated object itself. - */ - public AzureFileshareProtectedItemAutoGenerated withProtectionState(ProtectionState protectionState) { - this.protectionState = protectionState; - return this; - } - - /** - * Get the healthStatus property: backups running status for this backup item. - * - * @return the healthStatus value. - */ - public HealthStatus healthStatus() { - return this.healthStatus; - } - - /** - * Set the healthStatus property: backups running status for this backup item. - * - * @param healthStatus the healthStatus value to set. - * @return the AzureFileshareProtectedItemAutoGenerated object itself. - */ - public AzureFileshareProtectedItemAutoGenerated withHealthStatus(HealthStatus healthStatus) { - this.healthStatus = healthStatus; - return this; - } - - /** - * Get the lastBackupStatus property: Last backup operation status. Possible values: Healthy, Unhealthy. - * - * @return the lastBackupStatus value. - */ - public String 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 AzureFileshareProtectedItemAutoGenerated object itself. - */ - public AzureFileshareProtectedItemAutoGenerated 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 AzureFileshareProtectedItemAutoGenerated object itself. - */ - public AzureFileshareProtectedItemAutoGenerated withLastBackupTime(OffsetDateTime lastBackupTime) { - this.lastBackupTime = lastBackupTime; - 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 AzureFileshareProtectedItemAutoGenerated object itself. - */ - public AzureFileshareProtectedItemAutoGenerated withKpisHealths(Map kpisHealths) { - this.kpisHealths = kpisHealths; - return this; - } - - /** - * Get the extendedInfo property: Additional information with this backup item. - * - * @return the extendedInfo value. - */ - public AzureFileshareProtectedItemExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * Set the extendedInfo property: Additional information with this backup item. - * - * @param extendedInfo the extendedInfo value to set. - * @return the AzureFileshareProtectedItemAutoGenerated object itself. - */ - public AzureFileshareProtectedItemAutoGenerated withExtendedInfo( - AzureFileshareProtectedItemExtendedInfo extendedInfo) { - this.extendedInfo = extendedInfo; - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFileshareProtectedItemAutoGenerated withBackupManagementType( - BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFileshareProtectedItemAutoGenerated withWorkloadType(DataSourceType workloadType) { - super.withWorkloadType(workloadType); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFileshareProtectedItemAutoGenerated withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFileshareProtectedItemAutoGenerated withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFileshareProtectedItemAutoGenerated withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFileshareProtectedItemAutoGenerated withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFileshareProtectedItemAutoGenerated withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFileshareProtectedItemAutoGenerated withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFileshareProtectedItemAutoGenerated withDeferredDeleteTimeInUtc( - OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFileshareProtectedItemAutoGenerated withIsScheduledForDeferredDelete( - Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFileshareProtectedItemAutoGenerated withDeferredDeleteTimeRemaining( - String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFileshareProtectedItemAutoGenerated withIsDeferredDeleteScheduleUpcoming( - Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFileshareProtectedItemAutoGenerated withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (kpisHealths() != null) { - kpisHealths() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - if (extendedInfo() != null) { - extendedInfo().validate(); - } - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java index 72abdd5b96841..c8bfba6427987 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** IaaS VM workload-specific backup item representing a classic virtual machine. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") @JsonTypeName("Microsoft.ClassicCompute/virtualMachines") -@Immutable +@Fluent public final class AzureIaaSClassicComputeVMContainer extends IaaSvmContainer { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSClassicComputeVMContainer.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java index 5c8a6dcd67967..fccfb5b282400 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** IaaS VM workload-specific backup item representing the Classic Compute VM. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") @JsonTypeName("Microsoft.ClassicCompute/virtualMachines") -@Immutable +@Fluent public final class AzureIaaSClassicComputeVMProtectableItem extends IaaSvmProtectableItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSClassicComputeVMProtectableItem.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.java index 6bf68ba4d6724..df65f6aacb08e 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -16,7 +16,7 @@ /** IaaS VM workload-specific backup item representing the Classic Compute VM. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") @JsonTypeName("Microsoft.ClassicCompute/virtualMachines") -@Immutable +@Fluent public final class AzureIaaSClassicComputeVMProtectedItem extends AzureIaaSvmProtectedItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSClassicComputeVMProtectedItem.class); @@ -197,6 +197,14 @@ public AzureIaaSClassicComputeVMProtectedItem withIsRehydrate(Boolean isRehydrat return this; } + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withResourceGuardOperationRequests( + List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java index 7fca52777a878..b29846cae57d4 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** IaaS VM workload-specific backup item representing an Azure Resource Manager virtual machine. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") @JsonTypeName("Microsoft.Compute/virtualMachines") -@Immutable +@Fluent public final class AzureIaaSComputeVMContainer extends IaaSvmContainer { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSComputeVMContainer.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java index afb50958e22a7..19d8b376cf0d3 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** IaaS VM workload-specific backup item representing the Azure Resource Manager VM. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") @JsonTypeName("Microsoft.Compute/virtualMachines") -@Immutable +@Fluent public final class AzureIaaSComputeVMProtectableItem extends IaaSvmProtectableItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSComputeVMProtectableItem.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java index a68eb3be41948..61785d05fe0c5 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -16,7 +16,7 @@ /** IaaS VM workload-specific backup item representing the Azure Resource Manager VM. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") @JsonTypeName("Microsoft.Compute/virtualMachines") -@Immutable +@Fluent public final class AzureIaaSComputeVMProtectedItem extends AzureIaaSvmProtectedItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSComputeVMProtectedItem.class); @@ -196,6 +196,14 @@ public AzureIaaSComputeVMProtectedItem withIsRehydrate(Boolean isRehydrate) { return this; } + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withResourceGuardOperationRequests( + List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java index f5aea0d99977f..a651a265534a2 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -26,12 +27,14 @@ public final class AzureIaaSvmJobExtendedInfo { * Job properties. */ @JsonProperty(value = "propertyBag") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map propertyBag; /* * Job internal properties. */ @JsonProperty(value = "internalPropertyBag") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map internalPropertyBag; /* diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.java index f3563108c823e..dfce3e43663a9 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -72,6 +73,7 @@ public class AzureIaaSvmProtectedItem extends ProtectedItem { * Health details of different KPIs */ @JsonProperty(value = "kpisHealths") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map kpisHealths; /* @@ -435,6 +437,13 @@ public AzureIaaSvmProtectedItem withIsRehydrate(Boolean isRehydrate) { return this; } + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectedItem withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java index efa3eaa4394cf..6758e33260d59 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** IaaS VM workload-specific backup policy. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType") @@ -156,6 +157,13 @@ public AzureIaaSvmProtectionPolicy withProtectedItemsCount(Integer protectedItem return this; } + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectionPolicy withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java index 93958a5079bcd..334172e907d37 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -21,7 +21,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(name = "AzureWorkloadAutoProtectionIntent", value = AzureWorkloadAutoProtectionIntent.class) }) -@Immutable +@Fluent public class AzureRecoveryServiceVaultProtectionIntent extends ProtectionIntent { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureRecoveryServiceVaultProtectionIntent.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.java index befdfaed75f2c..d3041edfab485 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Azure Sql workload-specific container. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") @JsonTypeName("AzureSqlContainer") -@Immutable +@Fluent public final class AzureSqlContainer extends ProtectionContainer { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureSqlContainer.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java index ed49dcdda61ad..d2d7a21172fdf 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; +import java.util.List; /** Azure SQL workload-specific backup item. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") @@ -191,6 +192,13 @@ public AzureSqlProtectedItem withIsRehydrate(Boolean isRehydrate) { return this; } + /** {@inheritDoc} */ + @Override + public AzureSqlProtectedItem withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java index db49064cd2739..aa5d6b4b56e5b 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** Azure SQL workload-specific backup policy. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType") @@ -51,6 +52,13 @@ public AzureSqlProtectionPolicy withProtectedItemsCount(Integer protectedItemsCo return this; } + /** {@inheritDoc} */ + @Override + public AzureSqlProtectionPolicy withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java index 4694adf54ac87..4104b658991e9 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -14,7 +14,7 @@ /** Container for SQL workloads under SQL Availability Group. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") @JsonTypeName("SQLAGWorkLoadContainer") -@Immutable +@Fluent public final class AzureSqlagWorkloadContainerProtectionContainer extends AzureWorkloadContainer { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureSqlagWorkloadContainerProtectionContainer.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.java index d525ec20308ac..b3307457b7c18 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -26,6 +27,7 @@ public final class AzureStorageJobExtendedInfo { * Job properties. */ @JsonProperty(value = "propertyBag") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map propertyBag; /* diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.java index 6c0f223ad21a6..7554c6b836fb7 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Azure Storage-specific protectable containers. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableContainerType") @JsonTypeName("StorageContainer") -@Immutable +@Fluent public final class AzureStorageProtectableContainer extends ProtectableContainer { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureStorageProtectableContainer.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.java index a400221029393..c5e09f46ef121 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Azure workload-specific container. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableContainerType") @JsonTypeName("VMAppContainer") -@Immutable +@Fluent public final class AzureVMAppContainerProtectableContainer extends ProtectableContainer { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVMAppContainerProtectableContainer.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.java index a809634cff839..33e24982b0659 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -14,7 +14,7 @@ /** Container for SQL workloads under Azure Virtual Machines. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") @JsonTypeName("VMAppContainer") -@Immutable +@Fluent public final class AzureVMAppContainerProtectionContainer extends AzureWorkloadContainer { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVMAppContainerProtectionContainer.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java index 71065f0108ce7..90ce7c391ce47 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java @@ -7,11 +7,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Azure VM workload-specific protected item. */ @@ -112,6 +114,7 @@ public class AzureVmWorkloadProtectedItem extends ProtectedItem { * Health details of different KPIs */ @JsonProperty(value = "kpisHealths") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map kpisHealths; /** @@ -468,6 +471,14 @@ public AzureVmWorkloadProtectedItem withIsRehydrate(Boolean isRehydrate) { return this; } + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectedItem withResourceGuardOperationRequests( + List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java index 293d2dc197e7e..2e4d786d3fb57 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java @@ -130,6 +130,14 @@ public AzureVmWorkloadProtectionPolicy withProtectedItemsCount(Integer protected return this; } + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectionPolicy withResourceGuardOperationRequests( + List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.java index 56d88f866b833..eb9709db57648 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.java @@ -4,18 +4,19 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Azure VM workload-specific protected item representing SAP ASE Database. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") @JsonTypeName("AzureVmWorkloadSAPAseDatabase") -@Immutable +@Fluent public final class AzureVmWorkloadSapAseDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapAseDatabaseProtectedItem.class); @@ -209,6 +210,14 @@ public AzureVmWorkloadSapAseDatabaseProtectedItem withIsRehydrate(Boolean isRehy return this; } + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withResourceGuardOperationRequests( + List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java index 3fae85ec33d39..dc238a1f472ff 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Azure VM workload-specific workload item representing SAP ASE Database. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType") @JsonTypeName("SAPAseDatabase") -@Immutable +@Fluent public final class AzureVmWorkloadSapAseDatabaseWorkloadItem extends AzureVmWorkloadItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapAseDatabaseWorkloadItem.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java index 073c1ba992bcf..ae1c191cad9fd 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Azure VM workload-specific protectable item representing SAP ASE System. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") @JsonTypeName("SAPAseSystem") -@Immutable +@Fluent public final class AzureVmWorkloadSapAseSystemProtectableItem extends AzureVmWorkloadProtectableItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapAseSystemProtectableItem.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java index a70107765b824..f238c9941b554 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Azure VM workload-specific workload item representing SAP ASE System. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType") @JsonTypeName("SAPAseSystem") -@Immutable +@Fluent public final class AzureVmWorkloadSapAseSystemWorkloadItem extends AzureVmWorkloadItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapAseSystemWorkloadItem.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.java index 48f7399a79ccc..3964055f42089 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Azure VM workload-specific protectable item representing SAP HANA Database. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") @JsonTypeName("SAPHanaDatabase") -@Immutable +@Fluent public final class AzureVmWorkloadSapHanaDatabaseProtectableItem extends AzureVmWorkloadProtectableItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapHanaDatabaseProtectableItem.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.java index d735fd1a1a340..2646f38e7b290 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.java @@ -4,18 +4,19 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Azure VM workload-specific protected item representing SAP HANA Database. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") @JsonTypeName("AzureVmWorkloadSAPHanaDatabase") -@Immutable +@Fluent public final class AzureVmWorkloadSapHanaDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapHanaDatabaseProtectedItem.class); @@ -209,6 +210,14 @@ public AzureVmWorkloadSapHanaDatabaseProtectedItem withIsRehydrate(Boolean isReh return this; } + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withResourceGuardOperationRequests( + List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java index 415f05bcb1b2d..2fc033ff1a0b7 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Azure VM workload-specific workload item representing SAP HANA Database. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType") @JsonTypeName("SAPHanaDatabase") -@Immutable +@Fluent public final class AzureVmWorkloadSapHanaDatabaseWorkloadItem extends AzureVmWorkloadItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapHanaDatabaseWorkloadItem.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java index 34b37f4a78e6b..19027d8c532ec 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Azure VM workload-specific protectable item representing SAP HANA System. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") @JsonTypeName("SAPHanaSystem") -@Immutable +@Fluent public final class AzureVmWorkloadSapHanaSystemProtectableItem extends AzureVmWorkloadProtectableItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapHanaSystemProtectableItem.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java index ed88d8387ba3f..27e18636d01f4 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Azure VM workload-specific workload item representing SAP HANA System. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType") @JsonTypeName("SAPHanaSystem") -@Immutable +@Fluent public final class AzureVmWorkloadSapHanaSystemWorkloadItem extends AzureVmWorkloadItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapHanaSystemWorkloadItem.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.java index c5ca597c91524..b5d586e6abbaf 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Azure VM workload-specific protectable item representing SQL Availability Group. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") @JsonTypeName("SQLAvailabilityGroupContainer") -@Immutable +@Fluent public final class AzureVmWorkloadSqlAvailabilityGroupProtectableItem extends AzureVmWorkloadProtectableItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSqlAvailabilityGroupProtectableItem.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java index c44d77c423658..265fc13ee8ad2 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Azure VM workload-specific protectable item representing SQL Database. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") @JsonTypeName("SQLDataBase") -@Immutable +@Fluent public final class AzureVmWorkloadSqlDatabaseProtectableItem extends AzureVmWorkloadProtectableItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSqlDatabaseProtectableItem.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java index ab387db5ca6dd..048c42d1c39b6 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java @@ -4,18 +4,19 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Azure VM workload-specific protected item representing SQL Database. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") @JsonTypeName("AzureVmWorkloadSQLDatabase") -@Immutable +@Fluent public final class AzureVmWorkloadSqlDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSqlDatabaseProtectedItem.class); @@ -205,6 +206,14 @@ public AzureVmWorkloadSqlDatabaseProtectedItem withIsRehydrate(Boolean isRehydra return this; } + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withResourceGuardOperationRequests( + List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java index 2d03b59e6c7e8..08d36b7f04444 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Azure VM workload-specific workload item representing SQL Database. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType") @JsonTypeName("SQLDataBase") -@Immutable +@Fluent public final class AzureVmWorkloadSqlDatabaseWorkloadItem extends AzureVmWorkloadItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSqlDatabaseWorkloadItem.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java index bc6c1c961fbd3..1dc3dd755ee87 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Azure VM workload-specific protectable item representing SQL Instance. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") @JsonTypeName("SQLInstance") -@Immutable +@Fluent public final class AzureVmWorkloadSqlInstanceProtectableItem extends AzureVmWorkloadProtectableItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSqlInstanceProtectableItem.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java index cf74f9e3de2f2..c6abd0e75249c 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -23,7 +23,7 @@ name = "AzureWorkloadSQLAutoProtectionIntent", value = AzureWorkloadSqlAutoProtectionIntent.class) }) -@Immutable +@Fluent public class AzureWorkloadAutoProtectionIntent extends AzureRecoveryServiceVaultProtectionIntent { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadAutoProtectionIntent.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.java index f22cc1dedc852..334a31c1392b3 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -26,6 +27,7 @@ public final class AzureWorkloadJobExtendedInfo { * Job properties. */ @JsonProperty(value = "propertyBag") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map propertyBag; /* diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPointAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPointAutoGenerated.java deleted file mode 100644 index d490926cfc145..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPointAutoGenerated.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; -import java.util.Map; - -/** Recovery point specific to PointInTime. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "objectType", - defaultImpl = AzureWorkloadPointInTimeRecoveryPointAutoGenerated.class) -@JsonTypeName("AzureWorkloadPointInTimeRecoveryPoint") -@JsonSubTypes({ - @JsonSubTypes.Type( - name = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint", - value = AzureWorkloadSapHanaPointInTimeRecoveryPointAutoGenerated.class) -}) -@Fluent -public class AzureWorkloadPointInTimeRecoveryPointAutoGenerated extends AzureWorkloadRecoveryPointAutoGenerated { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(AzureWorkloadPointInTimeRecoveryPointAutoGenerated.class); - - /* - * List of log ranges - */ - @JsonProperty(value = "timeRanges") - private List timeRanges; - - /** - * 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 AzureWorkloadPointInTimeRecoveryPointAutoGenerated object itself. - */ - public AzureWorkloadPointInTimeRecoveryPointAutoGenerated withTimeRanges(List timeRanges) { - this.timeRanges = timeRanges; - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadPointInTimeRecoveryPointAutoGenerated withRecoveryPointTierDetails( - List recoveryPointTierDetails) { - super.withRecoveryPointTierDetails(recoveryPointTierDetails); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadPointInTimeRecoveryPointAutoGenerated withRecoveryPointMoveReadinessInfo( - Map recoveryPointMoveReadinessInfo) { - super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (timeRanges() != null) { - timeRanges().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.java index 0ea80d73336c0..4c34b0e048bda 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.java @@ -81,6 +81,13 @@ public AzureWorkloadPointInTimeRestoreRequest withRecoveryMode(RecoveryMode reco return this; } + /** {@inheritDoc} */ + @Override + public AzureWorkloadPointInTimeRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequestAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequestAutoGenerated.java deleted file mode 100644 index b7881f3ffdcdb..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequestAutoGenerated.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import java.util.Map; - -/** AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("AzureWorkloadPointInTimeRestoreRequest") -@Fluent -public final class AzureWorkloadPointInTimeRestoreRequestAutoGenerated - extends AzureWorkloadRestoreRequestAutoGenerated { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(AzureWorkloadPointInTimeRestoreRequestAutoGenerated.class); - - /* - * PointInTime value - */ - @JsonProperty(value = "pointInTime") - private OffsetDateTime pointInTime; - - /** - * 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 AzureWorkloadPointInTimeRestoreRequestAutoGenerated object itself. - */ - public AzureWorkloadPointInTimeRestoreRequestAutoGenerated withPointInTime(OffsetDateTime pointInTime) { - this.pointInTime = pointInTime; - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadPointInTimeRestoreRequestAutoGenerated withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadPointInTimeRestoreRequestAutoGenerated withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadPointInTimeRestoreRequestAutoGenerated withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadPointInTimeRestoreRequestAutoGenerated withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadPointInTimeRestoreRequestAutoGenerated withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadPointInTimeRestoreRequestAutoGenerated withTargetVirtualMachineId( - String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java index 409df3c3b381a..d9c10fdf9e20a 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -55,6 +56,7 @@ public class AzureWorkloadRecoveryPoint extends RecoveryPoint { * Eligibility of RP to be moved to another tier */ @JsonProperty(value = "recoveryPointMoveReadinessInfo") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map recoveryPointMoveReadinessInfo; /** diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPointAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPointAutoGenerated.java deleted file mode 100644 index fb88ae8b8b530..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPointAutoGenerated.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** Workload specific recovery point, specifically encapsulates full/diff recovery point. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "objectType", - defaultImpl = AzureWorkloadRecoveryPointAutoGenerated.class) -@JsonTypeName("AzureWorkloadRecoveryPoint") -@JsonSubTypes({ - @JsonSubTypes.Type( - name = "AzureWorkloadPointInTimeRecoveryPoint", - value = AzureWorkloadPointInTimeRecoveryPointAutoGenerated.class), - @JsonSubTypes.Type( - name = "AzureWorkloadSAPHanaRecoveryPoint", - value = AzureWorkloadSapHanaRecoveryPointAutoGenerated.class), - @JsonSubTypes.Type(name = "AzureWorkloadSQLRecoveryPoint", value = AzureWorkloadSqlRecoveryPointAutoGenerated.class) -}) -@Fluent -public class AzureWorkloadRecoveryPointAutoGenerated extends RecoveryPoint { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadRecoveryPointAutoGenerated.class); - - /* - * UTC time at which recovery point was created - */ - @JsonProperty(value = "recoveryPointTimeInUTC", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime recoveryPointTimeInUtc; - - /* - * Type of restore point - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private RestorePointType type; - - /* - * Recovery point tier information. - */ - @JsonProperty(value = "recoveryPointTierDetails") - private List recoveryPointTierDetails; - - /* - * Eligibility of RP to be moved to another tier - */ - @JsonProperty(value = "recoveryPointMoveReadinessInfo") - private Map recoveryPointMoveReadinessInfo; - - /** - * Get the recoveryPointTimeInUtc property: UTC time at which recovery point was created. - * - * @return the recoveryPointTimeInUtc value. - */ - public OffsetDateTime recoveryPointTimeInUtc() { - return this.recoveryPointTimeInUtc; - } - - /** - * Get the type property: Type of restore point. - * - * @return the type value. - */ - public RestorePointType type() { - return this.type; - } - - /** - * 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 AzureWorkloadRecoveryPointAutoGenerated object itself. - */ - public AzureWorkloadRecoveryPointAutoGenerated 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 AzureWorkloadRecoveryPointAutoGenerated object itself. - */ - public AzureWorkloadRecoveryPointAutoGenerated withRecoveryPointMoveReadinessInfo( - Map recoveryPointMoveReadinessInfo) { - this.recoveryPointMoveReadinessInfo = recoveryPointMoveReadinessInfo; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (recoveryPointTierDetails() != null) { - recoveryPointTierDetails().forEach(e -> e.validate()); - } - if (recoveryPointMoveReadinessInfo() != null) { - recoveryPointMoveReadinessInfo() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java index eb76e4b99271b..312ad7961e910 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -48,6 +49,7 @@ public class AzureWorkloadRestoreRequest extends RestoreRequest { * Workload specific property bag. */ @JsonProperty(value = "propertyBag") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map propertyBag; /* @@ -63,6 +65,14 @@ public class AzureWorkloadRestoreRequest extends RestoreRequest { @JsonProperty(value = "recoveryMode") 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} + */ + @JsonProperty(value = "targetVirtualMachineId") + private String targetVirtualMachineId; + /** * Get the recoveryType property: Type of this recovery. * @@ -165,6 +175,28 @@ public AzureWorkloadRestoreRequest withRecoveryMode(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; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequestAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequestAutoGenerated.java deleted file mode 100644 index e63f04f5cbc92..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequestAutoGenerated.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.Map; - -/** AzureWorkload-specific restore. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "objectType", - defaultImpl = AzureWorkloadRestoreRequestAutoGenerated.class) -@JsonTypeName("AzureWorkloadRestoreRequest") -@JsonSubTypes({ - @JsonSubTypes.Type( - name = "AzureWorkloadPointInTimeRestoreRequest", - value = AzureWorkloadPointInTimeRestoreRequestAutoGenerated.class), - @JsonSubTypes.Type( - name = "AzureWorkloadSAPHanaRestoreRequest", - value = AzureWorkloadSapHanaRestoreRequestAutoGenerated.class), - @JsonSubTypes.Type( - name = "AzureWorkloadSQLRestoreRequest", - value = AzureWorkloadSqlRestoreRequestAutoGenerated.class) -}) -@Fluent -public class AzureWorkloadRestoreRequestAutoGenerated extends RestoreRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadRestoreRequestAutoGenerated.class); - - /* - * Type of this recovery. - */ - @JsonProperty(value = "recoveryType") - private RecoveryType recoveryType; - - /* - * Fully qualified ARM ID of the VM on which workload that was running is - * being recovered. - */ - @JsonProperty(value = "sourceResourceId") - private String sourceResourceId; - - /* - * Workload specific property bag. - */ - @JsonProperty(value = "propertyBag") - private Map propertyBag; - - /* - * Details of target database - */ - @JsonProperty(value = "targetInfo") - private TargetRestoreInfo targetInfo; - - /* - * Defines whether the current recovery mode is file restore or database - * restore - */ - @JsonProperty(value = "recoveryMode") - private RecoveryMode recoveryMode; - - /* - * This is the complete ARM Id of the target VM - * For e.g. - * /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - */ - @JsonProperty(value = "targetVirtualMachineId") - private String targetVirtualMachineId; - - /** - * 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 AzureWorkloadRestoreRequestAutoGenerated object itself. - */ - public AzureWorkloadRestoreRequestAutoGenerated 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 AzureWorkloadRestoreRequestAutoGenerated object itself. - */ - public AzureWorkloadRestoreRequestAutoGenerated 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 AzureWorkloadRestoreRequestAutoGenerated object itself. - */ - public AzureWorkloadRestoreRequestAutoGenerated 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 AzureWorkloadRestoreRequestAutoGenerated object itself. - */ - public AzureWorkloadRestoreRequestAutoGenerated 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 AzureWorkloadRestoreRequestAutoGenerated object itself. - */ - public AzureWorkloadRestoreRequestAutoGenerated 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 AzureWorkloadRestoreRequestAutoGenerated object itself. - */ - public AzureWorkloadRestoreRequestAutoGenerated withTargetVirtualMachineId(String targetVirtualMachineId) { - this.targetVirtualMachineId = targetVirtualMachineId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (targetInfo() != null) { - targetInfo().validate(); - } - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPoint.java index 4ace230d8253a..f8f218d5bbbdf 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPoint.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPoint.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -16,7 +16,7 @@ /** Recovery point specific to PointInTime in SAPHana. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("AzureWorkloadSAPHanaPointInTimeRecoveryPoint") -@Immutable +@Fluent public final class AzureWorkloadSapHanaPointInTimeRecoveryPoint extends AzureWorkloadPointInTimeRecoveryPoint { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSapHanaPointInTimeRecoveryPoint.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPointAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPointAutoGenerated.java deleted file mode 100644 index fbefc638ecab3..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPointAutoGenerated.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; -import java.util.Map; - -/** Recovery point specific to PointInTime in SAPHana. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("AzureWorkloadSAPHanaPointInTimeRecoveryPoint") -@Immutable -public final class AzureWorkloadSapHanaPointInTimeRecoveryPointAutoGenerated - extends AzureWorkloadPointInTimeRecoveryPointAutoGenerated { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(AzureWorkloadSapHanaPointInTimeRecoveryPointAutoGenerated.class); - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaPointInTimeRecoveryPointAutoGenerated withTimeRanges(List timeRanges) { - super.withTimeRanges(timeRanges); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaPointInTimeRecoveryPointAutoGenerated withRecoveryPointTierDetails( - List recoveryPointTierDetails) { - super.withRecoveryPointTierDetails(recoveryPointTierDetails); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaPointInTimeRecoveryPointAutoGenerated withRecoveryPointMoveReadinessInfo( - Map recoveryPointMoveReadinessInfo) { - super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequest.java index 6261dc78b8d04..cfad19f8793b4 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequest.java @@ -92,6 +92,13 @@ public AzureWorkloadSapHanaPointInTimeRestoreRequest withRecoveryMode(RecoveryMo return this; } + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated.java deleted file mode 100644 index b354d317c1390..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import java.util.Map; - -/** AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("AzureWorkloadSAPHanaPointInTimeRestoreRequest") -@Fluent -public final class AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated - extends AzureWorkloadSapHanaRestoreRequestAutoGenerated { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated.class); - - /* - * PointInTime value - */ - @JsonProperty(value = "pointInTime") - private OffsetDateTime pointInTime; - - /** - * 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 AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated object itself. - */ - public AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated withPointInTime(OffsetDateTime pointInTime) { - this.pointInTime = pointInTime; - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated withTargetVirtualMachineId( - String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.java index 03ace5b0f30f1..90152820ee3ce 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.java @@ -92,6 +92,14 @@ public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withRecoveryMo return this; } + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withTargetVirtualMachineId( + String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPoint.java index 6e27f75870b27..933c341d7c611 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPoint.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPoint.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -16,7 +16,7 @@ /** SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("AzureWorkloadSAPHanaRecoveryPoint") -@Immutable +@Fluent public final class AzureWorkloadSapHanaRecoveryPoint extends AzureWorkloadRecoveryPoint { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSapHanaRecoveryPoint.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPointAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPointAutoGenerated.java deleted file mode 100644 index 7306aecfcad4f..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPointAutoGenerated.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; -import java.util.Map; - -/** SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("AzureWorkloadSAPHanaRecoveryPoint") -@Immutable -public final class AzureWorkloadSapHanaRecoveryPointAutoGenerated extends AzureWorkloadRecoveryPointAutoGenerated { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(AzureWorkloadSapHanaRecoveryPointAutoGenerated.class); - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaRecoveryPointAutoGenerated withRecoveryPointTierDetails( - List recoveryPointTierDetails) { - super.withRecoveryPointTierDetails(recoveryPointTierDetails); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaRecoveryPointAutoGenerated withRecoveryPointMoveReadinessInfo( - Map recoveryPointMoveReadinessInfo) { - super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequest.java index c44d56d6c65e1..3fbfea46cbd54 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequest.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -27,7 +27,7 @@ name = "AzureWorkloadSAPHanaRestoreWithRehydrateRequest", value = AzureWorkloadSapHanaRestoreWithRehydrateRequest.class) }) -@Immutable +@Fluent public class AzureWorkloadSapHanaRestoreRequest extends AzureWorkloadRestoreRequest { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSapHanaRestoreRequest.class); @@ -66,6 +66,13 @@ public AzureWorkloadSapHanaRestoreRequest withRecoveryMode(RecoveryMode recovery return this; } + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequestAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequestAutoGenerated.java deleted file mode 100644 index 283b1302861b9..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequestAutoGenerated.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.Map; - -/** AzureWorkload SAP Hana-specific restore. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "objectType", - defaultImpl = AzureWorkloadSapHanaRestoreRequestAutoGenerated.class) -@JsonTypeName("AzureWorkloadSAPHanaRestoreRequest") -@JsonSubTypes({ - @JsonSubTypes.Type( - name = "AzureWorkloadSAPHanaPointInTimeRestoreRequest", - value = AzureWorkloadSapHanaPointInTimeRestoreRequestAutoGenerated.class) -}) -@Immutable -public class AzureWorkloadSapHanaRestoreRequestAutoGenerated extends AzureWorkloadRestoreRequestAutoGenerated { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(AzureWorkloadSapHanaRestoreRequestAutoGenerated.class); - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaRestoreRequestAutoGenerated withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaRestoreRequestAutoGenerated withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaRestoreRequestAutoGenerated withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaRestoreRequestAutoGenerated withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaRestoreRequestAutoGenerated withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSapHanaRestoreRequestAutoGenerated withTargetVirtualMachineId(String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreWithRehydrateRequest.java index 2a030d8591f49..1650ffb8b4f92 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreWithRehydrateRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreWithRehydrateRequest.java @@ -82,6 +82,13 @@ public AzureWorkloadSapHanaRestoreWithRehydrateRequest withRecoveryMode(Recovery return this; } + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRestoreWithRehydrateRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRecoveryPointAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRecoveryPointAutoGenerated.java deleted file mode 100644 index a8fe7e053f598..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRecoveryPointAutoGenerated.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; -import java.util.Map; - -/** Recovery point specific to PointInTime. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("AzureWorkloadSQLPointInTimeRecoveryPoint") -@Fluent -public final class AzureWorkloadSqlPointInTimeRecoveryPointAutoGenerated - extends AzureWorkloadSqlRecoveryPointAutoGenerated { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(AzureWorkloadSqlPointInTimeRecoveryPointAutoGenerated.class); - - /* - * List of log ranges - */ - @JsonProperty(value = "timeRanges") - private List timeRanges; - - /** - * 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 AzureWorkloadSqlPointInTimeRecoveryPointAutoGenerated object itself. - */ - public AzureWorkloadSqlPointInTimeRecoveryPointAutoGenerated withTimeRanges(List timeRanges) { - this.timeRanges = timeRanges; - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlPointInTimeRecoveryPointAutoGenerated withExtendedInfo( - AzureWorkloadSqlRecoveryPointExtendedInfoAutoGenerated extendedInfo) { - super.withExtendedInfo(extendedInfo); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlPointInTimeRecoveryPointAutoGenerated withRecoveryPointTierDetails( - List recoveryPointTierDetails) { - super.withRecoveryPointTierDetails(recoveryPointTierDetails); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlPointInTimeRecoveryPointAutoGenerated withRecoveryPointMoveReadinessInfo( - Map recoveryPointMoveReadinessInfo) { - super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (timeRanges() != null) { - timeRanges().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequest.java index e7fab2ebed2a9..5e3fe22c088fc 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequest.java @@ -115,6 +115,13 @@ public AzureWorkloadSqlPointInTimeRestoreRequest withRecoveryMode(RecoveryMode r return this; } + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated.java deleted file mode 100644 index 319df87d4d3c8..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** AzureWorkload SQL -specific restore. Specifically for PointInTime/Log restore. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("AzureWorkloadSQLPointInTimeRestoreRequest") -@Fluent -public final class AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated - extends AzureWorkloadSqlRestoreRequestAutoGenerated { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated.class); - - /* - * PointInTime value - */ - @JsonProperty(value = "pointInTime") - private OffsetDateTime pointInTime; - - /** - * 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 AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated object itself. - */ - public AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated withPointInTime(OffsetDateTime pointInTime) { - this.pointInTime = pointInTime; - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated withShouldUseAlternateTargetLocation( - Boolean shouldUseAlternateTargetLocation) { - super.withShouldUseAlternateTargetLocation(shouldUseAlternateTargetLocation); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated withIsNonRecoverable(Boolean isNonRecoverable) { - super.withIsNonRecoverable(isNonRecoverable); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated withAlternateDirectoryPaths( - List alternateDirectoryPaths) { - super.withAlternateDirectoryPaths(alternateDirectoryPaths); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated withTargetVirtualMachineId( - String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.java index 0728ce4d2282e..df69ac771cccc 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.java @@ -115,6 +115,14 @@ public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withRecoveryMode(R return this; } + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withTargetVirtualMachineId( + String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointAutoGenerated.java deleted file mode 100644 index c2049c560180b..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointAutoGenerated.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; -import java.util.Map; - -/** SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "objectType", - defaultImpl = AzureWorkloadSqlRecoveryPointAutoGenerated.class) -@JsonTypeName("AzureWorkloadSQLRecoveryPoint") -@JsonSubTypes({ - @JsonSubTypes.Type( - name = "AzureWorkloadSQLPointInTimeRecoveryPoint", - value = AzureWorkloadSqlPointInTimeRecoveryPointAutoGenerated.class) -}) -@Fluent -public class AzureWorkloadSqlRecoveryPointAutoGenerated extends AzureWorkloadRecoveryPointAutoGenerated { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSqlRecoveryPointAutoGenerated.class); - - /* - * 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 - */ - @JsonProperty(value = "extendedInfo") - private AzureWorkloadSqlRecoveryPointExtendedInfoAutoGenerated extendedInfo; - - /** - * 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 AzureWorkloadSqlRecoveryPointExtendedInfoAutoGenerated 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 AzureWorkloadSqlRecoveryPointAutoGenerated object itself. - */ - public AzureWorkloadSqlRecoveryPointAutoGenerated withExtendedInfo( - AzureWorkloadSqlRecoveryPointExtendedInfoAutoGenerated extendedInfo) { - this.extendedInfo = extendedInfo; - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlRecoveryPointAutoGenerated withRecoveryPointTierDetails( - List recoveryPointTierDetails) { - super.withRecoveryPointTierDetails(recoveryPointTierDetails); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlRecoveryPointAutoGenerated withRecoveryPointMoveReadinessInfo( - Map recoveryPointMoveReadinessInfo) { - super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (extendedInfo() != null) { - extendedInfo().validate(); - } - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointExtendedInfoAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointExtendedInfoAutoGenerated.java deleted file mode 100644 index 449f84dc89a1c..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointExtendedInfoAutoGenerated.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Extended info class details. */ -@Immutable -public final class AzureWorkloadSqlRecoveryPointExtendedInfoAutoGenerated { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(AzureWorkloadSqlRecoveryPointExtendedInfoAutoGenerated.class); - - /* - * UTC time at which data directory info was captured - */ - @JsonProperty(value = "dataDirectoryTimeInUTC", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime dataDirectoryTimeInUtc; - - /* - * List of data directory paths during restore operation. - */ - @JsonProperty(value = "dataDirectoryPaths", access = JsonProperty.Access.WRITE_ONLY) - private List dataDirectoryPaths; - - /** - * 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dataDirectoryPaths() != null) { - dataDirectoryPaths().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequest.java index 96d591f60a0b0..7d513c312f793 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequest.java @@ -154,6 +154,13 @@ public AzureWorkloadSqlRestoreRequest withRecoveryMode(RecoveryMode recoveryMode return this; } + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequestAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequestAutoGenerated.java deleted file mode 100644 index b56bc58fd5b5c..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequestAutoGenerated.java +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; -import java.util.Map; - -/** AzureWorkload SQL -specific restore. Specifically for full/diff restore. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "objectType", - defaultImpl = AzureWorkloadSqlRestoreRequestAutoGenerated.class) -@JsonTypeName("AzureWorkloadSQLRestoreRequest") -@JsonSubTypes({ - @JsonSubTypes.Type( - name = "AzureWorkloadSQLPointInTimeRestoreRequest", - value = AzureWorkloadSqlPointInTimeRestoreRequestAutoGenerated.class) -}) -@Fluent -public class AzureWorkloadSqlRestoreRequestAutoGenerated extends AzureWorkloadRestoreRequestAutoGenerated { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSqlRestoreRequestAutoGenerated.class); - - /* - * Default option set to true. If this is set to false, alternate data - * directory must be provided - */ - @JsonProperty(value = "shouldUseAlternateTargetLocation") - private Boolean shouldUseAlternateTargetLocation; - - /* - * SQL specific property where user can chose to set no-recovery when - * restore operation is tried - */ - @JsonProperty(value = "isNonRecoverable") - private Boolean isNonRecoverable; - - /* - * Data directory details - */ - @JsonProperty(value = "alternateDirectoryPaths") - private List alternateDirectoryPaths; - - /** - * 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 AzureWorkloadSqlRestoreRequestAutoGenerated object itself. - */ - public AzureWorkloadSqlRestoreRequestAutoGenerated 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 AzureWorkloadSqlRestoreRequestAutoGenerated object itself. - */ - public AzureWorkloadSqlRestoreRequestAutoGenerated 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 AzureWorkloadSqlRestoreRequestAutoGenerated object itself. - */ - public AzureWorkloadSqlRestoreRequestAutoGenerated withAlternateDirectoryPaths( - List alternateDirectoryPaths) { - this.alternateDirectoryPaths = alternateDirectoryPaths; - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlRestoreRequestAutoGenerated withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlRestoreRequestAutoGenerated withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlRestoreRequestAutoGenerated withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlRestoreRequestAutoGenerated withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlRestoreRequestAutoGenerated withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureWorkloadSqlRestoreRequestAutoGenerated withTargetVirtualMachineId(String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (alternateDirectoryPaths() != null) { - alternateDirectoryPaths().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreWithRehydrateRequest.java index 1c91ba913389a..5e04a48a82d95 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreWithRehydrateRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreWithRehydrateRequest.java @@ -105,6 +105,13 @@ public AzureWorkloadSqlRestoreWithRehydrateRequest withRecoveryMode(RecoveryMode return this; } + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreWithRehydrateRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupCrrJobDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupCrrJobDetails.java deleted file mode 100644 index fe9810598b4d4..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupCrrJobDetails.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.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. - * @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); - - /** - * 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. - */ - Response getWithResponse(String azureRegion, CrrJobRequest parameters, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupCrrJobs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupCrrJobs.java deleted file mode 100644 index 7e4d01b491f9f..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupCrrJobs.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -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 Backup 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. - */ - PagedIterable list(String azureRegion, CrrJobRequest parameters); - - /** - * Gets the list of CRR jobs from the target region. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Backup 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. - */ - PagedIterable list( - String azureRegion, CrrJobRequest parameters, String filter, String skipToken, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfig.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfig.java index 790dc86dbc1e5..4da821052e8ec 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfig.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfig.java @@ -11,7 +11,7 @@ /** The BackupResourceEncryptionConfig model. */ @Fluent -public final class BackupResourceEncryptionConfig { +public class BackupResourceEncryptionConfig { @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceEncryptionConfig.class); /* diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtended.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtended.java new file mode 100644 index 0000000000000..352070705bb54 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtended.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BackupResourceEncryptionConfigExtended model. */ +@Fluent +public final class BackupResourceEncryptionConfigExtended extends BackupResourceEncryptionConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceEncryptionConfigExtended.class); + + /* + * User Assigned Identity Id + */ + @JsonProperty(value = "userAssignedIdentity") + private String userAssignedIdentity; + + /* + * bool to indicate whether to use system Assigned Identity or not + */ + @JsonProperty(value = "useSystemAssignedIdentity") + private Boolean useSystemAssignedIdentity; + + /** + * Get the userAssignedIdentity property: User Assigned Identity Id. + * + * @return the userAssignedIdentity value. + */ + public String userAssignedIdentity() { + return this.userAssignedIdentity; + } + + /** + * Set the userAssignedIdentity property: User Assigned Identity Id. + * + * @param userAssignedIdentity the userAssignedIdentity value to set. + * @return the BackupResourceEncryptionConfigExtended object itself. + */ + public BackupResourceEncryptionConfigExtended withUserAssignedIdentity(String userAssignedIdentity) { + this.userAssignedIdentity = userAssignedIdentity; + return this; + } + + /** + * Get the useSystemAssignedIdentity property: bool to indicate whether to use system Assigned Identity or not. + * + * @return the useSystemAssignedIdentity value. + */ + public Boolean useSystemAssignedIdentity() { + return this.useSystemAssignedIdentity; + } + + /** + * Set the useSystemAssignedIdentity property: bool to indicate whether to use system Assigned Identity or not. + * + * @param useSystemAssignedIdentity the useSystemAssignedIdentity value to set. + * @return the BackupResourceEncryptionConfigExtended object itself. + */ + public BackupResourceEncryptionConfigExtended withUseSystemAssignedIdentity(Boolean useSystemAssignedIdentity) { + this.useSystemAssignedIdentity = useSystemAssignedIdentity; + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupResourceEncryptionConfigExtended withEncryptionAtRestType(EncryptionAtRestType encryptionAtRestType) { + super.withEncryptionAtRestType(encryptionAtRestType); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupResourceEncryptionConfigExtended withKeyUri(String keyUri) { + super.withKeyUri(keyUri); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupResourceEncryptionConfigExtended withSubscriptionId(String subscriptionId) { + super.withSubscriptionId(subscriptionId); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupResourceEncryptionConfigExtended withLastUpdateStatus(LastUpdateStatus lastUpdateStatus) { + super.withLastUpdateStatus(lastUpdateStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupResourceEncryptionConfigExtended withInfrastructureEncryptionState( + InfrastructureEncryptionState infrastructureEncryptionState) { + super.withInfrastructureEncryptionState(infrastructureEncryptionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadPropertiesResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtendedResource.java similarity index 67% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadPropertiesResource.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtendedResource.java index ab7a7ba8c14c0..476b539c2f98d 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadPropertiesResource.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtendedResource.java @@ -4,11 +4,11 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigExtendedResourceInner; import java.util.Map; -/** An immutable client-side representation of AadPropertiesResource. */ -public interface AadPropertiesResource { +/** An immutable client-side representation of BackupResourceEncryptionConfigExtendedResource. */ +public interface BackupResourceEncryptionConfigExtendedResource { /** * Gets the id property: Fully qualified resource Id for the resource. * @@ -45,11 +45,11 @@ public interface AadPropertiesResource { Map tags(); /** - * Gets the properties property: AADPropertiesResource properties. + * Gets the properties property: BackupResourceEncryptionConfigExtendedResource properties. * * @return the properties value. */ - AadProperties properties(); + BackupResourceEncryptionConfigExtended properties(); /** * Gets the etag property: Optional ETag. @@ -59,9 +59,11 @@ public interface AadPropertiesResource { String etag(); /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner object. + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigExtendedResourceInner + * object. * * @return the inner object. */ - AadPropertiesResourceInner innerModel(); + BackupResourceEncryptionConfigExtendedResourceInner innerModel(); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigResource.java index b246f71403ce5..792aab4caae79 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigResource.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigResource.java @@ -4,66 +4,92 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigResourceInner; +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** An immutable client-side representation of BackupResourceEncryptionConfigResource. */ -public interface BackupResourceEncryptionConfigResource { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); +/** The BackupResourceEncryptionConfigResource model. */ +@Fluent +public final class BackupResourceEncryptionConfigResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceEncryptionConfigResource.class); - /** - * Gets the name property: The name of the resource. - * - * @return the name value. + /* + * BackupResourceEncryptionConfigResource properties */ - String name(); + @JsonProperty(value = "properties") + private BackupResourceEncryptionConfig properties; - /** - * Gets the type property: The type of the resource. - * - * @return the type value. + /* + * Optional ETag. */ - String type(); + @JsonProperty(value = "eTag") + private String etag; /** - * Gets the location property: The geo-location where the resource lives. + * Get the properties property: BackupResourceEncryptionConfigResource properties. * - * @return the location value. + * @return the properties value. */ - String location(); + public BackupResourceEncryptionConfig properties() { + return this.properties; + } /** - * Gets the tags property: Resource tags. + * Set the properties property: BackupResourceEncryptionConfigResource properties. * - * @return the tags value. + * @param properties the properties value to set. + * @return the BackupResourceEncryptionConfigResource object itself. */ - Map tags(); + public BackupResourceEncryptionConfigResource withProperties(BackupResourceEncryptionConfig properties) { + this.properties = properties; + return this; + } /** - * Gets the properties property: BackupResourceEncryptionConfigResource properties. + * Get the etag property: Optional ETag. * - * @return the properties value. + * @return the etag value. */ - BackupResourceEncryptionConfig properties(); + public String etag() { + return this.etag; + } /** - * Gets the etag property: Optional ETag. + * Set the etag property: Optional ETag. * - * @return the etag value. + * @param etag the etag value to set. + * @return the BackupResourceEncryptionConfigResource object itself. */ - String etag(); + public BackupResourceEncryptionConfigResource withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupResourceEncryptionConfigResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupResourceEncryptionConfigResource withTags(Map tags) { + super.withTags(tags); + return this; + } /** - * Gets the inner - * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigResourceInner - * object. + * Validates the instance. * - * @return the inner object. + * @throws IllegalArgumentException thrown if the instance is not valid. */ - BackupResourceEncryptionConfigResourceInner innerModel(); + public void validate() { + if (properties() != null) { + properties().validate(); + } + } } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigs.java index ed743352a46fd..f6fb59bc1da07 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigs.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigs.java @@ -6,7 +6,6 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigResourceInner; /** Resource collection API of BackupResourceEncryptionConfigs. */ public interface BackupResourceEncryptionConfigs { @@ -20,7 +19,7 @@ public interface BackupResourceEncryptionConfigs { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - BackupResourceEncryptionConfigResource get(String vaultName, String resourceGroupName); + BackupResourceEncryptionConfigExtendedResource get(String vaultName, String resourceGroupName); /** * Fetches Vault Encryption config. @@ -33,7 +32,7 @@ public interface BackupResourceEncryptionConfigs { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - Response getWithResponse( + Response getWithResponse( String vaultName, String resourceGroupName, Context context); /** @@ -46,7 +45,7 @@ Response getWithResponse( * @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 update(String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResourceInner parameters); + void update(String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResource parameters); /** * Updates Vault encryption config. @@ -61,8 +60,5 @@ Response getWithResponse( * @return the response. */ Response updateWithResponse( - String vaultName, - String resourceGroupName, - BackupResourceEncryptionConfigResourceInner parameters, - Context context); + String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResource parameters, Context context); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceStorageConfigs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceStorageConfigsNonCrrs.java similarity index 97% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceStorageConfigs.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceStorageConfigsNonCrrs.java index a6a663346f249..6caec7f6496a5 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceStorageConfigs.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceStorageConfigsNonCrrs.java @@ -8,8 +8,8 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; -/** Resource collection API of BackupResourceStorageConfigs. */ -public interface BackupResourceStorageConfigs { +/** Resource collection API of BackupResourceStorageConfigsNonCrrs. */ +public interface BackupResourceStorageConfigsNonCrrs { /** * Fetches resource storage config. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfig.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfig.java index 3dc0a5ffef0fb..96ffb0cbc99b0 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfig.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfig.java @@ -8,6 +8,7 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** Backup resource vault config details. */ @Fluent @@ -45,6 +46,12 @@ public final class BackupResourceVaultConfig { @JsonProperty(value = "softDeleteFeatureState") private SoftDeleteFeatureState softDeleteFeatureState; + /* + * ResourceGuard Operation Requests + */ + @JsonProperty(value = "resourceGuardOperationRequests") + private List resourceGuardOperationRequests; + /** * Get the storageModelType property: Storage type. * @@ -147,6 +154,26 @@ public BackupResourceVaultConfig withSoftDeleteFeatureState(SoftDeleteFeatureSta return this; } + /** + * Get the resourceGuardOperationRequests property: ResourceGuard Operation Requests. + * + * @return the resourceGuardOperationRequests value. + */ + public List resourceGuardOperationRequests() { + return this.resourceGuardOperationRequests; + } + + /** + * Set the resourceGuardOperationRequests property: ResourceGuard Operation Requests. + * + * @param resourceGuardOperationRequests the resourceGuardOperationRequests value to set. + * @return the BackupResourceVaultConfig object itself. + */ + public BackupResourceVaultConfig withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + this.resourceGuardOperationRequests = resourceGuardOperationRequests; + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossRegionRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossRegionRestoreRequest.java deleted file mode 100644 index 4b1fc9f568b92..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossRegionRestoreRequest.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The CrossRegionRestoreRequest model. */ -@Fluent -public final class CrossRegionRestoreRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CrossRegionRestoreRequest.class); - - /* - * Access details for cross region restore - */ - @JsonProperty(value = "crossRegionRestoreAccessDetails") - private CrrAccessToken crossRegionRestoreAccessDetails; - - /* - * Request object for triggering restore - */ - @JsonProperty(value = "restoreRequest") - private RestoreRequest restoreRequest; - - /** - * 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (crossRegionRestoreAccessDetails() != null) { - crossRegionRestoreAccessDetails().validate(); - } - if (restoreRequest() != null) { - restoreRequest().validate(); - } - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossRegionRestores.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossRegionRestores.java deleted file mode 100644 index 315b1860ad81d..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossRegionRestores.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.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. - * @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); - - /** - * 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. - */ - void trigger(String azureRegion, CrossRegionRestoreRequest parameters, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrAccessToken.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrAccessToken.java deleted file mode 100644 index cd189fdcaba04..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrAccessToken.java +++ /dev/null @@ -1,685 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.Map; - -/** The CrrAccessToken model. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "objectType", - defaultImpl = CrrAccessToken.class) -@JsonTypeName("CrrAccessToken") -@JsonSubTypes({@JsonSubTypes.Type(name = "WorkloadCrrAccessToken", value = WorkloadCrrAccessToken.class)}) -@Fluent -public class CrrAccessToken { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CrrAccessToken.class); - - /* - * Access token used for authentication - */ - @JsonProperty(value = "accessTokenString") - private String accessTokenString; - - /* - * Subscription Id of the source vault - */ - @JsonProperty(value = "subscriptionId") - private String subscriptionId; - - /* - * Resource Group name of the source vault - */ - @JsonProperty(value = "resourceGroupName") - private String resourceGroupName; - - /* - * Resource Name of the source vault - */ - @JsonProperty(value = "resourceName") - private String resourceName; - - /* - * Resource Id of the source vault - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /* - * Protected item container id - */ - @JsonProperty(value = "protectionContainerId") - private Long protectionContainerId; - - /* - * Recovery Point Id - */ - @JsonProperty(value = "recoveryPointId") - private String recoveryPointId; - - /* - * Recovery Point Time - */ - @JsonProperty(value = "recoveryPointTime") - private String recoveryPointTime; - - /* - * Container Unique name - */ - @JsonProperty(value = "containerName") - private String containerName; - - /* - * Container Type - */ - @JsonProperty(value = "containerType") - private String containerType; - - /* - * Backup Management Type - */ - @JsonProperty(value = "backupManagementType") - private String backupManagementType; - - /* - * Datasource Type - */ - @JsonProperty(value = "datasourceType") - private String datasourceType; - - /* - * Datasource Friendly Name - */ - @JsonProperty(value = "datasourceName") - private String datasourceName; - - /* - * Datasource Id - */ - @JsonProperty(value = "datasourceId") - private String datasourceId; - - /* - * Datasource Container Unique Name - */ - @JsonProperty(value = "datasourceContainerName") - private String datasourceContainerName; - - /* - * CoordinatorServiceStampId to be used by BCM in restore call - */ - @JsonProperty(value = "coordinatorServiceStampId") - private String coordinatorServiceStampId; - - /* - * CoordinatorServiceStampUri to be used by BCM in restore call - */ - @JsonProperty(value = "coordinatorServiceStampUri") - private String coordinatorServiceStampUri; - - /* - * ProtectionServiceStampId to be used by BCM in restore call - */ - @JsonProperty(value = "protectionServiceStampId") - private String protectionServiceStampId; - - /* - * ProtectionServiceStampUri to be used by BCM in restore call - */ - @JsonProperty(value = "protectionServiceStampUri") - private String protectionServiceStampUri; - - /* - * Extended Information about the token like FileSpec etc. - */ - @JsonProperty(value = "tokenExtendedInformation") - private String tokenExtendedInformation; - - /* - * Recovery point Tier Information - */ - @JsonProperty(value = "rpTierInformation") - private Map rpTierInformation; - - /* - * Recovery point information: Original SA option - */ - @JsonProperty(value = "rpOriginalSAOption") - private Boolean rpOriginalSAOption; - - /* - * Recovery point information: Managed virtual machine - */ - @JsonProperty(value = "rpIsManagedVirtualMachine") - private Boolean rpIsManagedVirtualMachine; - - /* - * Recovery point information: VM size description - */ - @JsonProperty(value = "rpVMSizeDescription") - private String rpVMSizeDescription; - - /* - * Active region name of BMS Stamp - */ - @JsonProperty(value = "bMSActiveRegion") - private String bMSActiveRegion; - - /** - * 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrJobRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrJobRequest.java deleted file mode 100644 index 2d988f5b7f535..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrJobRequest.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Request object for fetching CRR jobs. */ -@Fluent -public final class CrrJobRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CrrJobRequest.class); - - /* - * Entire ARM resource id of the resource - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /* - * Job Name of the job to be fetched - */ - @JsonProperty(value = "jobName") - private String jobName; - - /** - * 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrOperationResults.java deleted file mode 100644 index ba733f011f4cc..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrOperationResults.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of CrrOperationResults. */ -public interface CrrOperationResults { - /** - * @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); - - /** - * @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 response. - */ - Response getWithResponse(String azureRegion, String operationId, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrOperationStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrOperationStatus.java deleted file mode 100644 index dbd96228b00f8..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrOperationStatus.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of CrrOperationStatus. */ -public interface CrrOperationStatus { - /** - * @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); - - /** - * @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. - */ - Response getWithResponse(String azureRegion, String operationId, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmBackupEngine.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmBackupEngine.java index 830fe1202c431..c8e4eb7733c6d 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmBackupEngine.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmBackupEngine.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Data Protection Manager (DPM) specific backup engine. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupEngineType") @JsonTypeName("DpmBackupEngine") -@Immutable +@Fluent public final class DpmBackupEngine extends BackupEngineBase { @JsonIgnore private final ClientLogger logger = new ClientLogger(DpmBackupEngine.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobExtendedInfo.java index 9c7f88af76e6e..f31b1dfe4031a 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobExtendedInfo.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobExtendedInfo.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -26,6 +27,7 @@ public final class DpmJobExtendedInfo { * The job properties. */ @JsonProperty(value = "propertyBag") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map propertyBag; /* diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItem.java index 89b3a598d9ae6..5dad1b5e0dbf5 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItem.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; +import java.util.List; /** Additional information on Backup engine specific backup item. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") @@ -214,6 +215,13 @@ public DpmProtectedItem withIsRehydrate(Boolean isRehydrate) { return this; } + /** {@inheritDoc} */ + @Override + public DpmProtectedItem withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItemExtendedInfo.java index ad750f90a100a..b51c3c42e9664 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItemExtendedInfo.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItemExtendedInfo.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.Map; @@ -20,6 +21,7 @@ public final class DpmProtectedItemExtendedInfo { * Attribute to provide information on various DBs. */ @JsonProperty(value = "protectableObjectLoadPath") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map protectableObjectLoadPath; /* diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainerExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainerExtendedInfo.java index 8dd2d4f050f7b..68fe1feb19dda 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainerExtendedInfo.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainerExtendedInfo.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -31,6 +32,7 @@ public final class GenericContainerExtendedInfo { * Azure Backup Service Endpoints for the container */ @JsonProperty(value = "serviceEndpoints") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map serviceEndpoints; /** diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectedItem.java index 8908c58972f5c..9095f634d8401 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectedItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectedItem.java @@ -7,10 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Base class for backup items. */ @@ -50,6 +52,7 @@ public final class GenericProtectedItem extends ProtectedItem { * protected item) */ @JsonProperty(value = "sourceAssociations") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map sourceAssociations; /* @@ -271,6 +274,13 @@ public GenericProtectedItem withIsRehydrate(Boolean isRehydrate) { return this; } + /** {@inheritDoc} */ + @Override + public GenericProtectedItem withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectionPolicy.java index 57a08f07f8981..3752203360a0d 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectionPolicy.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectionPolicy.java @@ -105,6 +105,13 @@ public GenericProtectionPolicy withProtectedItemsCount(Integer protectedItemsCou return this; } + /** {@inheritDoc} */ + @Override + public GenericProtectionPolicy withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HealthState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HealthState.java deleted file mode 100644 index aa97373f077ae..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HealthState.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for HealthState. */ -public final class HealthState extends ExpandableStringEnum { - /** Static value Passed for HealthState. */ - public static final HealthState PASSED = fromString("Passed"); - - /** Static value ActionRequired for HealthState. */ - public static final HealthState ACTION_REQUIRED = fromString("ActionRequired"); - - /** Static value ActionSuggested for HealthState. */ - public static final HealthState ACTION_SUGGESTED = fromString("ActionSuggested"); - - /** Static value Invalid for HealthState. */ - public static final HealthState INVALID = fromString("Invalid"); - - /** - * Creates or finds a HealthState from its string representation. - * - * @param name a name to look for. - * @return the corresponding HealthState. - */ - @JsonCreator - public static HealthState fromString(String name) { - return fromString(name, HealthState.class); - } - - /** @return known HealthState values. */ - public static Collection values() { - return values(HealthState.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPoint.java index dd851ac1717f0..dd7f1ea5d7751 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPoint.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPoint.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -111,6 +112,7 @@ public final class IaasVMRecoveryPoint extends RecoveryPoint { * Eligibility of RP to be moved to another tier */ @JsonProperty(value = "recoveryPointMoveReadinessInfo") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map recoveryPointMoveReadinessInfo; /** diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPointAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPointAutoGenerated.java deleted file mode 100644 index e7209bd5ba5c4..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPointAutoGenerated.java +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** IaaS VM workload specific backup copy. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("IaasVMRecoveryPoint") -@Fluent -public final class IaasVMRecoveryPointAutoGenerated extends RecoveryPoint { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IaasVMRecoveryPointAutoGenerated.class); - - /* - * Type of the backup copy. - */ - @JsonProperty(value = "recoveryPointType", access = JsonProperty.Access.WRITE_ONLY) - private String recoveryPointType; - - /* - * Time at which this backup copy was created. - */ - @JsonProperty(value = "recoveryPointTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime recoveryPointTime; - - /* - * Additional information associated with this backup copy. - */ - @JsonProperty(value = "recoveryPointAdditionalInfo", access = JsonProperty.Access.WRITE_ONLY) - private String recoveryPointAdditionalInfo; - - /* - * Storage type of the VM whose backup copy is created. - */ - @JsonProperty(value = "sourceVMStorageType", access = JsonProperty.Access.WRITE_ONLY) - private String sourceVMStorageType; - - /* - * Identifies whether the VM was encrypted when the backup copy is created. - */ - @JsonProperty(value = "isSourceVMEncrypted", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isSourceVMEncrypted; - - /* - * Required details for recovering an encrypted VM. Applicable only when - * IsSourceVMEncrypted is true. - */ - @JsonProperty(value = "keyAndSecret") - private KeyAndSecretDetails keyAndSecret; - - /* - * Is the session to recover items from this backup copy still active. - */ - @JsonProperty(value = "isInstantIlrSessionActive") - private Boolean isInstantIlrSessionActive; - - /* - * Recovery point tier information. - */ - @JsonProperty(value = "recoveryPointTierDetails") - private List recoveryPointTierDetails; - - /* - * Whether VM is with Managed Disks - */ - @JsonProperty(value = "isManagedVirtualMachine") - private Boolean isManagedVirtualMachine; - - /* - * Virtual Machine Size - */ - @JsonProperty(value = "virtualMachineSize") - private String virtualMachineSize; - - /* - * Original Storage Account Option - */ - @JsonProperty(value = "originalStorageAccountOption") - private Boolean originalStorageAccountOption; - - /* - * OS type - */ - @JsonProperty(value = "osType") - private String osType; - - /* - * Disk configuration - */ - @JsonProperty(value = "recoveryPointDiskConfiguration") - private RecoveryPointDiskConfiguration recoveryPointDiskConfiguration; - - /* - * Identifies the zone of the VM at the time of backup. Applicable only for - * zone-pinned Vms - */ - @JsonProperty(value = "zones") - private List zones; - - /* - * Eligibility of RP to be moved to another tier - */ - @JsonProperty(value = "recoveryPointMoveReadinessInfo") - private Map recoveryPointMoveReadinessInfo; - - /** - * 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; - } - - /** - * Set the keyAndSecret property: Required details for recovering an encrypted VM. Applicable only when - * IsSourceVMEncrypted is true. - * - * @param keyAndSecret the keyAndSecret value to set. - * @return the IaasVMRecoveryPointAutoGenerated object itself. - */ - public IaasVMRecoveryPointAutoGenerated withKeyAndSecret(KeyAndSecretDetails keyAndSecret) { - this.keyAndSecret = keyAndSecret; - return this; - } - - /** - * 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; - } - - /** - * Set the isInstantIlrSessionActive property: Is the session to recover items from this backup copy still active. - * - * @param isInstantIlrSessionActive the isInstantIlrSessionActive value to set. - * @return the IaasVMRecoveryPointAutoGenerated object itself. - */ - public IaasVMRecoveryPointAutoGenerated withIsInstantIlrSessionActive(Boolean isInstantIlrSessionActive) { - this.isInstantIlrSessionActive = isInstantIlrSessionActive; - 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 IaasVMRecoveryPointAutoGenerated object itself. - */ - public IaasVMRecoveryPointAutoGenerated withRecoveryPointTierDetails( - List recoveryPointTierDetails) { - this.recoveryPointTierDetails = recoveryPointTierDetails; - return this; - } - - /** - * Get the isManagedVirtualMachine property: Whether VM is with Managed Disks. - * - * @return the isManagedVirtualMachine value. - */ - public Boolean isManagedVirtualMachine() { - return this.isManagedVirtualMachine; - } - - /** - * Set the isManagedVirtualMachine property: Whether VM is with Managed Disks. - * - * @param isManagedVirtualMachine the isManagedVirtualMachine value to set. - * @return the IaasVMRecoveryPointAutoGenerated object itself. - */ - public IaasVMRecoveryPointAutoGenerated withIsManagedVirtualMachine(Boolean isManagedVirtualMachine) { - this.isManagedVirtualMachine = isManagedVirtualMachine; - return this; - } - - /** - * Get the virtualMachineSize property: Virtual Machine Size. - * - * @return the virtualMachineSize value. - */ - public String virtualMachineSize() { - return this.virtualMachineSize; - } - - /** - * Set the virtualMachineSize property: Virtual Machine Size. - * - * @param virtualMachineSize the virtualMachineSize value to set. - * @return the IaasVMRecoveryPointAutoGenerated object itself. - */ - public IaasVMRecoveryPointAutoGenerated withVirtualMachineSize(String virtualMachineSize) { - this.virtualMachineSize = virtualMachineSize; - 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 IaasVMRecoveryPointAutoGenerated object itself. - */ - public IaasVMRecoveryPointAutoGenerated withOriginalStorageAccountOption(Boolean originalStorageAccountOption) { - this.originalStorageAccountOption = originalStorageAccountOption; - return this; - } - - /** - * Get the osType property: OS type. - * - * @return the osType value. - */ - public String osType() { - return this.osType; - } - - /** - * Set the osType property: OS type. - * - * @param osType the osType value to set. - * @return the IaasVMRecoveryPointAutoGenerated object itself. - */ - public IaasVMRecoveryPointAutoGenerated withOsType(String osType) { - this.osType = osType; - return this; - } - - /** - * Get the recoveryPointDiskConfiguration property: Disk configuration. - * - * @return the recoveryPointDiskConfiguration value. - */ - public RecoveryPointDiskConfiguration recoveryPointDiskConfiguration() { - return this.recoveryPointDiskConfiguration; - } - - /** - * Set the recoveryPointDiskConfiguration property: Disk configuration. - * - * @param recoveryPointDiskConfiguration the recoveryPointDiskConfiguration value to set. - * @return the IaasVMRecoveryPointAutoGenerated object itself. - */ - public IaasVMRecoveryPointAutoGenerated withRecoveryPointDiskConfiguration( - RecoveryPointDiskConfiguration recoveryPointDiskConfiguration) { - this.recoveryPointDiskConfiguration = recoveryPointDiskConfiguration; - return this; - } - - /** - * 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; - } - - /** - * Set the zones property: Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms. - * - * @param zones the zones value to set. - * @return the IaasVMRecoveryPointAutoGenerated object itself. - */ - public IaasVMRecoveryPointAutoGenerated withZones(List zones) { - this.zones = zones; - 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 IaasVMRecoveryPointAutoGenerated object itself. - */ - public IaasVMRecoveryPointAutoGenerated withRecoveryPointMoveReadinessInfo( - Map recoveryPointMoveReadinessInfo) { - this.recoveryPointMoveReadinessInfo = recoveryPointMoveReadinessInfo; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (keyAndSecret() != null) { - keyAndSecret().validate(); - } - if (recoveryPointTierDetails() != null) { - recoveryPointTierDetails().forEach(e -> e.validate()); - } - if (recoveryPointDiskConfiguration() != null) { - recoveryPointDiskConfiguration().validate(); - } - if (recoveryPointMoveReadinessInfo() != null) { - recoveryPointMoveReadinessInfo() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreRequest.java index 0aaa92b8d7bf9..f5d66957b55d5 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreRequest.java @@ -153,6 +153,13 @@ public class IaasVMRestoreRequest extends RestoreRequest { @JsonProperty(value = "zones") private List zones; + /* + * Managed Identity information required to access customer storage + * account. + */ + @JsonProperty(value = "identityInfo") + private IdentityInfo identityInfo; + /** * Get the recoveryPointId property: ID of the backup copy to be recovered. * @@ -535,6 +542,26 @@ public IaasVMRestoreRequest withZones(List 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; + } + /** * Validates the instance. * @@ -546,5 +573,8 @@ public void validate() { if (encryptionDetails() != null) { encryptionDetails().validate(); } + if (identityInfo() != null) { + identityInfo().validate(); + } } } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreWithRehydrationRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreWithRehydrationRequest.java index 96468215adb5a..bdce6f80f8f9b 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreWithRehydrationRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreWithRehydrationRequest.java @@ -172,6 +172,13 @@ public IaasVMRestoreWithRehydrationRequest withZones(List zones) { return this; } + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withIdentityInfo(IdentityInfo identityInfo) { + super.withIdentityInfo(identityInfo); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IdentityInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IdentityInfo.java new file mode 100644 index 0000000000000..fcf596511d2d4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IdentityInfo.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Encapsulates Managed Identity related information. */ +@Fluent +public final class IdentityInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityInfo.class); + + /* + * To differentiate if the managed identity is system assigned or user + * assigned + */ + @JsonProperty(value = "isSystemAssignedIdentity") + private Boolean isSystemAssignedIdentity; + + /* + * Managed Identity Resource Id + * Optional: Might not be required in the case of system assigned managed + * identity + */ + @JsonProperty(value = "managedIdentityResourceId") + private String managedIdentityResourceId; + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IntentItemType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IntentItemType.java deleted file mode 100644 index cf23791139238..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IntentItemType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for IntentItemType. */ -public final class IntentItemType extends ExpandableStringEnum { - /** Static value Invalid for IntentItemType. */ - public static final IntentItemType INVALID = fromString("Invalid"); - - /** Static value SQLInstance for IntentItemType. */ - public static final IntentItemType SQLINSTANCE = fromString("SQLInstance"); - - /** Static value SQLAvailabilityGroupContainer for IntentItemType. */ - public static final IntentItemType SQLAVAILABILITY_GROUP_CONTAINER = fromString("SQLAvailabilityGroupContainer"); - - /** - * Creates or finds a IntentItemType from its string representation. - * - * @param name a name to look for. - * @return the corresponding IntentItemType. - */ - @JsonCreator - public static IntentItemType fromString(String name) { - return fromString(name, IntentItemType.class); - } - - /** @return known IntentItemType values. */ - public static Collection values() { - return values(IntentItemType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobOperationType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobOperationType.java deleted file mode 100644 index 2edbd820e7c8a..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobOperationType.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for JobOperationType. */ -public final class JobOperationType extends ExpandableStringEnum { - /** Static value Invalid for JobOperationType. */ - public static final JobOperationType INVALID = fromString("Invalid"); - - /** Static value Register for JobOperationType. */ - public static final JobOperationType REGISTER = fromString("Register"); - - /** Static value UnRegister for JobOperationType. */ - public static final JobOperationType UN_REGISTER = fromString("UnRegister"); - - /** Static value ConfigureBackup for JobOperationType. */ - public static final JobOperationType CONFIGURE_BACKUP = fromString("ConfigureBackup"); - - /** Static value Backup for JobOperationType. */ - public static final JobOperationType BACKUP = fromString("Backup"); - - /** Static value Restore for JobOperationType. */ - public static final JobOperationType RESTORE = fromString("Restore"); - - /** Static value DisableBackup for JobOperationType. */ - public static final JobOperationType DISABLE_BACKUP = fromString("DisableBackup"); - - /** Static value DeleteBackupData for JobOperationType. */ - public static final JobOperationType DELETE_BACKUP_DATA = fromString("DeleteBackupData"); - - /** Static value CrossRegionRestore for JobOperationType. */ - public static final JobOperationType CROSS_REGION_RESTORE = fromString("CrossRegionRestore"); - - /** Static value Undelete for JobOperationType. */ - public static final JobOperationType UNDELETE = fromString("Undelete"); - - /** Static value UpdateCustomerManagedKey for JobOperationType. */ - public static final JobOperationType UPDATE_CUSTOMER_MANAGED_KEY = fromString("UpdateCustomerManagedKey"); - - /** - * Creates or finds a JobOperationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding JobOperationType. - */ - @JsonCreator - public static JobOperationType fromString(String name) { - return fromString(name, JobOperationType.class); - } - - /** @return known JobOperationType values. */ - public static Collection values() { - return values(JobOperationType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobStatus.java deleted file mode 100644 index 0b95023798d7f..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobStatus.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for JobStatus. */ -public final class JobStatus extends ExpandableStringEnum { - /** Static value Invalid for JobStatus. */ - public static final JobStatus INVALID = fromString("Invalid"); - - /** Static value InProgress for JobStatus. */ - public static final JobStatus IN_PROGRESS = fromString("InProgress"); - - /** Static value Completed for JobStatus. */ - public static final JobStatus COMPLETED = fromString("Completed"); - - /** Static value Failed for JobStatus. */ - public static final JobStatus FAILED = fromString("Failed"); - - /** Static value CompletedWithWarnings for JobStatus. */ - public static final JobStatus COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); - - /** Static value Cancelled for JobStatus. */ - public static final JobStatus CANCELLED = fromString("Cancelled"); - - /** Static value Cancelling for JobStatus. */ - public static final JobStatus CANCELLING = fromString("Cancelling"); - - /** - * Creates or finds a JobStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding JobStatus. - */ - @JsonCreator - public static JobStatus fromString(String name) { - return fromString(name, JobStatus.class); - } - - /** @return known JobStatus values. */ - public static Collection values() { - return values(JobStatus.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastUpdateStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastUpdateStatus.java index 4747da65b7f3e..d073ca9112816 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastUpdateStatus.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastUpdateStatus.java @@ -28,6 +28,12 @@ public final class LastUpdateStatus extends ExpandableStringEnum resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobExtendedInfo.java index 8f2cc52a60b44..5ac0a0ff66fcc 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobExtendedInfo.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobExtendedInfo.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -26,6 +27,7 @@ public final class MabJobExtendedInfo { * The job properties. */ @JsonProperty(value = "propertyBag") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map propertyBag; /* diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabProtectionPolicy.java index 0c6f8c1e5146e..2cb03a199e603 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabProtectionPolicy.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabProtectionPolicy.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** Mab container-specific backup policy. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType") @@ -77,6 +78,13 @@ public MabProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) return this; } + /** {@inheritDoc} */ + @Override + public MabProtectionPolicy withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + super.withResourceGuardOperationRequests(resourceGuardOperationRequests); + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItemsCrrs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationOperations.java similarity index 62% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItemsCrrs.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationOperations.java index f939a3ca121d7..92004feb40e21 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItemsCrrs.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationOperations.java @@ -4,36 +4,37 @@ package com.azure.resourcemanager.recoveryservicesbackup.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 BackupProtectedItemsCrrs. */ -public interface BackupProtectedItemsCrrs { +/** Resource collection API of OperationOperations. */ +public interface OperationOperations { /** - * Provides a pageable list of all items that are backed up within a vault. + * Validate operation for specified backed up item. This is a synchronous operation. * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation 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 list of ProtectedItem resources. + * @return the response. */ - PagedIterable list(String vaultName, String resourceGroupName); + ValidateOperationsResponse validate( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters); /** - * Provides a pageable list of all items that are backed up within a vault. + * Validate operation for specified backed up item. This is a synchronous operation. * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param filter OData filter options. - * @param skipToken skipToken Filter. + * @param parameters resource validate operation 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 list of ProtectedItem resources. + * @return the response. */ - PagedIterable list( - String vaultName, String resourceGroupName, String filter, String skipToken, Context context); + Response validateWithResponse( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusExtendedInfo.java index 0936178444330..ec55ff3bae6e3 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusExtendedInfo.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusExtendedInfo.java @@ -23,10 +23,7 @@ @JsonSubTypes.Type(name = "OperationStatusJobsExtendedInfo", value = OperationStatusJobsExtendedInfo.class), @JsonSubTypes.Type( name = "OperationStatusProvisionILRExtendedInfo", - value = OperationStatusProvisionIlrExtendedInfo.class), - @JsonSubTypes.Type( - name = "OperationStatusRecoveryPointExtendedInfo", - value = OperationStatusRecoveryPointExtendedInfo.class) + value = OperationStatusProvisionIlrExtendedInfo.class) }) @Immutable public class OperationStatusExtendedInfo { diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobsExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobsExtendedInfo.java index 6a83e5880bb1f..93df1c01b7810 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobsExtendedInfo.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobsExtendedInfo.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -30,6 +31,7 @@ public final class OperationStatusJobsExtendedInfo extends OperationStatusExtend * Stores all the failed jobs along with the corresponding error codes. */ @JsonProperty(value = "failedJobsError") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map failedJobsError; /** diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusRecoveryPointExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusRecoveryPointExtendedInfo.java deleted file mode 100644 index b2e898ec62b6c..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusRecoveryPointExtendedInfo.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Operation status extended info for Updated Recovery Point. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("OperationStatusRecoveryPointExtendedInfo") -@Fluent -public final class OperationStatusRecoveryPointExtendedInfo extends OperationStatusExtendedInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusRecoveryPointExtendedInfo.class); - - /* - * Recovery Point info with updated source snapshot URI - */ - @JsonProperty(value = "updatedRecoveryPoint") - private RecoveryPoint updatedRecoveryPoint; - - /* - * In case the share is in soft-deleted state, populate this field with - * deleted backup item - */ - @JsonProperty(value = "deletedBackupItemVersion") - private String deletedBackupItemVersion; - - /** - * Get the updatedRecoveryPoint property: Recovery Point info with updated source snapshot URI. - * - * @return the updatedRecoveryPoint value. - */ - public RecoveryPoint updatedRecoveryPoint() { - return this.updatedRecoveryPoint; - } - - /** - * Set the updatedRecoveryPoint property: Recovery Point info with updated source snapshot URI. - * - * @param updatedRecoveryPoint the updatedRecoveryPoint value to set. - * @return the OperationStatusRecoveryPointExtendedInfo object itself. - */ - public OperationStatusRecoveryPointExtendedInfo withUpdatedRecoveryPoint(RecoveryPoint updatedRecoveryPoint) { - this.updatedRecoveryPoint = updatedRecoveryPoint; - return this; - } - - /** - * 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; - } - - /** - * Set the deletedBackupItemVersion property: In case the share is in soft-deleted state, populate this field with - * deleted backup item. - * - * @param deletedBackupItemVersion the deletedBackupItemVersion value to set. - * @return the OperationStatusRecoveryPointExtendedInfo object itself. - */ - public OperationStatusRecoveryPointExtendedInfo withDeletedBackupItemVersion(String deletedBackupItemVersion) { - this.deletedBackupItemVersion = deletedBackupItemVersion; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (updatedRecoveryPoint() != null) { - updatedRecoveryPoint().validate(); - } - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationWorkerResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationWorkerResponse.java index d9b23e9971928..c29b0b22afe3b 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationWorkerResponse.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationWorkerResponse.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -26,6 +27,7 @@ public class OperationWorkerResponse { * HTTP headers associated with this operation. */ @JsonProperty(value = "headers") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map> headers; /** diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Operations.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Operations.java index 5b574951c83a6..cbaec37608679 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Operations.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Operations.java @@ -4,37 +4,28 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; /** Resource collection API of Operations. */ public interface Operations { /** - * Validate operation for specified backed up item. This is a synchronous operation. + * Returns the list of available operations. * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param parameters resource validate operation 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 response. + * @return operations List response which contains list of available APIs. */ - ValidateOperationsResponse validate( - String vaultName, String resourceGroupName, ValidateOperationRequest parameters); + PagedIterable list(); /** - * Validate operation for specified backed up item. This is a synchronous operation. + * Returns the list of available operations. * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param parameters resource validate operation 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 response. + * @return operations List response which contains list of available APIs. */ - Response validateWithResponse( - String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context); + PagedIterable list(Context context); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationsOperations.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationsOperations.java deleted file mode 100644 index d6bca099827f4..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationsOperations.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of OperationsOperations. */ -public interface OperationsOperations { - /** - * Returns the list of available operations. - * - * @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 operations List response which contains list of available APIs. - */ - PagedIterable list(); - - /** - * Returns the list of available operations. - * - * @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 operations List response which contains list of available APIs. - */ - PagedIterable list(Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveResponse.java index bec748d799ac0..8c058516c6e04 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveResponse.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveResponse.java @@ -8,6 +8,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -30,6 +31,7 @@ public final class PrepareDataMoveResponse extends VaultStorageConfigOperationRe * Source Vault Properties */ @JsonProperty(value = "sourceVaultProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map sourceVaultProperties; /** diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItem.java index ac07ce3bf73c6..7f6c307ec08d3 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItem.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItem.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; +import java.util.List; /** Base class for backup items. */ @JsonTypeInfo( @@ -27,8 +28,7 @@ @JsonSubTypes.Type(name = "AzureVmWorkloadProtectedItem", value = AzureVmWorkloadProtectedItem.class), @JsonSubTypes.Type(name = "DPMProtectedItem", value = DpmProtectedItem.class), @JsonSubTypes.Type(name = "GenericProtectedItem", value = GenericProtectedItem.class), - @JsonSubTypes.Type(name = "MabFileFolderProtectedItem", value = MabFileFolderProtectedItem.class), - @JsonSubTypes.Type(name = "AzureFileShareProtectedItem", value = AzureFileshareProtectedItemAutoGenerated.class) + @JsonSubTypes.Type(name = "MabFileFolderProtectedItem", value = MabFileFolderProtectedItem.class) }) @Fluent public class ProtectedItem { @@ -116,6 +116,12 @@ public class ProtectedItem { @JsonProperty(value = "isRehydrate") private Boolean isRehydrate; + /* + * ResourceGuardOperationRequests on which LAC check will be performed + */ + @JsonProperty(value = "resourceGuardOperationRequests") + private List resourceGuardOperationRequests; + /** * Get the backupManagementType property: Type of backup management for the backed up item. * @@ -384,6 +390,28 @@ public ProtectedItem withIsRehydrate(Boolean 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. + */ + public ProtectedItem withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + this.resourceGuardOperationRequests = resourceGuardOperationRequests; + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicy.java index 75b01d0c1445a..e762b8d17704d 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicy.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicy.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** Base class for backup policy. Workload-specific backup policies are derived from this class. */ @JsonTypeInfo( @@ -37,6 +38,12 @@ public class ProtectionPolicy { @JsonProperty(value = "protectedItemsCount") private Integer protectedItemsCount; + /* + * ResourceGuard Operation Requests + */ + @JsonProperty(value = "resourceGuardOperationRequests") + private List resourceGuardOperationRequests; + /** * Get the protectedItemsCount property: Number of items associated with this policy. * @@ -57,6 +64,26 @@ public ProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { return this; } + /** + * Get the resourceGuardOperationRequests property: ResourceGuard Operation Requests. + * + * @return the resourceGuardOperationRequests value. + */ + public List resourceGuardOperationRequests() { + return this.resourceGuardOperationRequests; + } + + /** + * Set the resourceGuardOperationRequests property: ResourceGuard Operation Requests. + * + * @param resourceGuardOperationRequests the resourceGuardOperationRequests value to set. + * @return the ProtectionPolicy object itself. + */ + public ProtectionPolicy withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + this.resourceGuardOperationRequests = resourceGuardOperationRequests; + return this; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoint.java index 171bc8635ba4a..43561aacd39f0 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoint.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoint.java @@ -22,10 +22,7 @@ @JsonSubTypes.Type(name = "AzureFileShareRecoveryPoint", value = AzureFileShareRecoveryPoint.class), @JsonSubTypes.Type(name = "AzureWorkloadRecoveryPoint", value = AzureWorkloadRecoveryPoint.class), @JsonSubTypes.Type(name = "GenericRecoveryPoint", value = GenericRecoveryPoint.class), - @JsonSubTypes.Type(name = "IaasVMRecoveryPoint", value = IaasVMRecoveryPoint.class), - @JsonSubTypes.Type(name = "AzureFileShareRecoveryPoint", value = AzureFileShareRecoveryPointAutoGenerated.class), - @JsonSubTypes.Type(name = "AzureWorkloadRecoveryPoint", value = AzureWorkloadRecoveryPointAutoGenerated.class), - @JsonSubTypes.Type(name = "IaasVMRecoveryPoint", value = IaasVMRecoveryPointAutoGenerated.class) + @JsonSubTypes.Type(name = "IaasVMRecoveryPoint", value = IaasVMRecoveryPoint.class) }) @Immutable public class RecoveryPoint { diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformation.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformation.java index cbbab0feabb84..9e41ff77decc9 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformation.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformation.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -31,6 +32,7 @@ public final class RecoveryPointTierInformation { * Recovery point tier status. */ @JsonProperty(value = "extendedInfo") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map extendedInfo; /** diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoints.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoints.java index 5c6ff7e9272b3..01a2a54ce8152 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoints.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoints.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; /** Resource collection API of RecoveryPoints. */ public interface RecoveryPoints { @@ -98,54 +97,4 @@ Response getWithResponse( String protectedItemName, String recoveryPointId, Context context); - - /** - * Returns the Access token for communication between BMS and Protection service. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - CrrAccessTokenResource getAccessToken( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String recoveryPointId, - AadPropertiesResourceInner parameters); - - /** - * Returns the Access token for communication between BMS and Protection service. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response getAccessTokenWithResponse( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String recoveryPointId, - AadPropertiesResourceInner parameters, - Context context); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointsCrrs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointsCrrs.java deleted file mode 100644 index 268ba7c236dbd..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointsCrrs.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of RecoveryPointsCrrs. */ -public interface RecoveryPointsCrrs { - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name associated with the backed up item. - * @param containerName Container name associated with the backed up item. - * @param protectedItemName Backed up item whose backup copies are to be fetched. - * @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. - */ - PagedIterable list( - String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName); - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name associated with the backed up item. - * @param containerName Container name associated with the backed up item. - * @param protectedItemName Backed up item whose backup copies are to be fetched. - * @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. - */ - PagedIterable list( - String vaultName, - String resourceGroupName, - String fabricName, - String containerName, - String protectedItemName, - String filter, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardOperationDetail.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardOperationDetail.java new file mode 100644 index 0000000000000..22844ca472cbc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardOperationDetail.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourceGuardOperationDetail model. */ +@Fluent +public final class ResourceGuardOperationDetail { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGuardOperationDetail.class); + + /* + * The vaultCriticalOperation property. + */ + @JsonProperty(value = "vaultCriticalOperation") + private String vaultCriticalOperation; + + /* + * The defaultResourceRequest property. + */ + @JsonProperty(value = "defaultResourceRequest") + private String defaultResourceRequest; + + /** + * Get the vaultCriticalOperation property: The vaultCriticalOperation property. + * + * @return the vaultCriticalOperation value. + */ + public String vaultCriticalOperation() { + return this.vaultCriticalOperation; + } + + /** + * Set the vaultCriticalOperation property: The vaultCriticalOperation property. + * + * @param vaultCriticalOperation the vaultCriticalOperation value to set. + * @return the ResourceGuardOperationDetail object itself. + */ + public ResourceGuardOperationDetail withVaultCriticalOperation(String vaultCriticalOperation) { + this.vaultCriticalOperation = vaultCriticalOperation; + return this; + } + + /** + * Get the defaultResourceRequest property: The defaultResourceRequest property. + * + * @return the defaultResourceRequest value. + */ + public String defaultResourceRequest() { + return this.defaultResourceRequest; + } + + /** + * Set the defaultResourceRequest property: The defaultResourceRequest property. + * + * @param defaultResourceRequest the defaultResourceRequest value to set. + * @return the ResourceGuardOperationDetail object itself. + */ + public ResourceGuardOperationDetail withDefaultResourceRequest(String defaultResourceRequest) { + this.defaultResourceRequest = defaultResourceRequest; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupUsageSummariesCrrs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxies.java similarity index 67% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupUsageSummariesCrrs.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxies.java index befb36adb388b..45f44ec64451a 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupUsageSummariesCrrs.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxies.java @@ -7,33 +7,30 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of BackupUsageSummariesCrrs. */ -public interface BackupUsageSummariesCrrs { +/** Resource collection API of ResourceGuardProxies. */ +public interface ResourceGuardProxies { /** - * Fetches the backup management usage summaries of the vault. + * List the ResourceGuardProxies under vault. * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. * @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. + * @return list of ResourceGuardProxyBase resources. */ - PagedIterable list(String vaultName, String resourceGroupName); + PagedIterable get(String vaultName, String resourceGroupName); /** - * Fetches the backup management usage summaries of the vault. + * List the ResourceGuardProxies under vault. * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @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. + * @return list of ResourceGuardProxyBase resources. */ - PagedIterable list( - String vaultName, String resourceGroupName, String filter, String skipToken, Context context); + PagedIterable get(String vaultName, String resourceGroupName, Context context); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBase.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBase.java new file mode 100644 index 0000000000000..ede04138dadb9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBase.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceGuardProxyBase model. */ +@Fluent +public final class ResourceGuardProxyBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGuardProxyBase.class); + + /* + * The resourceGuardResourceId property. + */ + @JsonProperty(value = "resourceGuardResourceId") + private String resourceGuardResourceId; + + /* + * The resourceGuardOperationDetails property. + */ + @JsonProperty(value = "resourceGuardOperationDetails") + private List resourceGuardOperationDetails; + + /* + * The lastUpdatedTime property. + */ + @JsonProperty(value = "lastUpdatedTime") + private String lastUpdatedTime; + + /* + * The description property. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the resourceGuardResourceId property: The resourceGuardResourceId property. + * + * @return the resourceGuardResourceId value. + */ + public String resourceGuardResourceId() { + return this.resourceGuardResourceId; + } + + /** + * Set the resourceGuardResourceId property: The resourceGuardResourceId property. + * + * @param resourceGuardResourceId the resourceGuardResourceId value to set. + * @return the ResourceGuardProxyBase object itself. + */ + public ResourceGuardProxyBase withResourceGuardResourceId(String resourceGuardResourceId) { + this.resourceGuardResourceId = resourceGuardResourceId; + return this; + } + + /** + * Get the resourceGuardOperationDetails property: The resourceGuardOperationDetails property. + * + * @return the resourceGuardOperationDetails value. + */ + public List resourceGuardOperationDetails() { + return this.resourceGuardOperationDetails; + } + + /** + * Set the resourceGuardOperationDetails property: The resourceGuardOperationDetails property. + * + * @param resourceGuardOperationDetails the resourceGuardOperationDetails value to set. + * @return the ResourceGuardProxyBase object itself. + */ + public ResourceGuardProxyBase withResourceGuardOperationDetails( + List resourceGuardOperationDetails) { + this.resourceGuardOperationDetails = resourceGuardOperationDetails; + return this; + } + + /** + * Get the lastUpdatedTime property: The lastUpdatedTime property. + * + * @return the lastUpdatedTime value. + */ + public String lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Set the lastUpdatedTime property: The lastUpdatedTime property. + * + * @param lastUpdatedTime the lastUpdatedTime value to set. + * @return the ResourceGuardProxyBase object itself. + */ + public ResourceGuardProxyBase withLastUpdatedTime(String lastUpdatedTime) { + this.lastUpdatedTime = lastUpdatedTime; + return this; + } + + /** + * Get the description property: The description property. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description property. + * + * @param description the description value to set. + * @return the ResourceGuardProxyBase object itself. + */ + public ResourceGuardProxyBase withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceGuardOperationDetails() != null) { + resourceGuardOperationDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrAccessTokenResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBaseResource.java similarity index 75% rename from sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrAccessTokenResource.java rename to sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBaseResource.java index d81f692bc000b..6f7e49dd43d94 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrAccessTokenResource.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBaseResource.java @@ -4,11 +4,11 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrrAccessTokenResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; import java.util.Map; -/** An immutable client-side representation of CrrAccessTokenResource. */ -public interface CrrAccessTokenResource { +/** An immutable client-side representation of ResourceGuardProxyBaseResource. */ +public interface ResourceGuardProxyBaseResource { /** * Gets the id property: Fully qualified resource Id for the resource. * @@ -45,11 +45,11 @@ public interface CrrAccessTokenResource { Map tags(); /** - * Gets the properties property: CrrAccessTokenResource properties. + * Gets the properties property: ResourceGuardProxyBaseResource properties. * * @return the properties value. */ - CrrAccessToken properties(); + ResourceGuardProxyBase properties(); /** * Gets the etag property: Optional ETag. @@ -59,9 +59,10 @@ public interface CrrAccessTokenResource { String etag(); /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrrAccessTokenResourceInner object. + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner + * object. * * @return the inner object. */ - CrrAccessTokenResourceInner innerModel(); + ResourceGuardProxyBaseResourceInner innerModel(); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBaseResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBaseResourceList.java new file mode 100644 index 0000000000000..972435082a102 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBaseResourceList.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of ResourceGuardProxyBase resources. */ +@Fluent +public final class ResourceGuardProxyBaseResourceList extends ResourceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGuardProxyBaseResourceList.class); + + /* + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of resources. + * + * @param value the value value to set. + * @return the ResourceGuardProxyBaseResourceList object itself. + */ + public ResourceGuardProxyBaseResourceList withValue(List value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceGuardProxyBaseResourceList withNextLink(String nextLink) { + super.withNextLink(nextLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyOperations.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyOperations.java new file mode 100644 index 0000000000000..28ef071729b85 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyOperations.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceGuardProxyOperations. */ +public interface ResourceGuardProxyOperations { + /** + * Returns ResourceGuardProxy under vault and with the name referenced in request. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 the response. + */ + ResourceGuardProxyBaseResource get(String vaultName, String resourceGroupName, String resourceGuardProxyName); + + /** + * Returns ResourceGuardProxy under vault and with the name referenced in request. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + Response getWithResponse( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context); + + /** + * Add or Update ResourceGuardProxy under vault Secures vault critical operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 the response. + */ + ResourceGuardProxyBaseResource put(String vaultName, String resourceGroupName, String resourceGuardProxyName); + + /** + * Add or Update ResourceGuardProxy under vault Secures vault critical operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + Response putWithResponse( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context); + + /** + * Delete ResourceGuardProxy under vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 delete(String vaultName, String resourceGroupName, String resourceGuardProxyName); + + /** + * Delete ResourceGuardProxy under vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName 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 response. + */ + Response deleteWithResponse( + String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context); + + /** + * Secures delete ResourceGuardProxy operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName parameter. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of Unlock Delete API. + */ + UnlockDeleteResponse unlockDelete( + String vaultName, String resourceGroupName, String resourceGuardProxyName, UnlockDeleteRequest parameters); + + /** + * Secures delete ResourceGuardProxy operations. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param resourceGuardProxyName The resourceGuardProxyName parameter. + * @param parameters Request body for operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of Unlock Delete API. + */ + Response unlockDeleteWithResponse( + String vaultName, + String resourceGroupName, + String resourceGuardProxyName, + UnlockDeleteRequest parameters, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestorePointQueryType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestorePointQueryType.java deleted file mode 100644 index 40e89e5a31429..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestorePointQueryType.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RestorePointQueryType. */ -public final class RestorePointQueryType extends ExpandableStringEnum { - /** Static value Invalid for RestorePointQueryType. */ - public static final RestorePointQueryType INVALID = fromString("Invalid"); - - /** Static value Full for RestorePointQueryType. */ - public static final RestorePointQueryType FULL = fromString("Full"); - - /** Static value Log for RestorePointQueryType. */ - public static final RestorePointQueryType LOG = fromString("Log"); - - /** Static value Differential for RestorePointQueryType. */ - public static final RestorePointQueryType DIFFERENTIAL = fromString("Differential"); - - /** Static value FullAndDifferential for RestorePointQueryType. */ - public static final RestorePointQueryType FULL_AND_DIFFERENTIAL = fromString("FullAndDifferential"); - - /** Static value All for RestorePointQueryType. */ - public static final RestorePointQueryType ALL = fromString("All"); - - /** Static value Incremental for RestorePointQueryType. */ - public static final RestorePointQueryType INCREMENTAL = fromString("Incremental"); - - /** - * Creates or finds a RestorePointQueryType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RestorePointQueryType. - */ - @JsonCreator - public static RestorePointQueryType fromString(String name) { - return fromString(name, RestorePointQueryType.class); - } - - /** @return known RestorePointQueryType values. */ - public static Collection values() { - return values(RestorePointQueryType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequest.java index 9151b75529e88..e1bd16316fe43 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequest.java @@ -21,8 +21,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(name = "AzureFileShareRestoreRequest", value = AzureFileShareRestoreRequest.class), @JsonSubTypes.Type(name = "AzureWorkloadRestoreRequest", value = AzureWorkloadRestoreRequest.class), - @JsonSubTypes.Type(name = "IaasVMRestoreRequest", value = IaasVMRestoreRequest.class), - @JsonSubTypes.Type(name = "AzureWorkloadRestoreRequest", value = AzureWorkloadRestoreRequestAutoGenerated.class) + @JsonSubTypes.Type(name = "IaasVMRestoreRequest", value = IaasVMRestoreRequest.class) }) @Immutable public class RestoreRequest { diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPINs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPINs.java index c58e1ea862ffe..06ea8be7b3199 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPINs.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPINs.java @@ -26,11 +26,13 @@ public interface SecurityPINs { * * @param vaultName The name of the recovery services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters security pin 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 security PIN. */ - Response getWithResponse(String vaultName, String resourceGroupName, Context context); + Response getWithResponse( + String vaultName, String resourceGroupName, SecurityPinBase parameters, Context context); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPinBase.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPinBase.java new file mode 100644 index 0000000000000..d06bc7b2a54b6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPinBase.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Base class for get security pin request body. */ +@Fluent +public final class SecurityPinBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPinBase.class); + + /* + * ResourceGuard Operation Requests + */ + @JsonProperty(value = "resourceGuardOperationRequests") + private List resourceGuardOperationRequests; + + /** + * Get the resourceGuardOperationRequests property: ResourceGuard Operation Requests. + * + * @return the resourceGuardOperationRequests value. + */ + public List resourceGuardOperationRequests() { + return this.resourceGuardOperationRequests; + } + + /** + * Set the resourceGuardOperationRequests property: ResourceGuard Operation Requests. + * + * @param resourceGuardOperationRequests the resourceGuardOperationRequests value to set. + * @return the SecurityPinBase object itself. + */ + public SecurityPinBase withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + this.resourceGuardOperationRequests = resourceGuardOperationRequests; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Type.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Type.java deleted file mode 100644 index 4ff8280b833dc..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Type.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Type. */ -public final class Type extends ExpandableStringEnum { - /** Static value Invalid for Type. */ - public static final Type INVALID = fromString("Invalid"); - - /** Static value BackupProtectedItemCountSummary for Type. */ - public static final Type BACKUP_PROTECTED_ITEM_COUNT_SUMMARY = fromString("BackupProtectedItemCountSummary"); - - /** Static value BackupProtectionContainerCountSummary for Type. */ - public static final Type BACKUP_PROTECTION_CONTAINER_COUNT_SUMMARY = - fromString("BackupProtectionContainerCountSummary"); - - /** - * Creates or finds a Type from its string representation. - * - * @param name a name to look for. - * @return the corresponding Type. - */ - @JsonCreator - public static Type fromString(String name) { - return fromString(name, Type.class); - } - - /** @return known Type values. */ - public static Collection values() { - return values(Type.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteRequest.java new file mode 100644 index 0000000000000..0904a3a42b9f4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteRequest.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Request body of unlock delete API. */ +@Fluent +public final class UnlockDeleteRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UnlockDeleteRequest.class); + + /* + * The resourceGuardOperationRequests property. + */ + @JsonProperty(value = "resourceGuardOperationRequests") + private List resourceGuardOperationRequests; + + /* + * The resourceToBeDeleted property. + */ + @JsonProperty(value = "resourceToBeDeleted") + private String resourceToBeDeleted; + + /** + * Get the resourceGuardOperationRequests property: The resourceGuardOperationRequests property. + * + * @return the resourceGuardOperationRequests value. + */ + public List resourceGuardOperationRequests() { + return this.resourceGuardOperationRequests; + } + + /** + * Set the resourceGuardOperationRequests property: The resourceGuardOperationRequests property. + * + * @param resourceGuardOperationRequests the resourceGuardOperationRequests value to set. + * @return the UnlockDeleteRequest object itself. + */ + public UnlockDeleteRequest withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + this.resourceGuardOperationRequests = resourceGuardOperationRequests; + return this; + } + + /** + * Get the resourceToBeDeleted property: The resourceToBeDeleted property. + * + * @return the resourceToBeDeleted value. + */ + public String resourceToBeDeleted() { + return this.resourceToBeDeleted; + } + + /** + * Set the resourceToBeDeleted property: The resourceToBeDeleted property. + * + * @param resourceToBeDeleted the resourceToBeDeleted value to set. + * @return the UnlockDeleteRequest object itself. + */ + public UnlockDeleteRequest withResourceToBeDeleted(String resourceToBeDeleted) { + this.resourceToBeDeleted = resourceToBeDeleted; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteResponse.java new file mode 100644 index 0000000000000..37a7df34b4d19 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteResponse.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.UnlockDeleteResponseInner; + +/** An immutable client-side representation of UnlockDeleteResponse. */ +public interface UnlockDeleteResponse { + /** + * Gets the unlockDeleteExpiryTime property: This is the time when unlock delete privileges will get expired. + * + * @return the unlockDeleteExpiryTime value. + */ + String unlockDeleteExpiryTime(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.UnlockDeleteResponseInner object. + * + * @return the inner object. + */ + UnlockDeleteResponseInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateIaasVMRestoreOperationRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateIaasVMRestoreOperationRequest.java index b910928ea8554..b73e8b89ed381 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateIaasVMRestoreOperationRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateIaasVMRestoreOperationRequest.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.recoveryservicesbackup.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** AzureRestoreValidation request. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("ValidateIaasVMRestoreOperationRequest") -@Immutable +@Fluent public final class ValidateIaasVMRestoreOperationRequest extends ValidateRestoreOperationRequest { @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateIaasVMRestoreOperationRequest.class); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobExtendedInfo.java index 649042aeac486..d3af23793732b 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobExtendedInfo.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobExtendedInfo.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public final class VaultJobExtendedInfo { * Job properties. */ @JsonProperty(value = "propertyBag") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map propertyBag; /** diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadCrrAccessToken.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadCrrAccessToken.java deleted file mode 100644 index ea9ea3633b90e..0000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadCrrAccessToken.java +++ /dev/null @@ -1,444 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.Map; - -/** The WorkloadCrrAccessToken model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("WorkloadCrrAccessToken") -@Fluent -public final class WorkloadCrrAccessToken extends CrrAccessToken { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadCrrAccessToken.class); - - /* - * The protectableObjectUniqueName property. - */ - @JsonProperty(value = "protectableObjectUniqueName") - private String protectableObjectUniqueName; - - /* - * The protectableObjectFriendlyName property. - */ - @JsonProperty(value = "protectableObjectFriendlyName") - private String protectableObjectFriendlyName; - - /* - * The protectableObjectWorkloadType property. - */ - @JsonProperty(value = "protectableObjectWorkloadType") - private String protectableObjectWorkloadType; - - /* - * The protectableObjectProtectionState property. - */ - @JsonProperty(value = "protectableObjectProtectionState") - private String protectableObjectProtectionState; - - /* - * The protectableObjectContainerHostOsName property. - */ - @JsonProperty(value = "protectableObjectContainerHostOsName") - private String protectableObjectContainerHostOsName; - - /* - * The protectableObjectParentLogicalContainerName property. - */ - @JsonProperty(value = "protectableObjectParentLogicalContainerName") - private String protectableObjectParentLogicalContainerName; - - /* - * Container Id - */ - @JsonProperty(value = "containerId") - private String containerId; - - /* - * Policy Name - */ - @JsonProperty(value = "policyName") - private String policyName; - - /* - * Policy Id - */ - @JsonProperty(value = "policyId") - private String policyId; - - /** - * 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesGetSamples.java new file mode 100644 index 0000000000000..de5555e6f65ff --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupEngines Get. */ +public final class BackupEnginesGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Dpm/BackupEngines_Get.json + */ + /** + * Sample code: Get Dpm/AzureBackupServer/Lajolla Backup Engine Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getDpmAzureBackupServerLajollaBackupEngineDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupEngines().getWithResponse("testVault", "testRG", "testServer", null, null, Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesListSamples.java new file mode 100644 index 0000000000000..aa25732a7e413 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupEngines List. */ +public final class BackupEnginesListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Dpm/BackupEngines_List.json + */ + /** + * Sample code: List Dpm/AzureBackupServer/Lajolla Backup Engines. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listDpmAzureBackupServerLajollaBackupEngines( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupEngines().list("testVault", "testRG", null, null, Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupJobsListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupJobsListSamples.java new file mode 100644 index 0000000000000..01319401d4593 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupJobsListSamples.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupJobs List. */ +public final class BackupJobsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/ListJobs.json + */ + /** + * Sample code: List All Jobs. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listAllJobs( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupJobs().list("NetSDKTestRsVault", "SwaggerTestRg", null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/ListJobsWithAllSupportedFilters.json + */ + /** + * Sample code: List Jobs With Filters. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listJobsWithFilters( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupJobs() + .list( + "NetSDKTestRsVault", + "SwaggerTestRg", + "startTime eq '2016-01-01 00:00:00 AM' and endTime eq '2017-11-29 00:00:00 AM' and operation eq" + + " 'Backup' and backupManagementType eq 'AzureIaasVM' and status eq 'InProgress'", + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/ListJobsWithStartTimeAndEndTimeFilters.json + */ + /** + * Sample code: List Jobs With Time Filter. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listJobsWithTimeFilter( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupJobs() + .list( + "NetSDKTestRsVault", + "SwaggerTestRg", + "startTime eq '2016-01-01 00:00:00 AM' and endTime eq '2017-11-29 00:00:00 AM'", + null, + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationResultsGetSamples.java new file mode 100644 index 0000000000000..2c787c12f348a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationResultsGetSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupOperationResults Get. */ +public final class BackupOperationResultsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/ProtectedItem_Delete_OperationResult.json + */ + /** + * Sample code: Get Result for Protected Item Delete Operation. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getResultForProtectedItemDeleteOperation( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupOperationResults() + .getWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationStatusesGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationStatusesGetSamples.java new file mode 100644 index 0000000000000..be81efbd6f4bc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationStatusesGetSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupOperationStatuses Get. */ +public final class BackupOperationStatusesGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/ProtectedItem_Delete_OperationStatus.json + */ + /** + * Sample code: Get Protected Item Delete Operation Status. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedItemDeleteOperationStatus( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupOperationStatuses() + .getWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupPoliciesListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupPoliciesListSamples.java new file mode 100644 index 0000000000000..42e361bdbc099 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupPoliciesListSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupPolicies List. */ +public final class BackupPoliciesListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/BackupPolicies_List.json + */ + /** + * Sample code: List protection policies with backupManagementType filter as AzureWorkload. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listProtectionPoliciesWithBackupManagementTypeFilterAsAzureWorkload( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupPolicies() + .list("NetSDKTestRsVault", "SwaggerTestRg", "backupManagementType eq 'AzureWorkload'", Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/BackupPolicies_List.json + */ + /** + * Sample code: List protection policies with backupManagementType filter as AzureIaasVm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listProtectionPoliciesWithBackupManagementTypeFilterAsAzureIaasVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupPolicies() + .list("NetSDKTestRsVault", "SwaggerTestRg", "backupManagementType eq 'AzureIaasVM'", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectableItemsListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectableItemsListSamples.java new file mode 100644 index 0000000000000..983f882e07a52 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectableItemsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupProtectableItems List. */ +public final class BackupProtectableItemsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/BackupProtectableItems_List.json + */ + /** + * Sample code: List protectable items with backupManagementType filter as AzureIaasVm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listProtectableItemsWithBackupManagementTypeFilterAsAzureIaasVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupProtectableItems() + .list("NetSDKTestRsVault", "SwaggerTestRg", "backupManagementType eq 'AzureIaasVM'", null, Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectedItemsListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectedItemsListSamples.java new file mode 100644 index 0000000000000..578d02561dc14 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectedItemsListSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupProtectedItems List. */ +public final class BackupProtectedItemsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/BackupProtectedItems_List.json + */ + /** + * Sample code: List protected items with backupManagementType filter as AzureIaasVm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listProtectedItemsWithBackupManagementTypeFilterAsAzureIaasVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupProtectedItems() + .list( + "NetSDKTestRsVault", + "SwaggerTestRg", + "backupManagementType eq 'AzureIaasVM' and itemType eq 'VM'", + null, + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionContainersListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionContainersListSamples.java new file mode 100644 index 0000000000000..7eca49cdab89b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionContainersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupProtectionContainers List. */ +public final class BackupProtectionContainersListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureStorage/ProtectionContainers_List.json + */ + /** + * Sample code: List Backup Protection Containers. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listBackupProtectionContainers( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupProtectionContainers() + .list("testVault", "testRg", "backupManagementType eq 'AzureWorkload'", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionIntentListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionIntentListSamples.java new file mode 100644 index 0000000000000..ac550cf7202fb --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionIntentListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupProtectionIntent List. */ +public final class BackupProtectionIntentListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/BackupProtectionIntent_List.json + */ + /** + * Sample code: List protection intent with backupManagementType filter. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listProtectionIntentWithBackupManagementTypeFilter( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupProtectionIntents().list("myVault", "myRG", null, null, Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsGetSamples.java new file mode 100644 index 0000000000000..4d903f9a5f8a5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupResourceEncryptionConfigs Get. */ +public final class BackupResourceEncryptionConfigsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/BackupResourceEncryptionConfig_Get.json + */ + /** + * Sample code: Get Vault Encryption Configuration. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getVaultEncryptionConfiguration( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupResourceEncryptionConfigs().getWithResponse("rishTestVault", "rishgrp", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsUpdateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsUpdateSamples.java new file mode 100644 index 0000000000000..ea6e1cc803767 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsUpdateSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfig; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.EncryptionAtRestType; +import com.azure.resourcemanager.recoveryservicesbackup.models.InfrastructureEncryptionState; + +/** Samples for BackupResourceEncryptionConfigs Update. */ +public final class BackupResourceEncryptionConfigsUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/BackupResourceEncryptionConfig_Put.json + */ + /** + * Sample code: Update Vault Encryption Configuration. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void updateVaultEncryptionConfiguration( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupResourceEncryptionConfigs() + .updateWithResponse( + "source-rsv", + "test-rg", + new BackupResourceEncryptionConfigResource() + .withProperties( + new BackupResourceEncryptionConfig() + .withEncryptionAtRestType(EncryptionAtRestType.CUSTOMER_MANAGED) + .withKeyUri("https://gktestkv1.vault.azure.net/keys/Test1/ed2e8cdc7f86477ebf0c6462b504a9ed") + .withSubscriptionId("1a2311d9-66f5-47d3-a9fb-7a37da63934b") + .withInfrastructureEncryptionState(InfrastructureEncryptionState.fromString("true"))), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrGetSamples.java new file mode 100644 index 0000000000000..21e0c96d05620 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupResourceStorageConfigsNonCrr Get. */ +public final class BackupResourceStorageConfigsNonCrrGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupStorageConfig_Get.json + */ + /** + * Sample code: Get Vault Storage Configuration. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getVaultStorageConfiguration( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupResourceStorageConfigsNonCrrs() + .getWithResponse("PySDKBackupTestRsVault", "PythonSDKBackupTestRg", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrPatchSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrPatchSamples.java new file mode 100644 index 0000000000000..cb81e7f5cb643 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrPatchSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceConfig; +import com.azure.resourcemanager.recoveryservicesbackup.models.StorageType; +import com.azure.resourcemanager.recoveryservicesbackup.models.StorageTypeState; + +/** Samples for BackupResourceStorageConfigsNonCrr Patch. */ +public final class BackupResourceStorageConfigsNonCrrPatchSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupStorageConfig_Patch.json + */ + /** + * Sample code: Update Vault Storage Configuration. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void updateVaultStorageConfiguration( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupResourceStorageConfigsNonCrrs() + .patchWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + new BackupResourceConfigResourceInner() + .withProperties( + new BackupResourceConfig() + .withStorageType(StorageType.LOCALLY_REDUNDANT) + .withStorageTypeState(StorageTypeState.UNLOCKED)), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrUpdateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrUpdateSamples.java new file mode 100644 index 0000000000000..913b97d5bfcd4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrUpdateSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceConfig; +import com.azure.resourcemanager.recoveryservicesbackup.models.StorageType; +import com.azure.resourcemanager.recoveryservicesbackup.models.StorageTypeState; + +/** Samples for BackupResourceStorageConfigsNonCrr Update. */ +public final class BackupResourceStorageConfigsNonCrrUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupStorageConfig_Put.json + */ + /** + * Sample code: Update Vault Storage Configuration. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void updateVaultStorageConfiguration( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupResourceStorageConfigsNonCrrs() + .updateWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + new BackupResourceConfigResourceInner() + .withProperties( + new BackupResourceConfig() + .withStorageType(StorageType.LOCALLY_REDUNDANT) + .withStorageTypeState(StorageTypeState.UNLOCKED)), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsGetSamples.java new file mode 100644 index 0000000000000..5ee44085f15ae --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupResourceVaultConfigs Get. */ +public final class BackupResourceVaultConfigsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupResourceVaultConfigs_Get.json + */ + /** + * Sample code: Get Vault Security Config. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getVaultSecurityConfig( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupResourceVaultConfigs().getWithResponse("SwaggerTest", "SwaggerTestRg", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsPutSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsPutSamples.java new file mode 100644 index 0000000000000..5763ba868e6a9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsPutSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfig; +import com.azure.resourcemanager.recoveryservicesbackup.models.EnhancedSecurityState; +import com.azure.resourcemanager.recoveryservicesbackup.models.SoftDeleteFeatureState; + +/** Samples for BackupResourceVaultConfigs Put. */ +public final class BackupResourceVaultConfigsPutSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupResourceVaultConfigs_Put.json + */ + /** + * Sample code: Update Vault Security Config. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void updateVaultSecurityConfig( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupResourceVaultConfigs() + .putWithResponse( + "SwaggerTest", + "SwaggerTestRg", + new BackupResourceVaultConfigResourceInner() + .withProperties( + new BackupResourceVaultConfig() + .withEnhancedSecurityState(EnhancedSecurityState.ENABLED) + .withSoftDeleteFeatureState(SoftDeleteFeatureState.ENABLED)), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsUpdateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsUpdateSamples.java new file mode 100644 index 0000000000000..858edf7821222 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfig; +import com.azure.resourcemanager.recoveryservicesbackup.models.EnhancedSecurityState; + +/** Samples for BackupResourceVaultConfigs Update. */ +public final class BackupResourceVaultConfigsUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupResourceVaultConfigs_Patch.json + */ + /** + * Sample code: Update Vault Security Config. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void updateVaultSecurityConfig( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupResourceVaultConfigs() + .updateWithResponse( + "SwaggerTest", + "SwaggerTestRg", + new BackupResourceVaultConfigResourceInner() + .withProperties( + new BackupResourceVaultConfig().withEnhancedSecurityState(EnhancedSecurityState.ENABLED)), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupStatusGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupStatusGetSamples.java new file mode 100644 index 0000000000000..b40e4c3c31fcb --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupStatusGetSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatusRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.DataSourceType; + +/** Samples for BackupStatus Get. */ +public final class BackupStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/GetBackupStatus.json + */ + /** + * Sample code: Get Azure Virtual Machine Backup Status. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getAzureVirtualMachineBackupStatus( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupStatus() + .getWithResponse( + "southeastasia", + new BackupStatusRequest() + .withResourceType(DataSourceType.VM) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Compute/VirtualMachines/testVm"), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupUsageSummariesListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupUsageSummariesListSamples.java new file mode 100644 index 0000000000000..61d0a51b8bb84 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupUsageSummariesListSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupUsageSummaries List. */ +public final class BackupUsageSummariesListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupProtectedItem_UsageSummary_Get.json + */ + /** + * Sample code: Get Protected Items Usages Summary. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedItemsUsagesSummary( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupUsageSummaries() + .list("testVault", "testRG", "type eq 'BackupProtectedItemCountSummary'", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupProtectionContainers_UsageSummary_Get.json + */ + /** + * Sample code: Get Protected Containers Usages Summary. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedContainersUsagesSummary( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupUsageSummaries() + .list("testVault", "testRG", "type eq 'BackupProtectionContainerCountSummary'", null, Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupWorkloadItemsListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupWorkloadItemsListSamples.java new file mode 100644 index 0000000000000..d4ad99fb0ebb4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupWorkloadItemsListSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupWorkloadItems List. */ +public final class BackupWorkloadItemsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/BackupWorkloadItems_List.json + */ + /** + * Sample code: List Workload Items in Container. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listWorkloadItemsInContainer( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backupWorkloadItems() + .list( + "suchandr-seacan-rsv", + "testRg", + "Azure", + "VMAppContainer;Compute;bvtdtestag;sqlserver-1", + "backupManagementType eq 'AzureWorkload'", + null, + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupsTriggerSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupsTriggerSamples.java new file mode 100644 index 0000000000000..fdcaecd432423 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupsTriggerSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupRequestResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.IaasVMBackupRequest; + +/** Samples for Backups Trigger. */ +public final class BackupsTriggerSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/TriggerBackup_Post.json + */ + /** + * Sample code: Trigger Backup. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void triggerBackup( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .backups() + .triggerWithResponse( + "linuxRsVault", + "linuxRsVaultRG", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;testrg;v1win2012r", + "VM;iaasvmcontainerv2;testrg;v1win2012r", + new BackupRequestResource().withProperties(new IaasVMBackupRequest()), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BmsPrepareDataMoveOperationResultGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BmsPrepareDataMoveOperationResultGetSamples.java new file mode 100644 index 0000000000000..d09eccf0aae13 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BmsPrepareDataMoveOperationResultGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for BmsPrepareDataMoveOperationResult Get. */ +public final class BmsPrepareDataMoveOperationResultGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json + */ + /** + * Sample code: Get operation result for PrepareDataMove. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getOperationResultForPrepareDataMove( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .bmsPrepareDataMoveOperationResults() + .getWithResponse("source-rsv", "sourceRG", "00000000-0000-0000-0000-000000000000", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ExportJobsOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ExportJobsOperationResultsGetSamples.java new file mode 100644 index 0000000000000..f8fc083a25197 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ExportJobsOperationResultsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ExportJobsOperationResults Get. */ +public final class ExportJobsOperationResultsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/ExportJobsOperationResult.json + */ + /** + * Sample code: Export Jobs Operation Results. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void exportJobsOperationResults( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .exportJobsOperationResults() + .getWithResponse( + "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/FeatureSupportValidateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/FeatureSupportValidateSamples.java new file mode 100644 index 0000000000000..c0f8747543b7a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/FeatureSupportValidateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.AzureVMResourceFeatureSupportRequest; + +/** Samples for FeatureSupport Validate. */ +public final class FeatureSupportValidateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/BackupFeature_Validate.json + */ + /** + * Sample code: Check Azure Vm Backup Feature Support. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void checkAzureVmBackupFeatureSupport( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .featureSupports() + .validateWithResponse( + "southeastasia", + new AzureVMResourceFeatureSupportRequest().withVmSize("Basic_A0").withVmSku("Premium"), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsProvisionSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsProvisionSamples.java new file mode 100644 index 0000000000000..833141a654f62 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsProvisionSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.IaasVmilrRegistrationRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.IlrRequestResource; + +/** Samples for ItemLevelRecoveryConnections Provision. */ +public final class ItemLevelRecoveryConnectionsProvisionSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/Provision_Ilr.json + */ + /** + * Sample code: Provision Instant Item Level Recovery for Azure Vm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void provisionInstantItemLevelRecoveryForAzureVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .itemLevelRecoveryConnections() + .provisionWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + "Azure", + "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", + "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", + "1", + new IlrRequestResource() + .withProperties( + new IaasVmilrRegistrationRequest() + .withRecoveryPointId("38823086363464") + .withVirtualMachineId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/pysdktestrg/providers/Microsoft.Compute/virtualMachines/pysdktestv2vm1") + .withInitiatorName("Hello World") + .withRenewExistingRegistration(true)), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsRevokeSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsRevokeSamples.java new file mode 100644 index 0000000000000..8f57b7cfc10c9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsRevokeSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ItemLevelRecoveryConnections Revoke. */ +public final class ItemLevelRecoveryConnectionsRevokeSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/Revoke_Ilr.json + */ + /** + * Sample code: Revoke Instant Item Level Recovery for Azure Vm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void revokeInstantItemLevelRecoveryForAzureVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .itemLevelRecoveryConnections() + .revokeWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + "Azure", + "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", + "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", + "1", + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobCancellationsTriggerSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobCancellationsTriggerSamples.java new file mode 100644 index 0000000000000..8d7865912425f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobCancellationsTriggerSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for JobCancellations Trigger. */ +public final class JobCancellationsTriggerSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/TriggerCancelJob.json + */ + /** + * Sample code: Cancel Job. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void cancelJob( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .jobCancellations() + .triggerWithResponse( + "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobDetailsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobDetailsGetSamples.java new file mode 100644 index 0000000000000..9bd2ef242e614 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobDetailsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for JobDetails Get. */ +public final class JobDetailsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/GetJobDetails.json + */ + /** + * Sample code: Get Job Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getJobDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .jobDetails() + .getWithResponse( + "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobOperationResultsGetSamples.java new file mode 100644 index 0000000000000..05e49e66019a4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobOperationResultsGetSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for JobOperationResults Get. */ +public final class JobOperationResultsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/CancelJobOperationResult.json + */ + /** + * Sample code: Cancel Job Operation Result. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void cancelJobOperationResult( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .jobOperationResults() + .getWithResponse( + "NetSDKTestRsVault", + "SwaggerTestRg", + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobsExportSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobsExportSamples.java new file mode 100644 index 0000000000000..1d9ba44590462 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobsExportSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for Jobs Export. */ +public final class JobsExportSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/TriggerExportJobs.json + */ + /** + * Sample code: Export Jobs. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void exportJobs( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.jobs().exportWithResponse("NetSDKTestRsVault", "SwaggerTestRg", null, Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationOperationValidateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationOperationValidateSamples.java new file mode 100644 index 0000000000000..6e456505b1871 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationOperationValidateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequest; + +/** Samples for OperationOperation Validate. */ +public final class OperationOperationValidateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk.json + */ + /** + * Sample code: Validate Operation. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void validateOperation( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .operationOperations() + .validateWithResponse("testVault", "testRG", new ValidateOperationRequest(), Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationsListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..0deb80194dea8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/ListOperations.json + */ + /** + * Sample code: ListOperations. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listOperations( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionDeleteSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionDeleteSamples.java new file mode 100644 index 0000000000000..61ad9d2348a5a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnection Delete. */ +public final class PrivateEndpointConnectionDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/PrivateEndpointConnection/DeletePrivateEndpointConnection.json + */ + /** + * Sample code: Delete PrivateEndpointConnection. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void deletePrivateEndpointConnection( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .privateEndpointConnections() + .delete( + "gaallavaultbvtd2msi", "gaallaRG", "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionGetSamples.java new file mode 100644 index 0000000000000..9e9e3ba4dc3e2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnection Get. */ +public final class PrivateEndpointConnectionGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnection.json + */ + /** + * Sample code: Get PrivateEndpointConnection. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getPrivateEndpointConnection( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .privateEndpointConnections() + .getWithResponse( + "gaallavaultbvtd2msi", "gaallaRG", "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionPutSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionPutSamples.java new file mode 100644 index 0000000000000..0e8395a52c992 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionPutSamples.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpoint; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnection; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnectionResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnectionStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProvisioningState; + +/** Samples for PrivateEndpointConnection Put. */ +public final class PrivateEndpointConnectionPutSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/PrivateEndpointConnection/PutPrivateEndpointConnection.json + */ + /** + * Sample code: Update PrivateEndpointConnection. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void updatePrivateEndpointConnection( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + PrivateEndpointConnectionResource resource = + manager + .privateEndpointConnections() + .getWithResponse( + "gaallavaultbvtd2msi", + "gaallaRG", + "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", + Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new PrivateEndpointConnection() + .withProvisioningState(ProvisioningState.SUCCEEDED) + .withPrivateEndpoint( + new PrivateEndpoint() + .withId( + "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.Network/privateEndpoints/gaallatestpe3")) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@company.com"))) + .apply(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointGetOperationStatusSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointGetOperationStatusSamples.java new file mode 100644 index 0000000000000..388d07f9f2be5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointGetOperationStatusSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpoint GetOperationStatus. */ +public final class PrivateEndpointGetOperationStatusSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnectionOperationStatus.json + */ + /** + * Sample code: Get OperationStatus. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getOperationStatus( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .privateEndpoints() + .getOperationStatusWithResponse( + "gaallavaultbvtd2msi", + "gaallaRG", + "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", + "0f48183b-0a44-4dca-aec1-bba5daab888a", + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectableContainersListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectableContainersListSamples.java new file mode 100644 index 0000000000000..dcec2034ec573 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectableContainersListSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectableContainers List. */ +public final class ProtectableContainersListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureStorage/ProtectableContainers_List.json + */ + /** + * Sample code: List protectable items with backupManagementType filter as AzureStorage. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listProtectableItemsWithBackupManagementTypeFilterAsAzureStorage( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectableContainers() + .list( + "testvault", + "testRg", + "Azure", + "backupManagementType eq 'AzureStorage' and workloadType eq 'AzureFileShare'", + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationResultsGetSamples.java new file mode 100644 index 0000000000000..b4f0ee5a741db --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationResultsGetSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectedItemOperationResults Get. */ +public final class ProtectedItemOperationResultsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectedItemOperationResults.json + */ + /** + * Sample code: Get Operation Results of Protected Vm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getOperationResultsOfProtectedVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectedItemOperationResults() + .getWithResponse( + "NetSDKTestRsVault", + "SwaggerTestRg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationStatusesGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationStatusesGetSamples.java new file mode 100644 index 0000000000000..81658a98bb56b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationStatusesGetSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectedItemOperationStatuses Get. */ +public final class ProtectedItemOperationStatusesGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectedItemOperationStatus.json + */ + /** + * Sample code: Get Operation Status of Protected Vm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getOperationStatusOfProtectedVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectedItemOperationStatuses() + .getWithResponse( + "NetSDKTestRsVault", + "SwaggerTestRg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsCreateOrUpdateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..1e2417588a8fc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsCreateOrUpdateSamples.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItem; + +/** Samples for ProtectedItems CreateOrUpdate. */ +public final class ProtectedItemsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/StopProtection.json + */ + /** + * Sample code: Stop Protection with retain data on Azure IaasVm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void stopProtectionWithRetainDataOnAzureIaasVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectedItems() + .define("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1") + .withRegion((String) null) + .withExistingProtectionContainer( + "NetSDKTestRsVault", + "SwaggerTestRg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1") + .withProperties( + new ProtectedItem() + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1")) + .create(); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ConfigureProtection.json + */ + /** + * Sample code: Enable Protection on Azure IaasVm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void enableProtectionOnAzureIaasVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectedItems() + .define("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1") + .withRegion((String) null) + .withExistingProtectionContainer( + "NetSDKTestRsVault", + "SwaggerTestRg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1") + .withProperties( + new ProtectedItem() + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1") + .withPolicyId( + "/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/DefaultPolicy")) + .create(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsDeleteSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsDeleteSamples.java new file mode 100644 index 0000000000000..956523564f4e0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsDeleteSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectedItems Delete. */ +public final class ProtectedItemsDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/ProtectedItem_Delete.json + */ + /** + * Sample code: Delete Protection from Azure Virtual Machine. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void deleteProtectionFromAzureVirtualMachine( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectedItems() + .deleteWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + "Azure", + "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", + "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsGetSamples.java new file mode 100644 index 0000000000000..0fa2590e61ae5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsGetSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectedItems Get. */ +public final class ProtectedItemsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ClassicCompute_ProtectedItem_Get.json + */ + /** + * Sample code: Get Protected Classic Virtual Machine Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedClassicVirtualMachineDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectedItems() + .getWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + "Azure", + "iaasvmcontainer;iaasvmcontainer;iaasvm-rg;iaasvm-1", + "vm;iaasvmcontainer;iaasvm-rg;iaasvm-1", + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/Compute_ProtectedItem_Get.json + */ + /** + * Sample code: Get Protected Virtual Machine Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedVirtualMachineDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectedItems() + .getWithResponse( + "PySDKBackupTestRsVault", + "PythonSDKBackupTestRg", + "Azure", + "iaasvmcontainer;iaasvmcontainerv2;iaasvm-rg;iaasvm-1", + "vm;iaasvmcontainerv2;iaasvm-rg;iaasvm-1", + null, + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerOperationResultsGetSamples.java new file mode 100644 index 0000000000000..5d24937babd28 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerOperationResultsGetSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectionContainerOperationResults Get. */ +public final class ProtectionContainerOperationResultsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureStorage/ProtectionContainers_Inquire_Result.json + */ + /** + * Sample code: Get Azure Storage Protection Container Operation Result. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getAzureStorageProtectionContainerOperationResult( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionContainerOperationResults() + .getWithResponse( + "testvault", + "test-rg", + "Azure", + "VMAppContainer;Compute;testRG;testSQL", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerRefreshOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerRefreshOperationResultsGetSamples.java new file mode 100644 index 0000000000000..6381cfee25334 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerRefreshOperationResultsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectionContainerRefreshOperationResults Get. */ +public final class ProtectionContainerRefreshOperationResultsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/RefreshContainers_OperationResults.json + */ + /** + * Sample code: Azure Vm Discovery Operation Result. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void azureVmDiscoveryOperationResult( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionContainerRefreshOperationResults() + .getWithResponse( + "NetSDKTestRsVault", "SwaggerTestRg", "Azure", "00000000-0000-0000-0000-000000000000", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersGetSamples.java new file mode 100644 index 0000000000000..4559aa6451d60 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectionContainers Get. */ +public final class ProtectionContainersGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/ProtectionContainers_Get.json + */ + /** + * Sample code: Get Protection Container Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectionContainerDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionContainers() + .getWithResponse("testVault", "testRg", "Azure", "VMAppContainer;Compute;testRG;testSQL", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersInquireSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersInquireSamples.java new file mode 100644 index 0000000000000..86706fedaf163 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersInquireSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectionContainers Inquire. */ +public final class ProtectionContainersInquireSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureStorage/ProtectionContainers_Inquire.json + */ + /** + * Sample code: Inquire Azure Storage Protection Containers. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void inquireAzureStorageProtectionContainers( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionContainers() + .inquireWithResponse( + "testvault", "test-rg", "Azure", "storagecontainer;Storage;test-rg;teststorage", null, Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRefreshSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRefreshSamples.java new file mode 100644 index 0000000000000..426d5a8c540b3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRefreshSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectionContainers Refresh. */ +public final class ProtectionContainersRefreshSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/RefreshContainers.json + */ + /** + * Sample code: Trigger Azure Vm Discovery. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void triggerAzureVmDiscovery( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionContainers() + .refreshWithResponse("NetSDKTestRsVault", "SwaggerTestRg", "Azure", null, Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRegisterSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRegisterSamples.java new file mode 100644 index 0000000000000..c3b165f0b5141 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRegisterSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainer; + +/** Samples for ProtectionContainers Register. */ +public final class ProtectionContainersRegisterSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureStorage/ProtectionContainers_Register.json + */ + /** + * Sample code: RegisterAzure Storage ProtectionContainers. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void registerAzureStorageProtectionContainers( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionContainers() + .define("VMAppContainer;Compute;testRG;testSQL") + .withRegion((String) null) + .withExistingBackupFabric("testvault", "test-rg", "Azure") + .withProperties( + new ProtectionContainer() + .withFriendlyName("testSQL") + .withBackupManagementType(BackupManagementType.AZURE_WORKLOAD)) + .create(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersUnregisterSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersUnregisterSamples.java new file mode 100644 index 0000000000000..b43da94555c34 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersUnregisterSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectionContainers Unregister. */ +public final class ProtectionContainersUnregisterSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/ProtectionContainers_Unregister.json + */ + /** + * Sample code: Unregister Protection Container. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void unregisterProtectionContainer( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionContainers() + .unregisterWithResponse( + "testVault", "testRg", "Azure", "storagecontainer;Storage;test-rg;teststorage", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentCreateOrUpdateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..018b9544f60b6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.resourcemanager.recoveryservicesbackup.models.AzureResourceProtectionIntent; + +/** Samples for ProtectionIntent CreateOrUpdate. */ +public final class ProtectionIntentCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionIntent_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Azure Vm Protection Intent. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void createOrUpdateAzureVmProtectionIntent( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionIntents() + .define("vm;iaasvmcontainerv2;chamsrgtest;chamscandel") + .withRegion((String) null) + .withExistingBackupFabric("myVault", "myRG", "Azure") + .withProperties( + new AzureResourceProtectionIntent() + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/chamsrgtest/providers/Microsoft.Compute/virtualMachines/chamscandel") + .withPolicyId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy")) + .create(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentDeleteSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentDeleteSamples.java new file mode 100644 index 0000000000000..cfc4c725d2d71 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectionIntent Delete. */ +public final class ProtectionIntentDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/BackupProtectionIntent_Delete.json + */ + /** + * Sample code: Delete Protection intent from item. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void deleteProtectionIntentFromItem( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionIntents() + .deleteWithResponse("myVault", "myRG", "Azure", "249D9B07-D2EF-4202-AA64-65F35418564E", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentGetSamples.java new file mode 100644 index 0000000000000..d93de82b0cf78 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectionIntent Get. */ +public final class ProtectionIntentGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/BackupProtectionIntent_Get.json + */ + /** + * Sample code: Get ProtectionIntent for an item. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectionIntentForAnItem( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionIntents() + .getWithResponse("myVault", "myRG", "Azure", "249D9B07-D2EF-4202-AA64-65F35418564E", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentValidateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentValidateSamples.java new file mode 100644 index 0000000000000..5506e7b709675 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentValidateSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.DataSourceType; +import com.azure.resourcemanager.recoveryservicesbackup.models.PreValidateEnableBackupRequest; + +/** Samples for ProtectionIntent Validate. */ +public final class ProtectionIntentValidateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionIntent_Validate.json + */ + /** + * Sample code: Validate Enable Protection on Azure Vm. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void validateEnableProtectionOnAzureVm( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionIntents() + .validateWithResponse( + "southeastasia", + new PreValidateEnableBackupRequest() + .withResourceType(DataSourceType.VM) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arunaupgrade/providers/Microsoft.Compute/VirtualMachines/upgrade1") + .withVaultId( + "/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/Vaults/myVault") + .withProperties(""), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesCreateOrUpdateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..f1453a0fd7d6d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesCreateOrUpdateSamples.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.resourcemanager.recoveryservicesbackup.models.AzureIaaSvmProtectionPolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.AzureVmWorkloadProtectionPolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.DailyRetentionSchedule; +import com.azure.resourcemanager.recoveryservicesbackup.models.DayOfWeek; +import com.azure.resourcemanager.recoveryservicesbackup.models.LogSchedulePolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.LongTermRetentionPolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.MonthOfYear; +import com.azure.resourcemanager.recoveryservicesbackup.models.MonthlyRetentionSchedule; +import com.azure.resourcemanager.recoveryservicesbackup.models.PolicyType; +import com.azure.resourcemanager.recoveryservicesbackup.models.RetentionDuration; +import com.azure.resourcemanager.recoveryservicesbackup.models.RetentionDurationType; +import com.azure.resourcemanager.recoveryservicesbackup.models.RetentionScheduleFormat; +import com.azure.resourcemanager.recoveryservicesbackup.models.ScheduleRunType; +import com.azure.resourcemanager.recoveryservicesbackup.models.Settings; +import com.azure.resourcemanager.recoveryservicesbackup.models.SimpleRetentionPolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.SimpleSchedulePolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.SubProtectionPolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.WeekOfMonth; +import com.azure.resourcemanager.recoveryservicesbackup.models.WeeklyRetentionFormat; +import com.azure.resourcemanager.recoveryservicesbackup.models.WeeklyRetentionSchedule; +import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadType; +import com.azure.resourcemanager.recoveryservicesbackup.models.YearlyRetentionSchedule; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for ProtectionPolicies CreateOrUpdate. */ +public final class ProtectionPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureWorkload/ProtectionPolicies_CreateOrUpdate_Complex.json + */ + /** + * Sample code: Create or Update Full Azure Workload Protection Policy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void createOrUpdateFullAzureWorkloadProtectionPolicy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionPolicies() + .define("testPolicy1") + .withRegion((String) null) + .withExistingVault("NetSDKTestRsVault", "SwaggerTestRg") + .withProperties( + new AzureVmWorkloadProtectionPolicy() + .withWorkLoadType(WorkloadType.SQLDATA_BASE) + .withSettings(new Settings().withTimeZone("Pacific Standard Time").withIssqlcompression(false)) + .withSubProtectionPolicy( + Arrays + .asList( + new SubProtectionPolicy() + .withPolicyType(PolicyType.FULL) + .withSchedulePolicy( + new SimpleSchedulePolicy() + .withScheduleRunFrequency(ScheduleRunType.WEEKLY) + .withScheduleRunDays(Arrays.asList(DayOfWeek.SUNDAY, DayOfWeek.TUESDAY)) + .withScheduleRunTimes( + Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z")))) + .withRetentionPolicy( + new LongTermRetentionPolicy() + .withWeeklySchedule( + new WeeklyRetentionSchedule() + .withDaysOfTheWeek( + Arrays.asList(DayOfWeek.SUNDAY, DayOfWeek.TUESDAY)) + .withRetentionTimes( + Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z"))) + .withRetentionDuration( + new RetentionDuration() + .withCount(2) + .withDurationType(RetentionDurationType.WEEKS))) + .withMonthlySchedule( + new MonthlyRetentionSchedule() + .withRetentionScheduleFormatType(RetentionScheduleFormat.WEEKLY) + .withRetentionScheduleWeekly( + new WeeklyRetentionFormat() + .withDaysOfTheWeek(Arrays.asList(DayOfWeek.SUNDAY)) + .withWeeksOfTheMonth(Arrays.asList(WeekOfMonth.SECOND))) + .withRetentionTimes( + Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z"))) + .withRetentionDuration( + new RetentionDuration() + .withCount(1) + .withDurationType(RetentionDurationType.MONTHS))) + .withYearlySchedule( + new YearlyRetentionSchedule() + .withRetentionScheduleFormatType(RetentionScheduleFormat.WEEKLY) + .withMonthsOfYear( + Arrays + .asList( + MonthOfYear.JANUARY, + MonthOfYear.JUNE, + MonthOfYear.DECEMBER)) + .withRetentionScheduleWeekly( + new WeeklyRetentionFormat() + .withDaysOfTheWeek(Arrays.asList(DayOfWeek.SUNDAY)) + .withWeeksOfTheMonth(Arrays.asList(WeekOfMonth.LAST))) + .withRetentionTimes( + Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z"))) + .withRetentionDuration( + new RetentionDuration() + .withCount(1) + .withDurationType(RetentionDurationType.YEARS)))), + new SubProtectionPolicy() + .withPolicyType(PolicyType.DIFFERENTIAL) + .withSchedulePolicy( + new SimpleSchedulePolicy() + .withScheduleRunFrequency(ScheduleRunType.WEEKLY) + .withScheduleRunDays(Arrays.asList(DayOfWeek.FRIDAY)) + .withScheduleRunTimes( + Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z")))) + .withRetentionPolicy( + new SimpleRetentionPolicy() + .withRetentionDuration( + new RetentionDuration() + .withCount(8) + .withDurationType(RetentionDurationType.DAYS))), + new SubProtectionPolicy() + .withPolicyType(PolicyType.LOG) + .withSchedulePolicy(new LogSchedulePolicy().withScheduleFrequencyInMins(60)) + .withRetentionPolicy( + new SimpleRetentionPolicy() + .withRetentionDuration( + new RetentionDuration() + .withCount(7) + .withDurationType(RetentionDurationType.DAYS)))))) + .create(); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Simple.json + */ + /** + * Sample code: Create or Update Simple Azure Vm Protection Policy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void createOrUpdateSimpleAzureVmProtectionPolicy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionPolicies() + .define("testPolicy1") + .withRegion((String) null) + .withExistingVault("NetSDKTestRsVault", "SwaggerTestRg") + .withProperties( + new AzureIaaSvmProtectionPolicy() + .withSchedulePolicy( + new SimpleSchedulePolicy() + .withScheduleRunFrequency(ScheduleRunType.DAILY) + .withScheduleRunTimes(Arrays.asList(OffsetDateTime.parse("2018-01-24T02:00:00Z")))) + .withRetentionPolicy( + new LongTermRetentionPolicy() + .withDailySchedule( + new DailyRetentionSchedule() + .withRetentionTimes(Arrays.asList(OffsetDateTime.parse("2018-01-24T02:00:00Z"))) + .withRetentionDuration( + new RetentionDuration() + .withCount(1) + .withDurationType(RetentionDurationType.DAYS)))) + .withTimeZone("Pacific Standard Time")) + .create(); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Complex.json + */ + /** + * Sample code: Create or Update Full Azure Vm Protection Policy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void createOrUpdateFullAzureVmProtectionPolicy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionPolicies() + .define("testPolicy1") + .withRegion((String) null) + .withExistingVault("NetSDKTestRsVault", "SwaggerTestRg") + .withProperties( + new AzureIaaSvmProtectionPolicy() + .withSchedulePolicy( + new SimpleSchedulePolicy() + .withScheduleRunFrequency(ScheduleRunType.WEEKLY) + .withScheduleRunDays( + Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY)) + .withScheduleRunTimes(Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z")))) + .withRetentionPolicy( + new LongTermRetentionPolicy() + .withWeeklySchedule( + new WeeklyRetentionSchedule() + .withDaysOfTheWeek( + Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY)) + .withRetentionTimes(Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z"))) + .withRetentionDuration( + new RetentionDuration() + .withCount(1) + .withDurationType(RetentionDurationType.WEEKS))) + .withMonthlySchedule( + new MonthlyRetentionSchedule() + .withRetentionScheduleFormatType(RetentionScheduleFormat.WEEKLY) + .withRetentionScheduleWeekly( + new WeeklyRetentionFormat() + .withDaysOfTheWeek(Arrays.asList(DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY)) + .withWeeksOfTheMonth(Arrays.asList(WeekOfMonth.FIRST, WeekOfMonth.THIRD))) + .withRetentionTimes(Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z"))) + .withRetentionDuration( + new RetentionDuration() + .withCount(2) + .withDurationType(RetentionDurationType.MONTHS))) + .withYearlySchedule( + new YearlyRetentionSchedule() + .withRetentionScheduleFormatType(RetentionScheduleFormat.WEEKLY) + .withMonthsOfYear(Arrays.asList(MonthOfYear.FEBRUARY, MonthOfYear.NOVEMBER)) + .withRetentionScheduleWeekly( + new WeeklyRetentionFormat() + .withDaysOfTheWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.THURSDAY)) + .withWeeksOfTheMonth(Arrays.asList(WeekOfMonth.FOURTH))) + .withRetentionTimes(Arrays.asList(OffsetDateTime.parse("2018-01-24T10:00:00Z"))) + .withRetentionDuration( + new RetentionDuration() + .withCount(4) + .withDurationType(RetentionDurationType.YEARS)))) + .withTimeZone("Pacific Standard Time")) + .create(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesDeleteSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesDeleteSamples.java new file mode 100644 index 0000000000000..7f47adb7367aa --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectionPolicies Delete. */ +public final class ProtectionPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionPolicies_Delete.json + */ + /** + * Sample code: Delete Azure Vm Protection Policy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void deleteAzureVmProtectionPolicy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.protectionPolicies().delete("NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesGetSamples.java new file mode 100644 index 0000000000000..f9b5b04454455 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectionPolicies Get. */ +public final class ProtectionPoliciesGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionPolicies_Get.json + */ + /** + * Sample code: Get Azure IaasVm Protection Policy Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getAzureIaasVmProtectionPolicyDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.protectionPolicies().getWithResponse("NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationResultsGetSamples.java new file mode 100644 index 0000000000000..c00f603d9b7ec --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationResultsGetSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectionPolicyOperationResults Get. */ +public final class ProtectionPolicyOperationResultsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionPolicyOperationResults_Get.json + */ + /** + * Sample code: Get Protection Policy Operation Results. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectionPolicyOperationResults( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionPolicyOperationResults() + .getWithResponse( + "NetSDKTestRsVault", + "SwaggerTestRg", + "testPolicy1", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationStatusesGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationStatusesGetSamples.java new file mode 100644 index 0000000000000..197aba79b2069 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationStatusesGetSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ProtectionPolicyOperationStatuses Get. */ +public final class ProtectionPolicyOperationStatusesGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/ProtectionPolicyOperationStatuses_Get.json + */ + /** + * Sample code: Get Protection Policy Operation Status. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectionPolicyOperationStatus( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .protectionPolicyOperationStatuses() + .getWithResponse( + "NetSDKTestRsVault", + "SwaggerTestRg", + "testPolicy1", + "00000000-0000-0000-0000-000000000000", + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsGetSamples.java new file mode 100644 index 0000000000000..5a052c7015fb5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsGetSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for RecoveryPoints Get. */ +public final class RecoveryPointsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/RecoveryPoints_Get.json + */ + /** + * Sample code: Get Azure Vm Recovery Point Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getAzureVmRecoveryPointDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .recoveryPoints() + .getWithResponse( + "rshvault", + "rshhtestmdvmrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", + "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", + "26083826328862", + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsListSamples.java new file mode 100644 index 0000000000000..88f5c7a248b44 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsListSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for RecoveryPoints List. */ +public final class RecoveryPointsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/RecoveryPoints_List.json + */ + /** + * Sample code: Get Protected Azure Vm Recovery Points. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedAzureVmRecoveryPoints( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .recoveryPoints() + .list( + "rshvault", + "rshhtestmdvmrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", + "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", + null, + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsRecommendedForMoveListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsRecommendedForMoveListSamples.java new file mode 100644 index 0000000000000..ed640325c9e10 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsRecommendedForMoveListSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.ListRecoveryPointsRecommendedForMoveRequest; +import java.util.Arrays; + +/** Samples for RecoveryPointsRecommendedForMove List. */ +public final class RecoveryPointsRecommendedForMoveListSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/RecoveryPointsRecommendedForMove_List.json + */ + /** + * Sample code: Get Protected Azure Vm Recovery Points Recommended for Move. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedAzureVmRecoveryPointsRecommendedForMove( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .recoveryPointsRecommendedForMoves() + .list( + "rshvault", + "rshhtestmdvmrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", + "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", + new ListRecoveryPointsRecommendedForMoveRequest() + .withObjectType("ListRecoveryPointsRecommendedForMoveRequest") + .withExcludedRPList(Arrays.asList("348916168024334", "348916168024335")), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxiesGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxiesGetSamples.java new file mode 100644 index 0000000000000..071316de1a838 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxiesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ResourceGuardProxies Get. */ +public final class ResourceGuardProxiesGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json + */ + /** + * Sample code: Get VaultGuardProxies. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getVaultGuardProxies( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.resourceGuardProxies().get("sampleVault", "SampleResourceGroup", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationDeleteSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationDeleteSamples.java new file mode 100644 index 0000000000000..1a3bff3ce3b97 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ResourceGuardProxyOperation Delete. */ +public final class ResourceGuardProxyOperationDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json + */ + /** + * Sample code: Delete ResourceGuardProxy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void deleteResourceGuardProxy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceGuardProxyOperations() + .deleteWithResponse("sampleVault", "SampleResourceGroup", "swaggerExample", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationGetSamples.java new file mode 100644 index 0000000000000..337f7bd93fefc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ResourceGuardProxyOperation Get. */ +public final class ResourceGuardProxyOperationGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json + */ + /** + * Sample code: Get ResourceGuardProxy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getResourceGuardProxy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceGuardProxyOperations() + .getWithResponse("sampleVault", "SampleResourceGroup", "swaggerExample", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationPutSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationPutSamples.java new file mode 100644 index 0000000000000..67e95ba3535b7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationPutSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ResourceGuardProxyOperation Put. */ +public final class ResourceGuardProxyOperationPutSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json + */ + /** + * Sample code: Create ResourceGuardProxy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void createResourceGuardProxy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceGuardProxyOperations() + .putWithResponse("sampleVault", "SampleResourceGroup", "swaggerExample", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationUnlockDeleteSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationUnlockDeleteSamples.java new file mode 100644 index 0000000000000..b5998cc7642fc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationUnlockDeleteSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.UnlockDeleteRequest; +import java.util.Arrays; + +/** Samples for ResourceGuardProxyOperation UnlockDelete. */ +public final class ResourceGuardProxyOperationUnlockDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json + */ + /** + * Sample code: UnlockDelete ResourceGuardProxy. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void unlockDeleteResourceGuardProxy( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceGuardProxyOperations() + .unlockDeleteWithResponse( + "sampleVault", + "SampleResourceGroup", + "swaggerExample", + new UnlockDeleteRequest() + .withResourceGuardOperationRequests( + Arrays + .asList( + "/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteProtectedItemRequests/default")) + .withResourceToBeDeleted( + "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/gaallarg/providers/Microsoft.RecoveryServices/vaults/MercuryCrrVault/backupFabrics/Azure/protectionContainers/VMAppContainer;compute;crrtestrg;crrtestvm/protectedItems/SQLDataBase;mssqlserver;testdb"), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsPrepareDataMoveSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsPrepareDataMoveSamples.java new file mode 100644 index 0000000000000..59f67bf6faa27 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsPrepareDataMoveSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.DataMoveLevel; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrepareDataMoveRequest; + +/** Samples for ResourceProvider BmsPrepareDataMove. */ +public final class ResourceProviderBmsPrepareDataMoveSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/BackupDataMove/PrepareDataMove_Post.json + */ + /** + * Sample code: Prepare Data Move. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void prepareDataMove( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceProviders() + .bmsPrepareDataMove( + "source-rsv", + "sourceRG", + new PrepareDataMoveRequest() + .withTargetResourceId( + "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/targetRG/providers/Microsoft.RecoveryServices/vaults/target-rsv") + .withTargetRegion("USGov Virginia") + .withDataMoveLevel(DataMoveLevel.VAULT), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsTriggerDataMoveSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsTriggerDataMoveSamples.java new file mode 100644 index 0000000000000..eb3704436e872 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsTriggerDataMoveSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.DataMoveLevel; +import com.azure.resourcemanager.recoveryservicesbackup.models.TriggerDataMoveRequest; + +/** Samples for ResourceProvider BmsTriggerDataMove. */ +public final class ResourceProviderBmsTriggerDataMoveSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/BackupDataMove/TriggerDataMove_Post.json + */ + /** + * Sample code: Trigger Data Move. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void triggerDataMove( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceProviders() + .bmsTriggerDataMove( + "target-rsv", + "targetRG", + new TriggerDataMoveRequest() + .withSourceResourceId( + "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/sourceRG/providers/Microsoft.RecoveryServices/vaults/source-rsv") + .withSourceRegion("USGov Iowa") + .withDataMoveLevel(DataMoveLevel.VAULT) + .withCorrelationId("MTg2OTcyMzM4NzYyMjc1NDY3Nzs1YmUzYmVmNi04YjJiLTRhOTItOTllYi01NTM0MDllYjk2NjE="), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderGetOperationStatusSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderGetOperationStatusSamples.java new file mode 100644 index 0000000000000..120fc709a88c0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderGetOperationStatusSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for ResourceProvider GetOperationStatus. */ +public final class ResourceProviderGetOperationStatusSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json + */ + /** + * Sample code: Get OperationStatus. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getOperationStatus( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceProviders() + .getOperationStatusWithResponse( + "source-rsv", "sourceRG", "00000000-0000-0000-0000-000000000000", Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderMoveRecoveryPointSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderMoveRecoveryPointSamples.java new file mode 100644 index 0000000000000..63e4b05720831 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderMoveRecoveryPointSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.MoveRPAcrossTiersRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointTierType; + +/** Samples for ResourceProvider MoveRecoveryPoint. */ +public final class ResourceProviderMoveRecoveryPointSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/TriggerRecoveryPointMove_Post.json + */ + /** + * Sample code: Trigger RP Move Operation. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void triggerRPMoveOperation( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .resourceProviders() + .moveRecoveryPoint( + "testVault", + "netsdktestrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "348916168024334", + new MoveRPAcrossTiersRequest() + .withObjectType("MoveRPAcrossTiersRequest") + .withSourceTierType(RecoveryPointTierType.HARDENED_RP) + .withTargetTierType(RecoveryPointTierType.ARCHIVED_RP), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RestoresTriggerSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RestoresTriggerSamples.java new file mode 100644 index 0000000000000..8c7fe77b3eae1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RestoresTriggerSamples.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.models.EncryptionDetails; +import com.azure.resourcemanager.recoveryservicesbackup.models.IaasVMRestoreRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.IdentityInfo; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryType; +import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestResource; + +/** Samples for Restores Trigger. */ +public final class RestoresTriggerSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreWithRehydrationRequest.json + */ + /** + * Sample code: Restore to New Azure IaasVm with IaasVMRestoreWithRehydrationRequest. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void restoreToNewAzureIaasVmWithIaasVMRestoreWithRehydrationRequest( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .restores() + .trigger( + "testVault", + "netsdktestrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "348916168024334", + new RestoreRequestResource().withProperties(new RestoreRequest()), + Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest.json + */ + /** + * Sample code: Restore to New Azure IaasVm with IaasVMRestoreRequest. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void restoreToNewAzureIaasVmWithIaasVMRestoreRequest( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .restores() + .trigger( + "testVault", + "netsdktestrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "348916168024334", + new RestoreRequestResource() + .withProperties( + new IaasVMRestoreRequest() + .withRecoveryPointId("348916168024334") + .withRecoveryType(RecoveryType.ALTERNATE_LOCATION) + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1") + .withTargetVirtualMachineId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2/providers/Microsoft.Compute/virtualmachines/RSMDALRVM981435") + .withTargetResourceGroupId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2") + .withStorageAccountId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Storage/storageAccounts/testingAccount") + .withVirtualNetworkId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet") + .withSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet/subnets/default") + .withRegion("southeastasia") + .withCreateNewCloudService(false) + .withOriginalStorageAccountOption(false) + .withEncryptionDetails(new EncryptionDetails().withEncryptionEnabled(false)) + .withIdentityInfo(new IdentityInfo().withIsSystemAssignedIdentity(true))), + Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreWithRehydrationRequest.json + */ + /** + * Sample code: Restore Disks with IaasVMRestoreWithRehydrationRequest. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void restoreDisksWithIaasVMRestoreWithRehydrationRequest( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .restores() + .trigger( + "testVault", + "netsdktestrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "348916168024334", + new RestoreRequestResource().withProperties(new RestoreRequest()), + Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest.json + */ + /** + * Sample code: Restore Disks with IaasVMRestoreRequest. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void restoreDisksWithIaasVMRestoreRequest( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager + .restores() + .trigger( + "testVault", + "netsdktestrg", + "Azure", + "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", + "348916168024334", + new RestoreRequestResource() + .withProperties( + new IaasVMRestoreRequest() + .withRecoveryPointId("348916168024334") + .withRecoveryType(RecoveryType.RESTORE_DISKS) + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1") + .withStorageAccountId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount") + .withRegion("southeastasia") + .withCreateNewCloudService(true) + .withOriginalStorageAccountOption(false) + .withEncryptionDetails(new EncryptionDetails().withEncryptionEnabled(false)) + .withIdentityInfo( + new IdentityInfo() + .withIsSystemAssignedIdentity(false) + .withManagedIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"))), + Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/SecurityPINsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/SecurityPINsGetSamples.java new file mode 100644 index 0000000000000..f7d71bb688e2a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/SecurityPINsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.Context; + +/** Samples for SecurityPINs Get. */ +public final class SecurityPINsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-08-01/examples/Common/BackupSecurityPin_Get.json + */ + /** + * Sample code: Get Vault Security Pin. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getVaultSecurityPin( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.securityPINs().getWithResponse("SwaggerTest", "SwaggerTestRg", null, Context.NONE); + } +}