From a6ab15244663cfdbbddd3f44f53fd88d645c502c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 15 Dec 2022 20:15:48 +0000 Subject: [PATCH] CodeGen from PR 2729 in test-repo-billy/azure-rest-api-specs Merge b9f356ab2ff3952571894dd712640b84a8cf7b52 into 7245d0f5cc01bf95df9d7ae893f252d4001b4ad7 --- .../CHANGELOG.md | 4 +- .../README.md | 27 +- .../SAMPLE.md | 687 ++++- .../pom.xml | 2 +- .../dataprotection/DataProtectionManager.java | 214 +- .../fluent/BackupInstancesClient.java | 496 +++- ...ackupInstancesExtensionRoutingsClient.java | 43 + .../fluent/BackupPoliciesClient.java | 64 +- .../BackupVaultOperationResultsClient.java | 16 +- .../fluent/BackupVaultsClient.java | 78 +- .../fluent/DataProtectionClient.java | 35 + .../DataProtectionOperationsClient.java | 4 +- .../fluent/DataProtectionsClient.java | 10 +- .../fluent/DeletedBackupInstancesClient.java | 132 + .../fluent/DppResourceGuardProxiesClient.java | 181 ++ .../fluent/ExportJobsClient.java | 4 +- .../ExportJobsOperationResultsClient.java | 10 +- .../dataprotection/fluent/JobsClient.java | 14 +- .../fluent/OperationResultsClient.java | 14 +- ...rationStatusBackupVaultContextsClient.java | 46 + .../fluent/OperationStatusClient.java | 8 +- ...tionStatusResourceGroupContextsClient.java | 45 + .../fluent/RecoveryPointsClient.java | 28 +- .../fluent/ResourceGuardsClient.java | 128 +- .../fluent/RestorableTimeRangesClient.java | 26 +- ...orableTimeRangesResponseResourceInner.java | 10 +- .../models/AzureBackupJobResourceInner.java | 8 +- ...AzureBackupRecoveryPointResourceInner.java | 26 +- .../models/BackupInstanceResourceInner.java | 26 +- .../models/BackupVaultResourceInner.java | 29 +- .../models/BaseBackupPolicyResourceInner.java | 26 +- .../CheckNameAvailabilityResultInner.java | 14 +- ...ClientDiscoveryValueForSingleApiInner.java | 44 +- .../DeletedBackupInstanceResourceInner.java | 57 + .../fluent/models/DppBaseResourceInner.java | 11 +- .../fluent/models/ExportJobsResultInner.java | 17 +- .../FeatureValidationResponseBaseInner.java | 6 +- .../models/OperationJobExtendedInfoInner.java | 14 +- .../fluent/models/OperationResourceInner.java | 37 +- .../ResourceGuardProxyBaseResourceInner.java | 57 + .../models/ResourceGuardResourceInner.java | 8 +- .../models/UnlockDeleteResponseInner.java | 50 + .../BackupInstanceResourceImpl.java | 99 +- .../BackupInstancesClientImpl.java | 2587 ++++++++++++++--- ...pInstancesExtensionRoutingsClientImpl.java | 295 ++ .../BackupInstancesExtensionRoutingsImpl.java | 46 + .../implementation/BackupInstancesImpl.java | 232 +- .../BackupPoliciesClientImpl.java | 375 ++- .../implementation/BackupPoliciesImpl.java | 121 +- ...BackupVaultOperationResultsClientImpl.java | 100 +- .../BackupVaultOperationResultsImpl.java | 25 +- .../BackupVaultResourceImpl.java | 24 +- .../BackupVaultsClientImpl.java | 433 ++- .../implementation/BackupVaultsImpl.java | 66 +- .../BaseBackupPolicyResourceImpl.java | 26 +- .../DataProtectionClientBuilder.java | 62 +- .../DataProtectionClientImpl.java | 85 +- .../DataProtectionOperationsClientImpl.java | 27 +- .../DataProtectionOperationsImpl.java | 3 +- .../DataProtectionsClientImpl.java | 38 +- .../implementation/DataProtectionsImpl.java | 21 +- .../DeletedBackupInstanceResourceImpl.java | 51 + .../DeletedBackupInstancesClientImpl.java | 796 +++++ .../DeletedBackupInstancesImpl.java | 84 + .../DppResourceGuardProxiesClientImpl.java | 1117 +++++++ .../DppResourceGuardProxiesImpl.java | 241 ++ .../implementation/ExportJobsClientImpl.java | 24 +- .../implementation/ExportJobsImpl.java | 3 +- .../ExportJobsOperationResultsClientImpl.java | 36 +- .../ExportJobsOperationResultsImpl.java | 21 +- .../implementation/JobsClientImpl.java | 68 +- .../implementation/JobsImpl.java | 21 +- .../OperationResultsClientImpl.java | 51 +- .../implementation/OperationResultsImpl.java | 21 +- ...onStatusBackupVaultContextsClientImpl.java | 234 ++ ...perationStatusBackupVaultContextsImpl.java | 61 + .../OperationStatusClientImpl.java | 33 +- .../implementation/OperationStatusImpl.java | 21 +- ...StatusResourceGroupContextsClientImpl.java | 222 ++ ...rationStatusResourceGroupContextsImpl.java | 61 + .../RecoveryPointsClientImpl.java | 219 +- .../implementation/RecoveryPointsImpl.java | 37 +- .../ResourceGuardProxyBaseResourceImpl.java | 165 ++ .../ResourceGuardResourceImpl.java | 10 + .../ResourceGuardsClientImpl.java | 569 ++-- .../implementation/ResourceGuardsImpl.java | 96 +- .../RestorableTimeRangesClientImpl.java | 110 +- .../RestorableTimeRangesImpl.java | 35 +- .../UnlockDeleteResponseImpl.java | 33 + .../models/AbsoluteDeleteOption.java | 12 +- .../dataprotection/models/AbsoluteMarker.java | 6 +- .../models/AdHocBackupRuleOptions.java | 31 +- .../models/AdhocBackupTriggerOption.java | 14 +- .../models/AdhocBasedTaggingCriteria.java | 26 +- .../models/AdhocBasedTriggerContext.java | 32 +- .../dataprotection/models/AlertsState.java | 38 + .../models/AuthCredentials.java | 6 +- .../AzureBackupDiscreteRecoveryPoint.java | 17 +- ...BackupFindRestorableTimeRangesRequest.java | 11 +- ...ndRestorableTimeRangesRequestResource.java | 9 +- ...ackupFindRestorableTimeRangesResponse.java | 8 +- .../dataprotection/models/AzureBackupJob.java | 49 +- .../models/AzureBackupJobResourceList.java | 8 +- .../models/AzureBackupParams.java | 17 +- .../models/AzureBackupRecoveryPoint.java | 12 +- ...ackupRecoveryPointBasedRestoreRequest.java | 24 +- .../AzureBackupRecoveryPointResource.java | 4 +- .../AzureBackupRecoveryPointResourceList.java | 14 +- ...BackupRecoveryTimeBasedRestoreRequest.java | 27 +- .../models/AzureBackupRehydrationRequest.java | 19 +- .../models/AzureBackupRestoreRequest.java | 47 +- ...reBackupRestoreWithRehydrationRequest.java | 26 +- .../models/AzureBackupRule.java | 55 +- .../models/AzureMonitorAlertSettings.java | 50 + .../AzureOperationalStoreParameters.java | 8 +- .../models/AzureRetentionRule.java | 17 +- .../dataprotection/models/BackupCriteria.java | 12 +- .../models/BackupDatasourceParameters.java | 38 + .../dataprotection/models/BackupInstance.java | 93 +- .../models/BackupInstanceResource.java | 142 +- .../models/BackupInstanceResourceList.java | 14 +- .../models/BackupInstances.java | 238 +- .../BackupInstancesAdhocBackupHeaders.java | 102 - .../BackupInstancesAdhocBackupResponse.java | 38 - .../models/BackupInstancesDeleteHeaders.java | 102 - .../models/BackupInstancesDeleteResponse.java | 26 - .../BackupInstancesExtensionRoutings.java | 36 + ...ackupInstancesTriggerRehydrateHeaders.java | 102 - ...ckupInstancesTriggerRehydrateResponse.java | 31 - .../BackupInstancesTriggerRestoreHeaders.java | 102 - ...BackupInstancesTriggerRestoreResponse.java | 38 - ...ckupInstancesValidateForBackupHeaders.java | 102 - ...kupInstancesValidateForBackupResponse.java | 38 - ...kupInstancesValidateForRestoreHeaders.java | 102 - ...upInstancesValidateForRestoreResponse.java | 38 - .../models/BackupParameters.java | 12 +- .../dataprotection/models/BackupPolicies.java | 46 +- .../dataprotection/models/BackupPolicy.java | 20 +- .../dataprotection/models/BackupSchedule.java | 17 +- .../dataprotection/models/BackupVault.java | 88 +- .../models/BackupVaultOperationResults.java | 16 +- ...BackupVaultOperationResultsGetHeaders.java | 23 +- ...ackupVaultOperationResultsGetResponse.java | 6 +- .../models/BackupVaultResource.java | 48 +- .../models/BackupVaultResourceList.java | 14 +- .../dataprotection/models/BackupVaults.java | 44 +- .../models/BaseBackupPolicy.java | 17 +- .../models/BaseBackupPolicyResource.java | 31 +- .../models/BaseBackupPolicyResourceList.java | 14 +- .../dataprotection/models/BasePolicyRule.java | 17 +- .../BlobBackupDatasourceParameters.java | 66 + .../models/CheckNameAvailabilityRequest.java | 14 +- .../models/ClientDiscoveryDisplay.java | 14 +- .../ClientDiscoveryForLogSpecification.java | 14 +- .../models/ClientDiscoveryForProperties.java | 26 +- ...lientDiscoveryForServiceSpecification.java | 14 +- .../models/ClientDiscoveryResponse.java | 14 +- .../ClientDiscoveryValueForSingleApi.java | 9 +- .../models/CopyOnExpiryOption.java | 12 +- .../dataprotection/models/CopyOption.java | 12 +- .../models/CurrentProtectionState.java | 8 +- .../models/CustomCopyOption.java | 14 +- .../models/DataProtectionOperations.java | 4 +- .../models/DataProtections.java | 10 +- .../models/DataStoreInfoBase.java | 19 +- .../models/DataStoreParameters.java | 11 +- .../dataprotection/models/DataStoreTypes.java | 8 +- .../dataprotection/models/Datasource.java | 22 +- .../dataprotection/models/DatasourceSet.java | 22 +- .../dataprotection/models/Day.java | 14 +- .../dataprotection/models/DayOfWeek.java | 6 +- .../dataprotection/models/DeleteOption.java | 17 +- .../models/DeletedBackupInstance.java | 93 + .../models/DeletedBackupInstanceResource.java | 53 + .../DeletedBackupInstanceResourceList.java | 64 + .../models/DeletedBackupInstances.java | 90 + .../dataprotection/models/DeletionInfo.java | 84 + .../models/DppBaseResourceList.java | 11 +- .../models/DppIdentityDetails.java | 21 +- .../models/DppProxyResource.java | 70 + .../dataprotection/models/DppResource.java | 14 +- .../models/DppResourceGuardProxies.java | 180 ++ .../models/DppResourceList.java | 17 +- .../models/DppTrackedResource.java | 20 +- .../models/DppTrackedResourceList.java | 11 +- .../models/DppWorkerRequest.java | 11 +- .../models/ExistingResourcePolicy.java | 38 + .../models/ExportJobsOperationResults.java | 10 +- .../models/ExportJobsTriggerHeaders.java | 76 - .../models/ExportJobsTriggerResponse.java | 26 - .../models/FeatureSupportStatus.java | 8 +- .../dataprotection/models/FeatureType.java | 8 +- .../models/FeatureValidationRequest.java | 8 +- .../models/FeatureValidationRequestBase.java | 6 +- .../models/FeatureValidationResponse.java | 8 +- .../models/ImmediateCopyOption.java | 12 +- .../models/ImmutabilitySettings.java | 50 + .../models/ImmutabilityState.java | 41 + .../dataprotection/models/InnerError.java | 29 +- .../models/ItemLevelRestoreCriteria.java | 14 +- .../models/ItemLevelRestoreTargetInfo.java | 37 +- .../models/ItemPathBasedRestoreCriteria.java | 124 + .../models/JobExtendedInfo.java | 8 +- .../dataprotection/models/JobSubTask.java | 13 +- .../dataprotection/models/Jobs.java | 14 +- ...etesClusterBackupDatasourceParameters.java | 232 ++ .../KubernetesClusterRestoreCriteria.java | 292 ++ .../models/KubernetesPVRestoreCriteria.java | 82 + ...KubernetesStorageClassRestoreCriteria.java | 82 + .../models/MonitoringSettings.java | 53 + .../dataprotection/models/Month.java | 6 +- .../models/OperationExtendedInfo.java | 12 +- .../models/OperationResource.java | 4 +- .../models/OperationResults.java | 14 +- .../models/OperationResultsGetHeaders.java | 23 +- .../models/OperationResultsGetResponse.java | 6 +- .../models/OperationStatus.java | 8 +- .../OperationStatusBackupVaultContexts.java | 39 + .../OperationStatusResourceGroupContexts.java | 37 + .../models/PatchBackupVaultInput.java | 82 + .../models/PatchResourceRequestInput.java | 55 +- .../models/PersistentVolumeRestoreMode.java | 39 + .../dataprotection/models/PolicyInfo.java | 17 +- .../models/PolicyParameters.java | 38 +- .../models/ProtectionStatusDetails.java | 14 +- .../models/ProvisioningState.java | 8 +- .../RangeBasedItemLevelRestoreCriteria.java | 8 +- .../dataprotection/models/RecoveryOption.java | 8 +- .../models/RecoveryPointDataStoreDetails.java | 14 +- .../dataprotection/models/RecoveryPoints.java | 28 +- .../models/RehydrationPriority.java | 8 +- .../models/RehydrationStatus.java | 6 +- .../dataprotection/models/ResourceGuard.java | 39 +- .../models/ResourceGuardOperation.java | 8 +- .../models/ResourceGuardOperationDetail.java | 76 + .../ResourceGuardProvisioningState.java | 47 + .../models/ResourceGuardProxyBase.java | 133 + .../ResourceGuardProxyBaseResource.java | 188 ++ .../ResourceGuardProxyBaseResourceList.java | 64 + .../models/ResourceGuardResource.java | 37 +- .../models/ResourceGuardResourceList.java | 8 +- .../dataprotection/models/ResourceGuards.java | 109 +- .../models/ResourceMoveDetails.java | 17 +- .../models/ResourceMoveState.java | 8 +- .../models/RestorableTimeRange.java | 13 +- .../models/RestorableTimeRanges.java | 26 +- .../models/RestoreFilesTargetInfo.java | 14 +- .../RestoreJobRecoveryPointDetails.java | 8 +- .../models/RestoreSourceDataStoreType.java | 8 +- .../models/RestoreTargetInfo.java | 35 +- .../models/RestoreTargetInfoBase.java | 11 +- .../models/RestoreTargetLocationType.java | 11 +- .../dataprotection/models/RetentionTag.java | 17 +- .../models/ScheduleBasedBackupCriteria.java | 25 +- .../models/ScheduleBasedTriggerContext.java | 31 +- .../SecretStoreBasedAuthCredentials.java | 8 +- .../models/SecretStoreResource.java | 37 +- .../models/SecretStoreType.java | 8 +- .../models/SecuritySettings.java | 82 + .../models/SoftDeleteSettings.java | 76 + .../models/SoftDeleteState.java | 41 + .../models/SourceDataStoreType.java | 8 +- .../models/SourceLifeCycle.java | 43 +- .../dataprotection/models/Status.java | 8 +- .../dataprotection/models/StorageSetting.java | 14 +- .../models/StorageSettingStoreTypes.java | 8 +- .../models/StorageSettingTypes.java | 11 +- .../models/SupportedFeature.java | 8 +- .../models/SyncBackupInstanceRequest.java | 50 + .../dataprotection/models/SyncType.java | 38 + .../models/TaggingCriteria.java | 32 +- .../models/TargetCopySetting.java | 43 +- .../dataprotection/models/TargetDetails.java | 21 +- .../models/TriggerBackupRequest.java | 32 +- .../dataprotection/models/TriggerContext.java | 12 +- .../models/UnlockDeleteRequest.java | 77 + .../models/UnlockDeleteResponse.java | 24 + .../models/UserFacingError.java | 20 +- .../models/ValidateForBackupRequest.java | 17 +- .../models/ValidateRestoreRequestObject.java | 29 +- .../dataprotection/models/ValidationType.java | 41 + .../dataprotection/models/WeekNumber.java | 6 +- .../BackupInstancesAdhocBackupSamples.java | 4 +- .../BackupInstancesCreateOrUpdateSamples.java | 24 +- .../BackupInstancesDeleteSamples.java | 4 +- ...pInstancesExtensionRoutingListSamples.java | 27 + ...tBackupInstanceOperationResultSamples.java | 30 + .../generated/BackupInstancesGetSamples.java | 4 +- .../generated/BackupInstancesListSamples.java | 4 +- .../BackupInstancesResumeBackupsSamples.java | 22 + ...ackupInstancesResumeProtectionSamples.java | 22 + .../BackupInstancesStopProtectionSamples.java | 22 + .../BackupInstancesSuspendBackupsSamples.java | 22 + ...kupInstancesSyncBackupInstanceSamples.java | 31 + ...ackupInstancesTriggerRehydrateSamples.java | 2 +- .../BackupInstancesTriggerRestoreSamples.java | 36 +- ...ckupInstancesValidateForBackupSamples.java | 4 +- ...kupInstancesValidateForRestoreSamples.java | 14 +- .../BackupPoliciesCreateOrUpdateSamples.java | 4 +- .../BackupPoliciesDeleteSamples.java | 4 +- .../generated/BackupPoliciesGetSamples.java | 4 +- .../generated/BackupPoliciesListSamples.java | 4 +- ...BackupVaultOperationResultsGetSamples.java | 4 +- ...kupVaultsCheckNameAvailabilitySamples.java | 2 +- .../BackupVaultsCreateOrUpdateSamples.java | 15 +- .../generated/BackupVaultsDeleteSamples.java | 4 +- ...BackupVaultsGetByResourceGroupSamples.java | 4 +- ...ackupVaultsListByResourceGroupSamples.java | 2 +- .../generated/BackupVaultsListSamples.java | 2 +- .../generated/BackupVaultsUpdateSamples.java | 17 +- ...aProtectionCheckFeatureSupportSamples.java | 2 +- .../DataProtectionOperationsListSamples.java | 2 +- .../DeletedBackupInstancesGetSamples.java | 25 + .../DeletedBackupInstancesListSamples.java | 23 + ...DeletedBackupInstancesUndeleteSamples.java | 23 + .../DppResourceGuardProxyDeleteSamples.java | 25 + .../DppResourceGuardProxyGetSamples.java | 24 + .../DppResourceGuardProxyListSamples.java | 22 + .../DppResourceGuardProxyPutSamples.java | 31 + ...ResourceGuardProxyUnlockDeleteSamples.java | 38 + .../ExportJobsOperationResultGetSamples.java | 2 +- .../generated/ExportJobsTriggerSamples.java | 2 +- .../generated/JobsGetSamples.java | 2 +- .../generated/JobsListSamples.java | 2 +- .../generated/OperationResultGetSamples.java | 2 +- ...ionStatusBackupVaultContextGetSamples.java | 28 + .../generated/OperationStatusGetSamples.java | 2 +- ...GroupContextGetByResourceGroupSamples.java | 27 + .../generated/RecoveryPointsGetSamples.java | 4 +- .../generated/RecoveryPointsListSamples.java | 4 +- .../ResourceGuardsDeleteSamples.java | 6 +- ...ckupSecurityPinRequestsObjectsSamples.java | 2 +- ...sourceGuardsGetByResourceGroupSamples.java | 2 +- ...ackupSecurityPinRequestsObjectSamples.java | 2 +- ...eteProtectedItemRequestsObjectSamples.java | 2 +- ...sourceGuardProxyRequestsObjectSamples.java | 2 +- ...isableSoftDeleteRequestsObjectSamples.java | 2 +- ...ateProtectedItemRequestsObjectSamples.java | 2 +- ...ProtectionPolicyRequestsObjectSamples.java | 2 +- ...teProtectedItemRequestsObjectsSamples.java | 2 +- ...ourceGuardProxyRequestsObjectsSamples.java | 2 +- ...sableSoftDeleteRequestsObjectsSamples.java | 2 +- ...teProtectedItemRequestsObjectsSamples.java | 2 +- ...rotectionPolicyRequestsObjectsSamples.java | 2 +- ...ourceGuardsListByResourceGroupSamples.java | 2 +- .../generated/ResourceGuardsListSamples.java | 2 +- .../generated/ResourceGuardsPatchSamples.java | 2 +- .../generated/ResourceGuardsPutSamples.java | 2 +- .../RestorableTimeRangesFindSamples.java | 4 +- 349 files changed, 15134 insertions(+), 4354 deletions(-) create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupInstancesExtensionRoutingsClient.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DeletedBackupInstancesClient.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DppResourceGuardProxiesClient.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationStatusBackupVaultContextsClient.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationStatusResourceGroupContextsClient.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/DeletedBackupInstanceResourceInner.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ResourceGuardProxyBaseResourceInner.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/UnlockDeleteResponseInner.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesExtensionRoutingsClientImpl.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesExtensionRoutingsImpl.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstanceResourceImpl.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesClientImpl.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesImpl.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DppResourceGuardProxiesClientImpl.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DppResourceGuardProxiesImpl.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusBackupVaultContextsClientImpl.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusBackupVaultContextsImpl.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusResourceGroupContextsClientImpl.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusResourceGroupContextsImpl.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardProxyBaseResourceImpl.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/UnlockDeleteResponseImpl.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AlertsState.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureMonitorAlertSettings.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupDatasourceParameters.java delete mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesAdhocBackupHeaders.java delete mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesAdhocBackupResponse.java delete mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesDeleteHeaders.java delete mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesDeleteResponse.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesExtensionRoutings.java delete mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRehydrateHeaders.java delete mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRehydrateResponse.java delete mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRestoreHeaders.java delete mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRestoreResponse.java delete mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForBackupHeaders.java delete mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForBackupResponse.java delete mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForRestoreHeaders.java delete mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForRestoreResponse.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BlobBackupDatasourceParameters.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstance.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstanceResource.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstanceResourceList.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstances.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletionInfo.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppProxyResource.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppResourceGuardProxies.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExistingResourcePolicy.java delete mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExportJobsTriggerHeaders.java delete mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExportJobsTriggerResponse.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ImmutabilitySettings.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ImmutabilityState.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ItemPathBasedRestoreCriteria.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesClusterBackupDatasourceParameters.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesClusterRestoreCriteria.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesPVRestoreCriteria.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesStorageClassRestoreCriteria.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/MonitoringSettings.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationStatusBackupVaultContexts.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationStatusResourceGroupContexts.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PatchBackupVaultInput.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PersistentVolumeRestoreMode.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardOperationDetail.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProvisioningState.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProxyBase.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProxyBaseResource.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProxyBaseResourceList.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecuritySettings.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SoftDeleteSettings.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SoftDeleteState.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SyncBackupInstanceRequest.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SyncType.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/UnlockDeleteRequest.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/UnlockDeleteResponse.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ValidationType.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesExtensionRoutingListSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesGetBackupInstanceOperationResultSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesResumeBackupsSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesResumeProtectionSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesStopProtectionSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesSuspendBackupsSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesSyncBackupInstanceSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DeletedBackupInstancesGetSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DeletedBackupInstancesListSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DeletedBackupInstancesUndeleteSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyDeleteSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyGetSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyListSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyPutSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyUnlockDeleteSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationStatusBackupVaultContextGetSamples.java create mode 100644 sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationStatusResourceGroupContextGetByResourceGroupSamples.java diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/CHANGELOG.md b/sdk/dataprotection/azure-resourcemanager-dataprotection/CHANGELOG.md index c2ce0fdad758..f582fa5fbd3f 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/CHANGELOG.md +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-12-15) + +- Azure Resource Manager DataProtection client library for Java. This package contains Microsoft Azure SDK for DataProtection Management SDK. Open API 2.0 Specs for Azure Data Protection service. Package tag package-preview-2022-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/README.md b/sdk/dataprotection/azure-resourcemanager-dataprotection/README.md index ed24adb92a26..c460c45b5730 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/README.md +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/README.md @@ -2,7 +2,7 @@ Azure Resource Manager DataProtection client library for Java. -This package contains Microsoft Azure SDK for DataProtection Management SDK. Open API 2.0 Specs for Azure Data Protection service. Package tag package-2021-07. 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 DataProtection Management SDK. Open API 2.0 Specs for Azure Data Protection service. Package tag package-preview-2022-11. 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-dataprotection - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -100,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/SAMPLE.md b/sdk/dataprotection/azure-resourcemanager-dataprotection/SAMPLE.md index 76e07d07c747..e875a5f24ed4 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/SAMPLE.md +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/SAMPLE.md @@ -7,12 +7,22 @@ - [CreateOrUpdate](#backupinstances_createorupdate) - [Delete](#backupinstances_delete) - [Get](#backupinstances_get) +- [GetBackupInstanceOperationResult](#backupinstances_getbackupinstanceoperationresult) - [List](#backupinstances_list) +- [ResumeBackups](#backupinstances_resumebackups) +- [ResumeProtection](#backupinstances_resumeprotection) +- [StopProtection](#backupinstances_stopprotection) +- [SuspendBackups](#backupinstances_suspendbackups) +- [SyncBackupInstance](#backupinstances_syncbackupinstance) - [TriggerRehydrate](#backupinstances_triggerrehydrate) - [TriggerRestore](#backupinstances_triggerrestore) - [ValidateForBackup](#backupinstances_validateforbackup) - [ValidateForRestore](#backupinstances_validateforrestore) +## BackupInstancesExtensionRouting + +- [List](#backupinstancesextensionrouting_list) + ## BackupPolicies - [CreateOrUpdate](#backuppolicies_createorupdate) @@ -42,6 +52,20 @@ - [List](#dataprotectionoperations_list) +## DeletedBackupInstances + +- [Get](#deletedbackupinstances_get) +- [List](#deletedbackupinstances_list) +- [Undelete](#deletedbackupinstances_undelete) + +## DppResourceGuardProxy + +- [Delete](#dppresourceguardproxy_delete) +- [Get](#dppresourceguardproxy_get) +- [List](#dppresourceguardproxy_list) +- [Put](#dppresourceguardproxy_put) +- [UnlockDelete](#dppresourceguardproxy_unlockdelete) + ## ExportJobs - [Trigger](#exportjobs_trigger) @@ -63,6 +87,14 @@ - [Get](#operationstatus_get) +## OperationStatusBackupVaultContext + +- [Get](#operationstatusbackupvaultcontext_get) + +## OperationStatusResourceGroupContext + +- [GetByResourceGroup](#operationstatusresourcegroupcontext_getbyresourcegroup) + ## RecoveryPoints - [Get](#recoverypoints_get) @@ -103,7 +135,7 @@ import com.azure.resourcemanager.dataprotection.models.TriggerBackupRequest; /** Samples for BackupInstances AdhocBackup. */ public final class BackupInstancesAdhocBackupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/TriggerBackup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/TriggerBackup.json */ /** * Sample code: Trigger Adhoc Backup. @@ -114,8 +146,8 @@ public final class BackupInstancesAdhocBackupSamples { manager .backupInstances() .adhocBackup( - "PratikPrivatePreviewVault1", "000pikumar", + "PratikPrivatePreviewVault1", "testInstance1", new TriggerBackupRequest() .withBackupRuleOptions( @@ -140,12 +172,15 @@ import com.azure.resourcemanager.dataprotection.models.PolicyParameters; import com.azure.resourcemanager.dataprotection.models.SecretStoreBasedAuthCredentials; import com.azure.resourcemanager.dataprotection.models.SecretStoreResource; import com.azure.resourcemanager.dataprotection.models.SecretStoreType; +import com.azure.resourcemanager.dataprotection.models.ValidationType; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** Samples for BackupInstances CreateOrUpdate. */ public final class BackupInstancesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/PutBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/PutBackupInstance.json */ /** * Sample code: Create BackupInstance. @@ -156,13 +191,14 @@ public final class BackupInstancesCreateOrUpdateSamples { manager .backupInstances() .define("testInstance1") - .withExistingBackupVault("PratikPrivatePreviewVault1", "000pikumar") + .withExistingBackupVault("000pikumar", "PratikPrivatePreviewVault1") + .withTags(mapOf("key1", "val1")) .withProperties( new BackupInstance() .withFriendlyName("harshitbi2") .withDataSourceInfo( new Datasource() - .withDatasourceType("OssDB") + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") .withObjectType("Datasource") .withResourceId( "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb") @@ -172,7 +208,7 @@ public final class BackupInstancesCreateOrUpdateSamples { .withResourceUri("")) .withDataSourceSetInfo( new DatasourceSet() - .withDatasourceType("OssDB") + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") .withObjectType("DatasourceSet") .withResourceId( "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest") @@ -199,9 +235,21 @@ public final class BackupInstancesCreateOrUpdateSamples { new SecretStoreResource() .withUri("https://samplevault.vault.azure.net/secrets/credentials") .withSecretStoreType(SecretStoreType.AZURE_KEY_VAULT))) + .withValidationType(ValidationType.SHALLOW_VALIDATION) .withObjectType("BackupInstance")) .create(); } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } ``` @@ -213,7 +261,7 @@ import com.azure.core.util.Context; /** Samples for BackupInstances Delete. */ public final class BackupInstancesDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/DeleteBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/DeleteBackupInstance.json */ /** * Sample code: Delete BackupInstance. @@ -221,7 +269,7 @@ public final class BackupInstancesDeleteSamples { * @param manager Entry point to DataProtectionManager. */ public static void deleteBackupInstance(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { - manager.backupInstances().delete("PratikPrivatePreviewVault1", "000pikumar", "testInstance1", Context.NONE); + manager.backupInstances().delete("000pikumar", "PratikPrivatePreviewVault1", "testInstance1", Context.NONE); } } ``` @@ -234,7 +282,7 @@ import com.azure.core.util.Context; /** Samples for BackupInstances Get. */ public final class BackupInstancesGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/GetBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/GetBackupInstance.json */ /** * Sample code: Get BackupInstance. @@ -244,7 +292,36 @@ public final class BackupInstancesGetSamples { public static void getBackupInstance(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { manager .backupInstances() - .getWithResponse("PratikPrivatePreviewVault1", "000pikumar", "testInstance1", Context.NONE); + .getWithResponse("000pikumar", "PratikPrivatePreviewVault1", "testInstance1", Context.NONE); + } +} +``` + +### BackupInstances_GetBackupInstanceOperationResult + +```java +import com.azure.core.util.Context; + +/** Samples for BackupInstances GetBackupInstanceOperationResult. */ +public final class BackupInstancesGetBackupInstanceOperationResultSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/GetBackupInstanceOperationResult.json + */ + /** + * Sample code: Get BackupInstanceOperationResult. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void getBackupInstanceOperationResult( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .backupInstances() + .getBackupInstanceOperationResultWithResponse( + "SampleResourceGroup", + "swaggerExample", + "testInstance1", + "YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==", + Context.NONE); } } ``` @@ -257,7 +334,7 @@ import com.azure.core.util.Context; /** Samples for BackupInstances List. */ public final class BackupInstancesListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/ListBackupInstances.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/ListBackupInstances.json */ /** * Sample code: List BackupInstances in a Vault. @@ -266,7 +343,121 @@ public final class BackupInstancesListSamples { */ public static void listBackupInstancesInAVault( com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { - manager.backupInstances().list("PratikPrivatePreviewVault1", "000pikumar", Context.NONE); + manager.backupInstances().list("000pikumar", "PratikPrivatePreviewVault1", Context.NONE); + } +} +``` + +### BackupInstances_ResumeBackups + +```java +import com.azure.core.util.Context; + +/** Samples for BackupInstances ResumeBackups. */ +public final class BackupInstancesResumeBackupsSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/ResumeBackups.json + */ + /** + * Sample code: ResumeBackups. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void resumeBackups(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager.backupInstances().resumeBackups("testrg", "testvault", "testbi", Context.NONE); + } +} +``` + +### BackupInstances_ResumeProtection + +```java +import com.azure.core.util.Context; + +/** Samples for BackupInstances ResumeProtection. */ +public final class BackupInstancesResumeProtectionSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/ResumeProtection.json + */ + /** + * Sample code: ResumeProtection. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void resumeProtection(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager.backupInstances().resumeProtection("testrg", "testvault", "testbi", Context.NONE); + } +} +``` + +### BackupInstances_StopProtection + +```java +import com.azure.core.util.Context; + +/** Samples for BackupInstances StopProtection. */ +public final class BackupInstancesStopProtectionSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/StopProtection.json + */ + /** + * Sample code: StopProtection. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void stopProtection(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager.backupInstances().stopProtection("testrg", "testvault", "testbi", Context.NONE); + } +} +``` + +### BackupInstances_SuspendBackups + +```java +import com.azure.core.util.Context; + +/** Samples for BackupInstances SuspendBackups. */ +public final class BackupInstancesSuspendBackupsSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/SuspendBackups.json + */ + /** + * Sample code: SuspendBackups. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void suspendBackups(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager.backupInstances().suspendBackups("testrg", "testvault", "testbi", Context.NONE); + } +} +``` + +### BackupInstances_SyncBackupInstance + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.dataprotection.models.SyncBackupInstanceRequest; +import com.azure.resourcemanager.dataprotection.models.SyncType; + +/** Samples for BackupInstances SyncBackupInstance. */ +public final class BackupInstancesSyncBackupInstanceSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/SyncBackupInstance.json + */ + /** + * Sample code: Sync BackupInstance. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void syncBackupInstance(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .backupInstances() + .syncBackupInstance( + "testrg", + "testvault", + "testbi", + new SyncBackupInstanceRequest().withSyncType(SyncType.DEFAULT), + Context.NONE); } } ``` @@ -281,7 +472,7 @@ import com.azure.resourcemanager.dataprotection.models.RehydrationPriority; /** Samples for BackupInstances TriggerRehydrate. */ public final class BackupInstancesTriggerRehydrateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/TriggerRehydrate.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/TriggerRehydrate.json */ /** * Sample code: Trigger Rehydrate. @@ -309,10 +500,11 @@ public final class BackupInstancesTriggerRehydrateSamples { ```java import com.azure.core.util.Context; import com.azure.resourcemanager.dataprotection.models.AzureBackupRecoveryPointBasedRestoreRequest; -import com.azure.resourcemanager.dataprotection.models.AzureBackupRestoreRequest; +import com.azure.resourcemanager.dataprotection.models.AzureBackupRestoreWithRehydrationRequest; import com.azure.resourcemanager.dataprotection.models.Datasource; import com.azure.resourcemanager.dataprotection.models.DatasourceSet; import com.azure.resourcemanager.dataprotection.models.RecoveryOption; +import com.azure.resourcemanager.dataprotection.models.RehydrationPriority; import com.azure.resourcemanager.dataprotection.models.RestoreFilesTargetInfo; import com.azure.resourcemanager.dataprotection.models.RestoreTargetInfo; import com.azure.resourcemanager.dataprotection.models.RestoreTargetLocationType; @@ -325,7 +517,7 @@ import com.azure.resourcemanager.dataprotection.models.TargetDetails; /** Samples for BackupInstances TriggerRestore. */ public final class BackupInstancesTriggerRestoreSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/TriggerRestoreAsFiles.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/TriggerRestoreAsFiles.json */ /** * Sample code: Trigger Restore As Files. @@ -336,8 +528,8 @@ public final class BackupInstancesTriggerRestoreSamples { manager .backupInstances() .triggerRestore( - "PrivatePreviewVault1", "000pikumar", + "PrivatePreviewVault1", "testInstance1", new AzureBackupRecoveryPointBasedRestoreRequest() .withRestoreTargetInfo( @@ -350,12 +542,14 @@ public final class BackupInstancesTriggerRestoreSamples { .withRestoreTargetLocationType(RestoreTargetLocationType.AZURE_BLOBS) .withUrl("https://teststorage.blob.core.windows.net/restoretest"))) .withSourceDataStoreType(SourceDataStoreType.VAULT_STORE) + .withSourceResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb") .withRecoveryPointId("hardcodedRP"), Context.NONE); } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/TriggerRestoreWithRehydration.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/TriggerRestoreWithRehydration.json */ /** * Sample code: Trigger Restore With Rehydration. @@ -367,10 +561,10 @@ public final class BackupInstancesTriggerRestoreSamples { manager .backupInstances() .triggerRestore( - "PratikPrivatePreviewVault1", "000pikumar", + "PratikPrivatePreviewVault1", "testInstance1", - new AzureBackupRestoreRequest() + new AzureBackupRestoreWithRehydrationRequest() .withRestoreTargetInfo( new RestoreTargetInfo() .withRecoveryOption(RecoveryOption.FAIL_IF_EXISTS) @@ -395,12 +589,17 @@ public final class BackupInstancesTriggerRestoreSamples { .withResourceName("viveksipgtest") .withResourceType("Microsoft.DBforPostgreSQL/servers") .withResourceUri(""))) - .withSourceDataStoreType(SourceDataStoreType.VAULT_STORE), + .withSourceDataStoreType(SourceDataStoreType.VAULT_STORE) + .withSourceResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb") + .withRecoveryPointId("hardcodedRP") + .withRehydrationPriority(RehydrationPriority.HIGH) + .withRehydrationRetentionDuration("7D"), Context.NONE); } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/TriggerRestore.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/TriggerRestore.json */ /** * Sample code: Trigger Restore. @@ -411,8 +610,8 @@ public final class BackupInstancesTriggerRestoreSamples { manager .backupInstances() .triggerRestore( - "PratikPrivatePreviewVault1", "000pikumar", + "PratikPrivatePreviewVault1", "testInstance1", new AzureBackupRecoveryPointBasedRestoreRequest() .withRestoreTargetInfo( @@ -421,17 +620,17 @@ public final class BackupInstancesTriggerRestoreSamples { .withRestoreLocation("southeastasia") .withDatasourceInfo( new Datasource() - .withDatasourceType("OssDB") + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") .withObjectType("Datasource") .withResourceId( - "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb") + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/targetdb") .withResourceLocation("") - .withResourceName("testdb") + .withResourceName("targetdb") .withResourceType("Microsoft.DBforPostgreSQL/servers/databases") .withResourceUri("")) .withDatasourceSetInfo( new DatasourceSet() - .withDatasourceType("OssDB") + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") .withObjectType("DatasourceSet") .withResourceId( "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest") @@ -446,6 +645,8 @@ public final class BackupInstancesTriggerRestoreSamples { .withUri("https://samplevault.vault.azure.net/secrets/credentials") .withSecretStoreType(SecretStoreType.AZURE_KEY_VAULT)))) .withSourceDataStoreType(SourceDataStoreType.VAULT_STORE) + .withSourceResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb") .withRecoveryPointId("hardcodedRP"), Context.NONE); } @@ -468,7 +669,7 @@ import com.azure.resourcemanager.dataprotection.models.ValidateForBackupRequest; /** Samples for BackupInstances ValidateForBackup. */ public final class BackupInstancesValidateForBackupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/ValidateForBackup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/ValidateForBackup.json */ /** * Sample code: Validate For Backup. @@ -479,8 +680,8 @@ public final class BackupInstancesValidateForBackupSamples { manager .backupInstances() .validateForBackup( - "PratikPrivatePreviewVault1", "000pikumar", + "PratikPrivatePreviewVault1", new ValidateForBackupRequest() .withBackupInstance( new BackupInstance() @@ -539,7 +740,7 @@ import com.azure.resourcemanager.dataprotection.models.ValidateRestoreRequestObj /** Samples for BackupInstances ValidateForRestore. */ public final class BackupInstancesValidateForRestoreSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/ValidateRestore.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/ValidateRestore.json */ /** * Sample code: Validate Restore. @@ -550,8 +751,8 @@ public final class BackupInstancesValidateForRestoreSamples { manager .backupInstances() .validateForRestore( - "PratikPrivatePreviewVault1", "000pikumar", + "PratikPrivatePreviewVault1", "testInstance1", new ValidateRestoreRequestObject() .withRestoreRequestObject( @@ -562,17 +763,17 @@ public final class BackupInstancesValidateForRestoreSamples { .withRestoreLocation("southeastasia") .withDatasourceInfo( new Datasource() - .withDatasourceType("OssDB") + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") .withObjectType("Datasource") .withResourceId( - "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb") + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/targetdb") .withResourceLocation("") - .withResourceName("testdb") + .withResourceName("targetdb") .withResourceType("Microsoft.DBforPostgreSQL/servers/databases") .withResourceUri("")) .withDatasourceSetInfo( new DatasourceSet() - .withDatasourceType("OssDB") + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") .withObjectType("DatasourceSet") .withResourceId( "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest") @@ -587,12 +788,40 @@ public final class BackupInstancesValidateForRestoreSamples { .withUri("https://samplevault.vault.azure.net/secrets/credentials") .withSecretStoreType(SecretStoreType.AZURE_KEY_VAULT)))) .withSourceDataStoreType(SourceDataStoreType.VAULT_STORE) + .withSourceResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb") .withRecoveryPointId("hardcodedRP")), Context.NONE); } } ``` +### BackupInstancesExtensionRouting_List + +```java +import com.azure.core.util.Context; + +/** Samples for BackupInstancesExtensionRouting List. */ +public final class BackupInstancesExtensionRoutingListSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/ListBackupInstancesExtensionRouting.json + */ + /** + * Sample code: List BackupInstances associated with an azure resource. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void listBackupInstancesAssociatedWithAnAzureResource( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .backupInstancesExtensionRoutings() + .list( + "subscriptions/36d32b25-3dc7-41b0-bde1-397500644591/resourceGroups/testRG/providers/Microsoft.Compute/disks/testDisk", + Context.NONE); + } +} +``` + ### BackupPolicies_CreateOrUpdate ```java @@ -616,7 +845,7 @@ import java.util.Arrays; /** Samples for BackupPolicies CreateOrUpdate. */ public final class BackupPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/PolicyCRUD/CreateOrUpdateBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/PolicyCRUD/CreateOrUpdateBackupPolicy.json */ /** * Sample code: CreateOrUpdate BackupPolicy. @@ -628,7 +857,7 @@ public final class BackupPoliciesCreateOrUpdateSamples { manager .backupPolicies() .define("OSSDBPolicy") - .withExistingBackupVault("PrivatePreviewVault", "000pikumar") + .withExistingBackupVault("000pikumar", "PrivatePreviewVault") .withProperties( new BackupPolicy() .withDatasourceTypes(Arrays.asList("OssDB")) @@ -708,7 +937,7 @@ import com.azure.core.util.Context; /** Samples for BackupPolicies Delete. */ public final class BackupPoliciesDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/PolicyCRUD/DeleteBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/PolicyCRUD/DeleteBackupPolicy.json */ /** * Sample code: Delete BackupPolicy. @@ -716,7 +945,7 @@ public final class BackupPoliciesDeleteSamples { * @param manager Entry point to DataProtectionManager. */ public static void deleteBackupPolicy(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { - manager.backupPolicies().deleteWithResponse("PrivatePreviewVault", "000pikumar", "OSSDBPolicy", Context.NONE); + manager.backupPolicies().deleteWithResponse("000pikumar", "PrivatePreviewVault", "OSSDBPolicy", Context.NONE); } } ``` @@ -729,7 +958,7 @@ import com.azure.core.util.Context; /** Samples for BackupPolicies Get. */ public final class BackupPoliciesGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/PolicyCRUD/GetBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/PolicyCRUD/GetBackupPolicy.json */ /** * Sample code: Get BackupPolicy. @@ -737,7 +966,7 @@ public final class BackupPoliciesGetSamples { * @param manager Entry point to DataProtectionManager. */ public static void getBackupPolicy(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { - manager.backupPolicies().getWithResponse("PrivatePreviewVault", "000pikumar", "OSSDBPolicy", Context.NONE); + manager.backupPolicies().getWithResponse("000pikumar", "PrivatePreviewVault", "OSSDBPolicy", Context.NONE); } } ``` @@ -750,7 +979,7 @@ import com.azure.core.util.Context; /** Samples for BackupPolicies List. */ public final class BackupPoliciesListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/PolicyCRUD/ListBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/PolicyCRUD/ListBackupPolicy.json */ /** * Sample code: List BackupPolicy. @@ -758,7 +987,7 @@ public final class BackupPoliciesListSamples { * @param manager Entry point to DataProtectionManager. */ public static void listBackupPolicy(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { - manager.backupPolicies().list("PrivatePreviewVault", "000pikumar", Context.NONE); + manager.backupPolicies().list("000pikumar", "PrivatePreviewVault", Context.NONE); } } ``` @@ -771,7 +1000,7 @@ import com.azure.core.util.Context; /** Samples for BackupVaultOperationResults Get. */ public final class BackupVaultOperationResultsGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/GetOperationResultPatch.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/GetOperationResultPatch.json */ /** * Sample code: GetOperationResult Patch. @@ -782,8 +1011,8 @@ public final class BackupVaultOperationResultsGetSamples { manager .backupVaultOperationResults() .getWithResponse( - "swaggerExample", "SampleResourceGroup", + "swaggerExample", "YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==", Context.NONE); } @@ -799,7 +1028,7 @@ import com.azure.resourcemanager.dataprotection.models.CheckNameAvailabilityRequ /** Samples for BackupVaults CheckNameAvailability. */ public final class BackupVaultsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/CheckBackupVaultsNameAvailability.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/CheckBackupVaultsNameAvailability.json */ /** * Sample code: Check BackupVaults name availability. @@ -824,8 +1053,11 @@ public final class BackupVaultsCheckNameAvailabilitySamples { ### BackupVaults_CreateOrUpdate ```java +import com.azure.resourcemanager.dataprotection.models.AlertsState; +import com.azure.resourcemanager.dataprotection.models.AzureMonitorAlertSettings; import com.azure.resourcemanager.dataprotection.models.BackupVault; import com.azure.resourcemanager.dataprotection.models.DppIdentityDetails; +import com.azure.resourcemanager.dataprotection.models.MonitoringSettings; import com.azure.resourcemanager.dataprotection.models.StorageSetting; import com.azure.resourcemanager.dataprotection.models.StorageSettingStoreTypes; import com.azure.resourcemanager.dataprotection.models.StorageSettingTypes; @@ -836,7 +1068,7 @@ import java.util.Map; /** Samples for BackupVaults CreateOrUpdate. */ public final class BackupVaultsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/PutBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/PutBackupVault.json */ /** * Sample code: Create BackupVault. @@ -851,6 +1083,10 @@ public final class BackupVaultsCreateOrUpdateSamples { .withExistingResourceGroup("SampleResourceGroup") .withProperties( new BackupVault() + .withMonitoringSettings( + new MonitoringSettings() + .withAzureMonitorAlertSettings( + new AzureMonitorAlertSettings().withAlertsForAllJobFailures(AlertsState.ENABLED))) .withStorageSettings( Arrays .asList( @@ -863,7 +1099,7 @@ public final class BackupVaultsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/PutBackupVaultWithMSI.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/PutBackupVaultWithMSI.json */ /** * Sample code: Create BackupVault With MSI. @@ -879,6 +1115,10 @@ public final class BackupVaultsCreateOrUpdateSamples { .withExistingResourceGroup("SampleResourceGroup") .withProperties( new BackupVault() + .withMonitoringSettings( + new MonitoringSettings() + .withAzureMonitorAlertSettings( + new AzureMonitorAlertSettings().withAlertsForAllJobFailures(AlertsState.ENABLED))) .withStorageSettings( Arrays .asList( @@ -911,7 +1151,7 @@ import com.azure.core.util.Context; /** Samples for BackupVaults Delete. */ public final class BackupVaultsDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/DeleteBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/DeleteBackupVault.json */ /** * Sample code: Delete BackupVault. @@ -919,7 +1159,7 @@ public final class BackupVaultsDeleteSamples { * @param manager Entry point to DataProtectionManager. */ public static void deleteBackupVault(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { - manager.backupVaults().deleteWithResponse("SampleResourceGroup", "swaggerExample", Context.NONE); + manager.backupVaults().deleteByResourceGroupWithResponse("SampleResourceGroup", "swaggerExample", Context.NONE); } } ``` @@ -932,7 +1172,7 @@ import com.azure.core.util.Context; /** Samples for BackupVaults GetByResourceGroup. */ public final class BackupVaultsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/GetBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/GetBackupVault.json */ /** * Sample code: Get BackupVault. @@ -944,7 +1184,7 @@ public final class BackupVaultsGetByResourceGroupSamples { } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/GetBackupVaultWithMSI.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/GetBackupVaultWithMSI.json */ /** * Sample code: Get BackupVault With MSI. @@ -965,7 +1205,7 @@ import com.azure.core.util.Context; /** Samples for BackupVaults List. */ public final class BackupVaultsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/GetBackupVaultsInSubscription.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/GetBackupVaultsInSubscription.json */ /** * Sample code: Get BackupVaults in Subscription. @@ -987,7 +1227,7 @@ import com.azure.core.util.Context; /** Samples for BackupVaults ListByResourceGroup. */ public final class BackupVaultsListByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/GetBackupVaultsInResourceGroup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/GetBackupVaultsInResourceGroup.json */ /** * Sample code: Get BackupVaults in ResourceGroup. @@ -1005,14 +1245,18 @@ public final class BackupVaultsListByResourceGroupSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.dataprotection.models.AlertsState; +import com.azure.resourcemanager.dataprotection.models.AzureMonitorAlertSettings; import com.azure.resourcemanager.dataprotection.models.BackupVaultResource; +import com.azure.resourcemanager.dataprotection.models.MonitoringSettings; +import com.azure.resourcemanager.dataprotection.models.PatchBackupVaultInput; import java.util.HashMap; import java.util.Map; /** Samples for BackupVaults Update. */ public final class BackupVaultsUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/PatchBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/PatchBackupVault.json */ /** * Sample code: Patch BackupVault. @@ -1025,7 +1269,16 @@ public final class BackupVaultsUpdateSamples { .backupVaults() .getByResourceGroupWithResponse("SampleResourceGroup", "swaggerExample", Context.NONE) .getValue(); - resource.update().withTags(mapOf("newKey", "newVal")).apply(); + resource + .update() + .withTags(mapOf("newKey", "newVal")) + .withProperties( + new PatchBackupVaultInput() + .withMonitoringSettings( + new MonitoringSettings() + .withAzureMonitorAlertSettings( + new AzureMonitorAlertSettings().withAlertsForAllJobFailures(AlertsState.ENABLED)))) + .apply(); } @SuppressWarnings("unchecked") @@ -1051,7 +1304,7 @@ import com.azure.resourcemanager.dataprotection.models.FeatureValidationRequest; /** Samples for DataProtection CheckFeatureSupport. */ public final class DataProtectionCheckFeatureSupportSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/CheckfeatureSupport.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/CheckfeatureSupport.json */ /** * Sample code: Check Azure Vm Backup Feature Support. @@ -1076,7 +1329,7 @@ import com.azure.core.util.Context; /** Samples for DataProtectionOperations List. */ public final class DataProtectionOperationsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/Operations/List.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/Operations/List.json */ /** * Sample code: Returns the list of supported REST operations. @@ -1090,6 +1343,209 @@ public final class DataProtectionOperationsListSamples { } ``` +### DeletedBackupInstances_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DeletedBackupInstances Get. */ +public final class DeletedBackupInstancesGetSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/DeletedBackupInstanceOperations/GetDeletedBackupInstance.json + */ + /** + * Sample code: Get DeletedBackupInstance. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void getDeletedBackupInstance( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .deletedBackupInstances() + .getWithResponse("000pikumar", "PratikPrivatePreviewVault1", "testInstance1", Context.NONE); + } +} +``` + +### DeletedBackupInstances_List + +```java +import com.azure.core.util.Context; + +/** Samples for DeletedBackupInstances List. */ +public final class DeletedBackupInstancesListSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/DeletedBackupInstanceOperations/ListDeletedBackupInstances.json + */ + /** + * Sample code: List DeletedBackupInstances in a Vault. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void listDeletedBackupInstancesInAVault( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager.deletedBackupInstances().list("000pikumar", "PratikPrivatePreviewVault1", Context.NONE); + } +} +``` + +### DeletedBackupInstances_Undelete + +```java +import com.azure.core.util.Context; + +/** Samples for DeletedBackupInstances Undelete. */ +public final class DeletedBackupInstancesUndeleteSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/DeletedBackupInstanceOperations/UndeleteDeletedBackupInstance.json + */ + /** + * Sample code: Undelete Deleted BackupInstance. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void undeleteDeletedBackupInstance( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager.deletedBackupInstances().undelete("testrg", "testvault", "testbi", Context.NONE); + } +} +``` + +### DppResourceGuardProxy_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DppResourceGuardProxy Delete. */ +public final class DppResourceGuardProxyDeleteSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json + */ + /** + * Sample code: Delete ResourceGuardProxy. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void deleteResourceGuardProxy( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .dppResourceGuardProxies() + .deleteWithResponse("SampleResourceGroup", "sampleVault", "swaggerExample", Context.NONE); + } +} +``` + +### DppResourceGuardProxy_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DppResourceGuardProxy Get. */ +public final class DppResourceGuardProxyGetSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json + */ + /** + * Sample code: Get ResourceGuardProxy. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void getResourceGuardProxy(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .dppResourceGuardProxies() + .getWithResponse("SampleResourceGroup", "sampleVault", "swaggerExample", Context.NONE); + } +} +``` + +### DppResourceGuardProxy_List + +```java +import com.azure.core.util.Context; + +/** Samples for DppResourceGuardProxy List. */ +public final class DppResourceGuardProxyListSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json + */ + /** + * Sample code: Get ResourceGuardProxies. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void getResourceGuardProxies(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager.dppResourceGuardProxies().list("SampleResourceGroup", "sampleVault", Context.NONE); + } +} +``` + +### DppResourceGuardProxy_Put + +```java +import com.azure.resourcemanager.dataprotection.models.ResourceGuardProxyBase; + +/** Samples for DppResourceGuardProxy Put. */ +public final class DppResourceGuardProxyPutSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json + */ + /** + * Sample code: Create ResourceGuardProxy. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void createResourceGuardProxy( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .dppResourceGuardProxies() + .define("swaggerExample") + .withExistingBackupVault("SampleResourceGroup", "sampleVault") + .withProperties( + new ResourceGuardProxyBase() + .withResourceGuardResourceId( + "/subscriptions/f9e67185-f313-4e79-aa71-6458d429369d/resourceGroups/ResourceGuardSecurityAdminRG/providers/Microsoft.DataProtection/resourceGuards/ResourceGuardTestResource")) + .create(); + } +} +``` + +### DppResourceGuardProxy_UnlockDelete + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.dataprotection.models.UnlockDeleteRequest; +import java.util.Arrays; + +/** Samples for DppResourceGuardProxy UnlockDelete. */ +public final class DppResourceGuardProxyUnlockDeleteSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json + */ + /** + * Sample code: UnlockDelete ResourceGuardProxy. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void unlockDeleteResourceGuardProxy( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .dppResourceGuardProxies() + .unlockDeleteWithResponse( + "SampleResourceGroup", + "sampleVault", + "swaggerExample", + new UnlockDeleteRequest() + .withResourceGuardOperationRequests( + Arrays + .asList( + "/subscriptions/f9e67185-f313-4e79-aa71-6458d429369d/resourceGroups/ResourceGuardSecurityAdminRG/providers/Microsoft.DataProtection/resourceGuards/ResourceGuardTestResource/deleteBackupInstanceRequests/default")) + .withResourceToBeDeleted( + "/subscriptions/5e13b949-1218-4d18-8b99-7e12155ec4f7/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/backupVaults/sampleVault/backupInstances/TestBI9779f4de"), + Context.NONE); + } +} +``` + ### ExportJobs_Trigger ```java @@ -1098,7 +1554,7 @@ import com.azure.core.util.Context; /** Samples for ExportJobs Trigger. */ public final class ExportJobsTriggerSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/JobCRUD/TriggerExportJobs.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/JobCRUD/TriggerExportJobs.json */ /** * Sample code: Trigger Export Jobs. @@ -1119,7 +1575,7 @@ import com.azure.core.util.Context; /** Samples for ExportJobsOperationResult Get. */ public final class ExportJobsOperationResultGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/JobCRUD/GetExportJobsOperationResult.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/JobCRUD/GetExportJobsOperationResult.json */ /** * Sample code: Get Export Jobs Operation Result. @@ -1144,7 +1600,7 @@ import com.azure.core.util.Context; /** Samples for Jobs Get. */ public final class JobsGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/JobCRUD/GetJob.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/JobCRUD/GetJob.json */ /** * Sample code: Get Job. @@ -1167,7 +1623,7 @@ import com.azure.core.util.Context; /** Samples for Jobs List. */ public final class JobsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/JobCRUD/ListJobs.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/JobCRUD/ListJobs.json */ /** * Sample code: Get Jobs. @@ -1188,7 +1644,7 @@ import com.azure.core.util.Context; /** Samples for OperationResult Get. */ public final class OperationResultGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/GetOperationResult.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/GetOperationResult.json */ /** * Sample code: Get OperationResult. @@ -1214,7 +1670,7 @@ import com.azure.core.util.Context; /** Samples for OperationStatus Get. */ public final class OperationStatusGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/GetOperationStatus.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/GetOperationStatus.json */ /** * Sample code: Get OperationStatus. @@ -1232,6 +1688,59 @@ public final class OperationStatusGetSamples { } ``` +### OperationStatusBackupVaultContext_Get + +```java +import com.azure.core.util.Context; + +/** Samples for OperationStatusBackupVaultContext Get. */ +public final class OperationStatusBackupVaultContextGetSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/GetOperationStatusVaultContext.json + */ + /** + * Sample code: Get OperationStatus. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void getOperationStatus(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .operationStatusBackupVaultContexts() + .getWithResponse( + "SampleResourceGroup", + "swaggerExample", + "MjkxOTMyODMtYTE3My00YzJjLTg5NjctN2E4MDIxNDA3NjA2OzdjNGE2ZWRjLWJjMmItNDRkYi1hYzMzLWY1YzEwNzk5Y2EyOA==", + Context.NONE); + } +} +``` + +### OperationStatusResourceGroupContext_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for OperationStatusResourceGroupContext GetByResourceGroup. */ +public final class OperationStatusResourceGroupContextGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/GetOperationStatusRGContext.json + */ + /** + * Sample code: Get OperationStatus. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void getOperationStatus(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .operationStatusResourceGroupContexts() + .getByResourceGroupWithResponse( + "SampleResourceGroup", + "MjkxOTMyODMtYTE3My00YzJjLTg5NjctN2E4MDIxNDA3NjA2OzdjNGE2ZWRjLWJjMmItNDRkYi1hYzMzLWY1YzEwNzk5Y2EyOA==", + Context.NONE); + } +} +``` + ### RecoveryPoints_Get ```java @@ -1240,7 +1749,7 @@ import com.azure.core.util.Context; /** Samples for RecoveryPoints Get. */ public final class RecoveryPointsGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/GetRecoveryPoint.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/GetRecoveryPoint.json */ /** * Sample code: Get Recovery Point. @@ -1251,8 +1760,8 @@ public final class RecoveryPointsGetSamples { manager .recoveryPoints() .getWithResponse( - "PratikPrivatePreviewVault1", "000pikumar", + "PratikPrivatePreviewVault1", "testInstance1", "7fb2cddd-c5b3-44f6-a0d9-db3c4f9d5f25", Context.NONE); @@ -1268,7 +1777,7 @@ import com.azure.core.util.Context; /** Samples for RecoveryPoints List. */ public final class RecoveryPointsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/ListRecoveryPoints.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/ListRecoveryPoints.json */ /** * Sample code: List Recovery Points in a Vault. @@ -1279,7 +1788,7 @@ public final class RecoveryPointsListSamples { com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { manager .recoveryPoints() - .list("PratikPrivatePreviewVault1", "000pikumar", "testInstance1", null, null, Context.NONE); + .list("000pikumar", "PratikPrivatePreviewVault1", "testInstance1", null, null, Context.NONE); } } ``` @@ -1292,7 +1801,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards Delete. */ public final class ResourceGuardsDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/DeleteResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/DeleteResourceGuard.json */ /** * Sample code: Delete ResourceGuard. @@ -1300,7 +1809,9 @@ public final class ResourceGuardsDeleteSamples { * @param manager Entry point to DataProtectionManager. */ public static void deleteResourceGuard(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { - manager.resourceGuards().deleteWithResponse("SampleResourceGroup", "swaggerExample", Context.NONE); + manager + .resourceGuards() + .deleteByResourceGroupWithResponse("SampleResourceGroup", "swaggerExample", Context.NONE); } } ``` @@ -1313,7 +1824,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards GetBackupSecurityPinRequestsObjects. */ public final class ResourceGuardsGetBackupSecurityPinRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/ListBackupSecurityPINRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/ListBackupSecurityPINRequests.json */ /** * Sample code: List OperationsRequestObject. @@ -1337,7 +1848,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards GetByResourceGroup. */ public final class ResourceGuardsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetResourceGuard.json */ /** * Sample code: Get ResourceGuard. @@ -1358,7 +1869,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards GetDefaultBackupSecurityPinRequestsObject. */ public final class ResourceGuardsGetDefaultBackupSecurityPinRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetDefaultBackupSecurityPINRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetDefaultBackupSecurityPINRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. @@ -1383,7 +1894,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards GetDefaultDeleteProtectedItemRequestsObject. */ public final class ResourceGuardsGetDefaultDeleteProtectedItemRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetDefaultDeleteProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetDefaultDeleteProtectedItemRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. @@ -1408,7 +1919,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards GetDefaultDeleteResourceGuardProxyRequestsObject. */ public final class ResourceGuardsGetDefaultDeleteResourceGuardProxyRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetDefaultDeleteResourceGuardProxyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetDefaultDeleteResourceGuardProxyRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. @@ -1433,7 +1944,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards GetDefaultDisableSoftDeleteRequestsObject. */ public final class ResourceGuardsGetDefaultDisableSoftDeleteRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetDefaultDisableSoftDeleteRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetDefaultDisableSoftDeleteRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. @@ -1458,7 +1969,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards GetDefaultUpdateProtectedItemRequestsObject. */ public final class ResourceGuardsGetDefaultUpdateProtectedItemRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetDefaultUpdateProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetDefaultUpdateProtectedItemRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. @@ -1483,7 +1994,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards GetDefaultUpdateProtectionPolicyRequestsObject. */ public final class ResourceGuardsGetDefaultUpdateProtectionPolicyRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetDefaultUpdateProtectionPolicyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetDefaultUpdateProtectionPolicyRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. @@ -1508,7 +2019,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards GetDeleteProtectedItemRequestsObjects. */ public final class ResourceGuardsGetDeleteProtectedItemRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/ListDeleteProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/ListDeleteProtectedItemRequests.json */ /** * Sample code: List OperationsRequestObject. @@ -1532,7 +2043,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards GetDeleteResourceGuardProxyRequestsObjects. */ public final class ResourceGuardsGetDeleteResourceGuardProxyRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/ListDeleteResourceGuardProxyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/ListDeleteResourceGuardProxyRequests.json */ /** * Sample code: List OperationsRequestObject. @@ -1556,7 +2067,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards GetDisableSoftDeleteRequestsObjects. */ public final class ResourceGuardsGetDisableSoftDeleteRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/ListDisableSoftDeleteRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/ListDisableSoftDeleteRequests.json */ /** * Sample code: List OperationsRequestObject. @@ -1580,7 +2091,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards GetUpdateProtectedItemRequestsObjects. */ public final class ResourceGuardsGetUpdateProtectedItemRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/ListUpdateProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/ListUpdateProtectedItemRequests.json */ /** * Sample code: List OperationsRequestObject. @@ -1604,7 +2115,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards GetUpdateProtectionPolicyRequestsObjects. */ public final class ResourceGuardsGetUpdateProtectionPolicyRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/ListUpdateProtectionPolicyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/ListUpdateProtectionPolicyRequests.json */ /** * Sample code: List OperationsRequestObject. @@ -1628,7 +2139,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards List. */ public final class ResourceGuardsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetResourceGuardsInSubscription.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetResourceGuardsInSubscription.json */ /** * Sample code: Get ResourceGuards in Subscription. @@ -1650,7 +2161,7 @@ import com.azure.core.util.Context; /** Samples for ResourceGuards ListByResourceGroup. */ public final class ResourceGuardsListByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetResourceGuardsInResourceGroup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetResourceGuardsInResourceGroup.json */ /** * Sample code: Get ResourceGuards in ResourceGroup. @@ -1675,7 +2186,7 @@ import java.util.Map; /** Samples for ResourceGuards Patch. */ public final class ResourceGuardsPatchSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/PatchResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/PatchResourceGuard.json */ /** * Sample code: Patch ResourceGuard. @@ -1713,7 +2224,7 @@ import java.util.Map; /** Samples for ResourceGuards Put. */ public final class ResourceGuardsPutSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/PutResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/PutResourceGuard.json */ /** * Sample code: Create ResourceGuard. @@ -1753,7 +2264,7 @@ import com.azure.resourcemanager.dataprotection.models.RestoreSourceDataStoreTyp /** Samples for RestorableTimeRanges Find. */ public final class RestorableTimeRangesFindSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/FindRestorableTimeRanges.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/FindRestorableTimeRanges.json */ /** * Sample code: Find Restorable Time Ranges. @@ -1765,8 +2276,8 @@ public final class RestorableTimeRangesFindSamples { manager .restorableTimeRanges() .findWithResponse( - "ZBlobBackupVaultBVTD3", "Blob-Backup", + "ZBlobBackupVaultBVTD3", "zblobbackuptestsa58", new AzureBackupFindRestorableTimeRangesRequest() .withSourceDataStoreType(RestoreSourceDataStoreType.OPERATIONAL_STORE) diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml b/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml index 947fb79fb7d0..8e25a21d4233 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for DataProtection Management - This package contains Microsoft Azure SDK for DataProtection 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 Data Protection service. Package tag package-2021-07. + This package contains Microsoft Azure SDK for DataProtection 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 Data Protection service. Package tag package-preview-2022-11. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/DataProtectionManager.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/DataProtectionManager.java index c25cb41e94d2..638e63a51ff5 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/DataProtectionManager.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/DataProtectionManager.java @@ -10,11 +10,13 @@ import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; @@ -22,6 +24,7 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.fluent.DataProtectionClient; +import com.azure.resourcemanager.dataprotection.implementation.BackupInstancesExtensionRoutingsImpl; import com.azure.resourcemanager.dataprotection.implementation.BackupInstancesImpl; import com.azure.resourcemanager.dataprotection.implementation.BackupPoliciesImpl; import com.azure.resourcemanager.dataprotection.implementation.BackupVaultOperationResultsImpl; @@ -29,25 +32,34 @@ import com.azure.resourcemanager.dataprotection.implementation.DataProtectionClientBuilder; import com.azure.resourcemanager.dataprotection.implementation.DataProtectionOperationsImpl; import com.azure.resourcemanager.dataprotection.implementation.DataProtectionsImpl; +import com.azure.resourcemanager.dataprotection.implementation.DeletedBackupInstancesImpl; +import com.azure.resourcemanager.dataprotection.implementation.DppResourceGuardProxiesImpl; import com.azure.resourcemanager.dataprotection.implementation.ExportJobsImpl; import com.azure.resourcemanager.dataprotection.implementation.ExportJobsOperationResultsImpl; import com.azure.resourcemanager.dataprotection.implementation.JobsImpl; import com.azure.resourcemanager.dataprotection.implementation.OperationResultsImpl; +import com.azure.resourcemanager.dataprotection.implementation.OperationStatusBackupVaultContextsImpl; import com.azure.resourcemanager.dataprotection.implementation.OperationStatusImpl; +import com.azure.resourcemanager.dataprotection.implementation.OperationStatusResourceGroupContextsImpl; import com.azure.resourcemanager.dataprotection.implementation.RecoveryPointsImpl; import com.azure.resourcemanager.dataprotection.implementation.ResourceGuardsImpl; import com.azure.resourcemanager.dataprotection.implementation.RestorableTimeRangesImpl; import com.azure.resourcemanager.dataprotection.models.BackupInstances; +import com.azure.resourcemanager.dataprotection.models.BackupInstancesExtensionRoutings; import com.azure.resourcemanager.dataprotection.models.BackupPolicies; import com.azure.resourcemanager.dataprotection.models.BackupVaultOperationResults; import com.azure.resourcemanager.dataprotection.models.BackupVaults; import com.azure.resourcemanager.dataprotection.models.DataProtectionOperations; import com.azure.resourcemanager.dataprotection.models.DataProtections; +import com.azure.resourcemanager.dataprotection.models.DeletedBackupInstances; +import com.azure.resourcemanager.dataprotection.models.DppResourceGuardProxies; import com.azure.resourcemanager.dataprotection.models.ExportJobs; import com.azure.resourcemanager.dataprotection.models.ExportJobsOperationResults; import com.azure.resourcemanager.dataprotection.models.Jobs; import com.azure.resourcemanager.dataprotection.models.OperationResults; import com.azure.resourcemanager.dataprotection.models.OperationStatus; +import com.azure.resourcemanager.dataprotection.models.OperationStatusBackupVaultContexts; +import com.azure.resourcemanager.dataprotection.models.OperationStatusResourceGroupContexts; import com.azure.resourcemanager.dataprotection.models.RecoveryPoints; import com.azure.resourcemanager.dataprotection.models.ResourceGuards; import com.azure.resourcemanager.dataprotection.models.RestorableTimeRanges; @@ -66,6 +78,10 @@ public final class DataProtectionManager { private OperationStatus operationStatus; + private OperationStatusBackupVaultContexts operationStatusBackupVaultContexts; + + private OperationStatusResourceGroupContexts operationStatusResourceGroupContexts; + private BackupVaultOperationResults backupVaultOperationResults; private DataProtections dataProtections; @@ -76,6 +92,8 @@ public final class DataProtectionManager { private BackupInstances backupInstances; + private BackupInstancesExtensionRoutings backupInstancesExtensionRoutings; + private RecoveryPoints recoveryPoints; private Jobs jobs; @@ -86,8 +104,12 @@ public final class DataProtectionManager { private ExportJobsOperationResults exportJobsOperationResults; + private DeletedBackupInstances deletedBackupInstances; + private ResourceGuards resourceGuards; + private DppResourceGuardProxies dppResourceGuardProxies; + private final DataProtectionClient clientObject; private DataProtectionManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -115,6 +137,19 @@ public static DataProtectionManager authenticate(TokenCredential credential, Azu return configure().authenticate(credential, profile); } + /** + * Creates an instance of DataProtection service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the DataProtection service API instance. + */ + public static DataProtectionManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new DataProtectionManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create DataProtectionManager with optional configuration. * @@ -126,13 +161,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -193,6 +229,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -200,9 +249,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -242,10 +293,15 @@ public DataProtectionManager authenticate(TokenCredential credential, AzureProfi scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); policies .addAll( @@ -276,7 +332,11 @@ public DataProtectionManager authenticate(TokenCredential credential, AzureProfi } } - /** @return Resource collection API of BackupVaults. */ + /** + * Gets the resource collection API of BackupVaults. It manages BackupVaultResource. + * + * @return Resource collection API of BackupVaults. + */ public BackupVaults backupVaults() { if (this.backupVaults == null) { this.backupVaults = new BackupVaultsImpl(clientObject.getBackupVaults(), this); @@ -284,7 +344,11 @@ public BackupVaults backupVaults() { return backupVaults; } - /** @return Resource collection API of OperationResults. */ + /** + * Gets the resource collection API of OperationResults. + * + * @return Resource collection API of OperationResults. + */ public OperationResults operationResults() { if (this.operationResults == null) { this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this); @@ -292,7 +356,11 @@ public OperationResults operationResults() { return operationResults; } - /** @return Resource collection API of OperationStatus. */ + /** + * Gets the resource collection API of OperationStatus. + * + * @return Resource collection API of OperationStatus. + */ public OperationStatus operationStatus() { if (this.operationStatus == null) { this.operationStatus = new OperationStatusImpl(clientObject.getOperationStatus(), this); @@ -300,7 +368,38 @@ public OperationStatus operationStatus() { return operationStatus; } - /** @return Resource collection API of BackupVaultOperationResults. */ + /** + * Gets the resource collection API of OperationStatusBackupVaultContexts. + * + * @return Resource collection API of OperationStatusBackupVaultContexts. + */ + public OperationStatusBackupVaultContexts operationStatusBackupVaultContexts() { + if (this.operationStatusBackupVaultContexts == null) { + this.operationStatusBackupVaultContexts = + new OperationStatusBackupVaultContextsImpl(clientObject.getOperationStatusBackupVaultContexts(), this); + } + return operationStatusBackupVaultContexts; + } + + /** + * Gets the resource collection API of OperationStatusResourceGroupContexts. + * + * @return Resource collection API of OperationStatusResourceGroupContexts. + */ + public OperationStatusResourceGroupContexts operationStatusResourceGroupContexts() { + if (this.operationStatusResourceGroupContexts == null) { + this.operationStatusResourceGroupContexts = + new OperationStatusResourceGroupContextsImpl( + clientObject.getOperationStatusResourceGroupContexts(), this); + } + return operationStatusResourceGroupContexts; + } + + /** + * Gets the resource collection API of BackupVaultOperationResults. + * + * @return Resource collection API of BackupVaultOperationResults. + */ public BackupVaultOperationResults backupVaultOperationResults() { if (this.backupVaultOperationResults == null) { this.backupVaultOperationResults = @@ -309,7 +408,11 @@ public BackupVaultOperationResults backupVaultOperationResults() { return backupVaultOperationResults; } - /** @return Resource collection API of DataProtections. */ + /** + * Gets the resource collection API of DataProtections. + * + * @return Resource collection API of DataProtections. + */ public DataProtections dataProtections() { if (this.dataProtections == null) { this.dataProtections = new DataProtectionsImpl(clientObject.getDataProtections(), this); @@ -317,7 +420,11 @@ public DataProtections dataProtections() { return dataProtections; } - /** @return Resource collection API of DataProtectionOperations. */ + /** + * Gets the resource collection API of DataProtectionOperations. + * + * @return Resource collection API of DataProtectionOperations. + */ public DataProtectionOperations dataProtectionOperations() { if (this.dataProtectionOperations == null) { this.dataProtectionOperations = @@ -326,7 +433,11 @@ public DataProtectionOperations dataProtectionOperations() { return dataProtectionOperations; } - /** @return Resource collection API of BackupPolicies. */ + /** + * Gets the resource collection API of BackupPolicies. It manages BaseBackupPolicyResource. + * + * @return Resource collection API of BackupPolicies. + */ public BackupPolicies backupPolicies() { if (this.backupPolicies == null) { this.backupPolicies = new BackupPoliciesImpl(clientObject.getBackupPolicies(), this); @@ -334,7 +445,11 @@ public BackupPolicies backupPolicies() { return backupPolicies; } - /** @return Resource collection API of BackupInstances. */ + /** + * Gets the resource collection API of BackupInstances. It manages BackupInstanceResource. + * + * @return Resource collection API of BackupInstances. + */ public BackupInstances backupInstances() { if (this.backupInstances == null) { this.backupInstances = new BackupInstancesImpl(clientObject.getBackupInstances(), this); @@ -342,7 +457,24 @@ public BackupInstances backupInstances() { return backupInstances; } - /** @return Resource collection API of RecoveryPoints. */ + /** + * Gets the resource collection API of BackupInstancesExtensionRoutings. + * + * @return Resource collection API of BackupInstancesExtensionRoutings. + */ + public BackupInstancesExtensionRoutings backupInstancesExtensionRoutings() { + if (this.backupInstancesExtensionRoutings == null) { + this.backupInstancesExtensionRoutings = + new BackupInstancesExtensionRoutingsImpl(clientObject.getBackupInstancesExtensionRoutings(), this); + } + return backupInstancesExtensionRoutings; + } + + /** + * Gets the resource collection API of RecoveryPoints. + * + * @return Resource collection API of RecoveryPoints. + */ public RecoveryPoints recoveryPoints() { if (this.recoveryPoints == null) { this.recoveryPoints = new RecoveryPointsImpl(clientObject.getRecoveryPoints(), this); @@ -350,7 +482,11 @@ public RecoveryPoints recoveryPoints() { return recoveryPoints; } - /** @return Resource collection API of Jobs. */ + /** + * Gets the resource collection API of Jobs. + * + * @return Resource collection API of Jobs. + */ public Jobs jobs() { if (this.jobs == null) { this.jobs = new JobsImpl(clientObject.getJobs(), this); @@ -358,7 +494,11 @@ public Jobs jobs() { return jobs; } - /** @return Resource collection API of RestorableTimeRanges. */ + /** + * Gets the resource collection API of RestorableTimeRanges. + * + * @return Resource collection API of RestorableTimeRanges. + */ public RestorableTimeRanges restorableTimeRanges() { if (this.restorableTimeRanges == null) { this.restorableTimeRanges = new RestorableTimeRangesImpl(clientObject.getRestorableTimeRanges(), this); @@ -366,7 +506,11 @@ public RestorableTimeRanges restorableTimeRanges() { return restorableTimeRanges; } - /** @return Resource collection API of ExportJobs. */ + /** + * Gets the resource collection API of ExportJobs. + * + * @return Resource collection API of ExportJobs. + */ public ExportJobs exportJobs() { if (this.exportJobs == null) { this.exportJobs = new ExportJobsImpl(clientObject.getExportJobs(), this); @@ -374,7 +518,11 @@ public ExportJobs exportJobs() { return exportJobs; } - /** @return Resource collection API of ExportJobsOperationResults. */ + /** + * Gets the resource collection API of ExportJobsOperationResults. + * + * @return Resource collection API of ExportJobsOperationResults. + */ public ExportJobsOperationResults exportJobsOperationResults() { if (this.exportJobsOperationResults == null) { this.exportJobsOperationResults = @@ -383,7 +531,24 @@ public ExportJobsOperationResults exportJobsOperationResults() { return exportJobsOperationResults; } - /** @return Resource collection API of ResourceGuards. */ + /** + * Gets the resource collection API of DeletedBackupInstances. + * + * @return Resource collection API of DeletedBackupInstances. + */ + public DeletedBackupInstances deletedBackupInstances() { + if (this.deletedBackupInstances == null) { + this.deletedBackupInstances = + new DeletedBackupInstancesImpl(clientObject.getDeletedBackupInstances(), this); + } + return deletedBackupInstances; + } + + /** + * Gets the resource collection API of ResourceGuards. It manages ResourceGuardResource. + * + * @return Resource collection API of ResourceGuards. + */ public ResourceGuards resourceGuards() { if (this.resourceGuards == null) { this.resourceGuards = new ResourceGuardsImpl(clientObject.getResourceGuards(), this); @@ -391,6 +556,19 @@ public ResourceGuards resourceGuards() { return resourceGuards; } + /** + * Gets the resource collection API of DppResourceGuardProxies. It manages ResourceGuardProxyBaseResource. + * + * @return Resource collection API of DppResourceGuardProxies. + */ + public DppResourceGuardProxies dppResourceGuardProxies() { + if (this.dppResourceGuardProxies == null) { + this.dppResourceGuardProxies = + new DppResourceGuardProxiesImpl(clientObject.getDppResourceGuardProxies(), this); + } + return dppResourceGuardProxies; + } + /** * @return Wrapped service client DataProtectionClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupInstancesClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupInstancesClient.java index 91803652e9f6..4321f88365c5 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupInstancesClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupInstancesClient.java @@ -15,6 +15,7 @@ import com.azure.resourcemanager.dataprotection.fluent.models.OperationJobExtendedInfoInner; import com.azure.resourcemanager.dataprotection.models.AzureBackupRehydrationRequest; import com.azure.resourcemanager.dataprotection.models.AzureBackupRestoreRequest; +import com.azure.resourcemanager.dataprotection.models.SyncBackupInstanceRequest; import com.azure.resourcemanager.dataprotection.models.TriggerBackupRequest; import com.azure.resourcemanager.dataprotection.models.ValidateForBackupRequest; import com.azure.resourcemanager.dataprotection.models.ValidateRestoreRequestObject; @@ -24,93 +25,93 @@ public interface BackupInstancesClient { /** * Gets a backup instances belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup instances belonging to a backup vault. + * @return a backup instances belonging to a backup vault as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName); + PagedIterable list(String resourceGroupName, String vaultName); /** * Gets a backup instances belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup instances belonging to a backup vault. + * @return a backup instances belonging to a backup vault as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, Context context); + PagedIterable list(String resourceGroupName, String vaultName, Context context); /** * Gets a backup instance with name in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. + * @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 a backup instance with name in a backup vault. + * @return a backup instance with name in a backup vault along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - BackupInstanceResourceInner get(String vaultName, String resourceGroupName, String backupInstanceName); + Response getWithResponse( + String resourceGroupName, String vaultName, String backupInstanceName, Context context); /** * Gets a backup instance with name in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. - * @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 a backup instance with name in a backup vault. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String vaultName, String resourceGroupName, String backupInstanceName, Context context); + BackupInstanceResourceInner get(String resourceGroupName, String vaultName, String backupInstanceName); /** * Create or update a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 backupInstanceResource. + * @return the {@link SyncPoller} for polling of backupInstanceResource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, BackupInstanceResourceInner> beginCreateOrUpdate( - String vaultName, String resourceGroupName, String backupInstanceName, BackupInstanceResourceInner parameters); + String resourceGroupName, String vaultName, String backupInstanceName, BackupInstanceResourceInner parameters); /** * Create or update a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 backupInstanceResource. + * @return the {@link SyncPoller} for polling of backupInstanceResource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, BackupInstanceResourceInner> beginCreateOrUpdate( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, BackupInstanceResourceInner parameters, Context context); @@ -118,8 +119,8 @@ SyncPoller, BackupInstanceResourceInner> /** * Create or update a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -129,13 +130,13 @@ SyncPoller, BackupInstanceResourceInner> */ @ServiceMethod(returns = ReturnType.SINGLE) BackupInstanceResourceInner createOrUpdate( - String vaultName, String resourceGroupName, String backupInstanceName, BackupInstanceResourceInner parameters); + String resourceGroupName, String vaultName, String backupInstanceName, BackupInstanceResourceInner parameters); /** * Create or update a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @param context The context to associate with this operation. @@ -146,8 +147,8 @@ BackupInstanceResourceInner createOrUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) BackupInstanceResourceInner createOrUpdate( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, BackupInstanceResourceInner parameters, Context context); @@ -155,52 +156,52 @@ BackupInstanceResourceInner createOrUpdate( /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( - String vaultName, String resourceGroupName, String backupInstanceName); + String resourceGroupName, String vaultName, String backupInstanceName); /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( - String vaultName, String resourceGroupName, String backupInstanceName, Context context); + String resourceGroupName, String vaultName, String backupInstanceName, Context context); /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 backupInstanceName); + void delete(String resourceGroupName, String vaultName, String backupInstanceName); /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -208,41 +209,41 @@ SyncPoller, Void> beginDelete( * @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 backupInstanceName, Context context); + void delete(String resourceGroupName, String vaultName, String backupInstanceName, Context context); /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OperationJobExtendedInfoInner> beginAdhocBackup( - String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters); + String resourceGroupName, String vaultName, String backupInstanceName, TriggerBackupRequest parameters); /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OperationJobExtendedInfoInner> beginAdhocBackup( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, TriggerBackupRequest parameters, Context context); @@ -250,8 +251,8 @@ SyncPoller, OperationJobExtendedInfoIn /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -261,13 +262,13 @@ SyncPoller, OperationJobExtendedInfoIn */ @ServiceMethod(returns = ReturnType.SINGLE) OperationJobExtendedInfoInner adhocBackup( - String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters); + String resourceGroupName, String vaultName, String backupInstanceName, TriggerBackupRequest parameters); /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @param context The context to associate with this operation. @@ -278,8 +279,8 @@ OperationJobExtendedInfoInner adhocBackup( */ @ServiceMethod(returns = ReturnType.SINGLE) OperationJobExtendedInfoInner adhocBackup( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, TriggerBackupRequest parameters, Context context); @@ -287,39 +288,39 @@ OperationJobExtendedInfoInner adhocBackup( /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OperationJobExtendedInfoInner> beginValidateForBackup( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters); + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters); /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OperationJobExtendedInfoInner> beginValidateForBackup( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context); + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters, Context context); /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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. @@ -328,13 +329,13 @@ SyncPoller, OperationJobExtendedInfoIn */ @ServiceMethod(returns = ReturnType.SINGLE) OperationJobExtendedInfoInner validateForBackup( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters); + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters); /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param parameters Request body for operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -344,7 +345,40 @@ OperationJobExtendedInfoInner validateForBackup( */ @ServiceMethod(returns = ReturnType.SINGLE) OperationJobExtendedInfoInner validateForBackup( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context); + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters, Context context); + + /** + * Get result of backup instance creation operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @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 result of backup instance creation operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBackupInstanceOperationResultWithResponse( + String resourceGroupName, String vaultName, String backupInstanceName, String operationId, Context context); + + /** + * Get result of backup instance creation operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @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 result of backup instance creation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupInstanceResourceInner getBackupInstanceOperationResult( + String resourceGroupName, String vaultName, String backupInstanceName, String operationId); /** * rehydrate recovery point for restore for a BackupInstance. @@ -356,7 +390,7 @@ OperationJobExtendedInfoInner validateForBackup( * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginTriggerRehydrate( @@ -376,7 +410,7 @@ SyncPoller, Void> beginTriggerRehydrate( * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginTriggerRehydrate( @@ -427,36 +461,36 @@ void triggerRehydrate( /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OperationJobExtendedInfoInner> beginTriggerRestore( - String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters); + String resourceGroupName, String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters); /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OperationJobExtendedInfoInner> beginTriggerRestore( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters, Context context); @@ -464,8 +498,8 @@ SyncPoller, OperationJobExtendedInfoIn /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -475,13 +509,13 @@ SyncPoller, OperationJobExtendedInfoIn */ @ServiceMethod(returns = ReturnType.SINGLE) OperationJobExtendedInfoInner triggerRestore( - String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters); + String resourceGroupName, String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters); /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @param context The context to associate with this operation. @@ -492,45 +526,357 @@ OperationJobExtendedInfoInner triggerRestore( */ @ServiceMethod(returns = ReturnType.SINGLE) OperationJobExtendedInfoInner triggerRestore( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters, Context context); /** - * Validates if Restore can be triggered for a DataSource. + * This operation will resume backups for backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResumeBackups( + String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * This operation will resume backups for backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResumeBackups( + String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * This operation will resume backups for backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 resumeBackups(String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * This operation will resume backups for backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resumeBackups(String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResumeProtection( + String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResumeProtection( + String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 resumeProtection(String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resumeProtection(String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStopProtection( + String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStopProtection( + String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 stopProtection(String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stopProtection(String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginSuspendBackups( + String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginSuspendBackups( + String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 suspendBackups(String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void suspendBackups(String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginSyncBackupInstance( + String resourceGroupName, String vaultName, String backupInstanceName, SyncBackupInstanceRequest parameters); + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginSyncBackupInstance( + String resourceGroupName, + String vaultName, + String backupInstanceName, + SyncBackupInstanceRequest parameters, + Context context); + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void syncBackupInstance( + String resourceGroupName, String vaultName, String backupInstanceName, SyncBackupInstanceRequest parameters); + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. * + * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void syncBackupInstance( + String resourceGroupName, + String vaultName, + String backupInstanceName, + SyncBackupInstanceRequest parameters, + Context context); + + /** + * Validates if Restore can be triggered for a DataSource. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OperationJobExtendedInfoInner> beginValidateForRestore( - String vaultName, String resourceGroupName, String backupInstanceName, ValidateRestoreRequestObject parameters); + String resourceGroupName, String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters); /** * Validates if Restore can be triggered for a DataSource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OperationJobExtendedInfoInner> beginValidateForRestore( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters, Context context); @@ -538,8 +884,8 @@ SyncPoller, OperationJobExtendedInfoIn /** * Validates if Restore can be triggered for a DataSource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -549,13 +895,13 @@ SyncPoller, OperationJobExtendedInfoIn */ @ServiceMethod(returns = ReturnType.SINGLE) OperationJobExtendedInfoInner validateForRestore( - String vaultName, String resourceGroupName, String backupInstanceName, ValidateRestoreRequestObject parameters); + String resourceGroupName, String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters); /** * Validates if Restore can be triggered for a DataSource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @param context The context to associate with this operation. @@ -566,8 +912,8 @@ OperationJobExtendedInfoInner validateForRestore( */ @ServiceMethod(returns = ReturnType.SINGLE) OperationJobExtendedInfoInner validateForRestore( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters, Context context); diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupInstancesExtensionRoutingsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupInstancesExtensionRoutingsClient.java new file mode 100644 index 000000000000..af8701a3964a --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupInstancesExtensionRoutingsClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.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.dataprotection.fluent.models.BackupInstanceResourceInner; + +/** + * An instance of this class provides access to all the operations defined in BackupInstancesExtensionRoutingsClient. + */ +public interface BackupInstancesExtensionRoutingsClient { + /** + * Gets a list backup instances associated with a tracked resource. + * + * @param resourceId ARM path of the resource to be protected using Microsoft.DataProtection. + * @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 a list backup instances associated with a tracked resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceId); + + /** + * Gets a list backup instances associated with a tracked resource. + * + * @param resourceId ARM path of the resource to be protected using Microsoft.DataProtection. + * @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 a list backup instances associated with a tracked resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceId, Context context); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupPoliciesClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupPoliciesClient.java index 7fa97536f748..b9da62a3fd43 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupPoliciesClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupPoliciesClient.java @@ -16,123 +16,123 @@ public interface BackupPoliciesClient { /** * Returns list of backup policies belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return baseBackupPolicyResourceList. + * @return baseBackupPolicyResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName); + PagedIterable list(String resourceGroupName, String vaultName); /** * Returns list of backup policies belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return baseBackupPolicyResourceList. + * @return baseBackupPolicyResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, Context context); + PagedIterable list(String resourceGroupName, String vaultName, Context context); /** * Gets a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName 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 a backup policy belonging to a backup vault. + * @return a backup policy belonging to a backup vault along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - BaseBackupPolicyResourceInner get(String vaultName, String resourceGroupName, String backupPolicyName); + Response getWithResponse( + String resourceGroupName, String vaultName, String backupPolicyName, Context context); /** * Gets a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName 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 a backup policy belonging to a backup vault. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String vaultName, String resourceGroupName, String backupPolicyName, Context context); + BaseBackupPolicyResourceInner get(String resourceGroupName, String vaultName, String backupPolicyName); /** * Creates or Updates a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName Name of the policy. * @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 baseBackupPolicyResource. + * @return baseBackupPolicyResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - BaseBackupPolicyResourceInner createOrUpdate( - String vaultName, String resourceGroupName, String backupPolicyName, BaseBackupPolicyResourceInner parameters); + Response createOrUpdateWithResponse( + String resourceGroupName, + String vaultName, + String backupPolicyName, + BaseBackupPolicyResourceInner parameters, + Context context); /** * Creates or Updates a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName Name of the policy. * @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 baseBackupPolicyResource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String vaultName, - String resourceGroupName, - String backupPolicyName, - BaseBackupPolicyResourceInner parameters, - Context context); + BaseBackupPolicyResourceInner createOrUpdate( + String resourceGroupName, String vaultName, String backupPolicyName, BaseBackupPolicyResourceInner parameters); /** * Deletes a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String vaultName, String resourceGroupName, String backupPolicyName); + Response deleteWithResponse( + String resourceGroupName, String vaultName, String backupPolicyName, Context context); /** * Deletes a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName 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 backupPolicyName, Context context); + void delete(String resourceGroupName, String vaultName, String backupPolicyName); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupVaultOperationResultsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupVaultOperationResultsClient.java index 91336b28091d..5cfb7bead114 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupVaultOperationResultsClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupVaultOperationResultsClient.java @@ -13,28 +13,32 @@ /** An instance of this class provides access to all the operations defined in BackupVaultOperationResultsClient. */ public interface BackupVaultOperationResultsClient { /** - * @param vaultName The name of the backup vault. + * The get operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - BackupVaultResourceInner get(String vaultName, String resourceGroupName, String operationId); + BackupVaultOperationResultsGetResponse getWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context); /** - * @param vaultName The name of the backup vault. + * The get operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - BackupVaultOperationResultsGetResponse getWithResponse( - String vaultName, String resourceGroupName, String operationId, Context context); + BackupVaultResourceInner get(String resourceGroupName, String vaultName, String operationId); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupVaultsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupVaultsClient.java index ecee753d3ec5..114a44b6de8b 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupVaultsClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupVaultsClient.java @@ -23,7 +23,7 @@ public interface BackupVaultsClient { * * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -35,7 +35,7 @@ public interface BackupVaultsClient { * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -47,7 +47,7 @@ public interface BackupVaultsClient { * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -60,7 +60,7 @@ public interface BackupVaultsClient { * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -70,65 +70,65 @@ public interface BackupVaultsClient { * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backupVault Resource. + * @return backupVault Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - BackupVaultResourceInner getByResourceGroup(String resourceGroupName, String vaultName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String vaultName, Context context); /** * Returns a resource belonging to a resource group. * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return backupVault Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String vaultName, Context context); + BackupVaultResourceInner getByResourceGroup(String resourceGroupName, String vaultName); /** * Creates or updates a BackupVault resource belonging to a resource group. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return the {@link SyncPoller} for polling of backupVault Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, BackupVaultResourceInner> beginCreateOrUpdate( - String vaultName, String resourceGroupName, BackupVaultResourceInner parameters); + String resourceGroupName, String vaultName, BackupVaultResourceInner parameters); /** * Creates or updates a BackupVault resource belonging to a resource group. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return the {@link SyncPoller} for polling of backupVault Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, BackupVaultResourceInner> beginCreateOrUpdate( - String vaultName, String resourceGroupName, BackupVaultResourceInner parameters, Context context); + String resourceGroupName, String vaultName, BackupVaultResourceInner parameters, Context context); /** * Creates or updates a BackupVault resource belonging to a resource group. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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. @@ -137,13 +137,13 @@ SyncPoller, BackupVaultResourceInner> begin */ @ServiceMethod(returns = ReturnType.SINGLE) BackupVaultResourceInner createOrUpdate( - String vaultName, String resourceGroupName, BackupVaultResourceInner parameters); + String resourceGroupName, String vaultName, BackupVaultResourceInner parameters); /** * Creates or updates a BackupVault resource belonging to a resource group. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param parameters Request body for operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -153,70 +153,70 @@ BackupVaultResourceInner createOrUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) BackupVaultResourceInner createOrUpdate( - String vaultName, String resourceGroupName, BackupVaultResourceInner parameters, Context context); + String resourceGroupName, String vaultName, BackupVaultResourceInner parameters, Context context); /** * Deletes a BackupVault resource from the resource group. * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vaultName); + Response deleteWithResponse(String resourceGroupName, String vaultName, Context context); /** * Deletes a BackupVault resource from the resource group. * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String vaultName, Context context); + void delete(String resourceGroupName, String vaultName); /** * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return the {@link SyncPoller} for polling of backupVault Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, BackupVaultResourceInner> beginUpdate( - String vaultName, String resourceGroupName, PatchResourceRequestInput parameters); + String resourceGroupName, String vaultName, PatchResourceRequestInput parameters); /** * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return the {@link SyncPoller} for polling of backupVault Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, BackupVaultResourceInner> beginUpdate( - String vaultName, String resourceGroupName, PatchResourceRequestInput parameters, Context context); + String resourceGroupName, String vaultName, PatchResourceRequestInput parameters, Context context); /** * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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. @@ -224,13 +224,13 @@ SyncPoller, BackupVaultResourceInner> begin * @return backupVault Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - BackupVaultResourceInner update(String vaultName, String resourceGroupName, PatchResourceRequestInput parameters); + BackupVaultResourceInner update(String resourceGroupName, String vaultName, PatchResourceRequestInput parameters); /** * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param parameters Request body for operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -240,7 +240,7 @@ SyncPoller, BackupVaultResourceInner> begin */ @ServiceMethod(returns = ReturnType.SINGLE) BackupVaultResourceInner update( - String vaultName, String resourceGroupName, PatchResourceRequestInput parameters, Context context); + String resourceGroupName, String vaultName, PatchResourceRequestInput parameters, Context context); /** * API to check for resource name availability. @@ -248,14 +248,15 @@ BackupVaultResourceInner update( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param location The location in which uniqueness will be verified. * @param parameters Check name availability 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 checkNameAvailabilityResult. + * @return checkNameAvailabilityResult along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityResultInner checkNameAvailability( - String resourceGroupName, String location, CheckNameAvailabilityRequest parameters); + Response checkNameAvailabilityWithResponse( + String resourceGroupName, String location, CheckNameAvailabilityRequest parameters, Context context); /** * API to check for resource name availability. @@ -263,13 +264,12 @@ CheckNameAvailabilityResultInner checkNameAvailability( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param location The location in which uniqueness will be verified. * @param parameters Check name availability 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 checkNameAvailabilityResult. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse( - String resourceGroupName, String location, CheckNameAvailabilityRequest parameters, Context context); + CheckNameAvailabilityResultInner checkNameAvailability( + String resourceGroupName, String location, CheckNameAvailabilityRequest parameters); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionClient.java index c6d7d43aad92..5b76dacfed81 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionClient.java @@ -65,6 +65,20 @@ public interface DataProtectionClient { */ OperationStatusClient getOperationStatus(); + /** + * Gets the OperationStatusBackupVaultContextsClient object to access its operations. + * + * @return the OperationStatusBackupVaultContextsClient object. + */ + OperationStatusBackupVaultContextsClient getOperationStatusBackupVaultContexts(); + + /** + * Gets the OperationStatusResourceGroupContextsClient object to access its operations. + * + * @return the OperationStatusResourceGroupContextsClient object. + */ + OperationStatusResourceGroupContextsClient getOperationStatusResourceGroupContexts(); + /** * Gets the BackupVaultOperationResultsClient object to access its operations. * @@ -100,6 +114,13 @@ public interface DataProtectionClient { */ BackupInstancesClient getBackupInstances(); + /** + * Gets the BackupInstancesExtensionRoutingsClient object to access its operations. + * + * @return the BackupInstancesExtensionRoutingsClient object. + */ + BackupInstancesExtensionRoutingsClient getBackupInstancesExtensionRoutings(); + /** * Gets the RecoveryPointsClient object to access its operations. * @@ -135,10 +156,24 @@ public interface DataProtectionClient { */ ExportJobsOperationResultsClient getExportJobsOperationResults(); + /** + * Gets the DeletedBackupInstancesClient object to access its operations. + * + * @return the DeletedBackupInstancesClient object. + */ + DeletedBackupInstancesClient getDeletedBackupInstances(); + /** * Gets the ResourceGuardsClient object to access its operations. * * @return the ResourceGuardsClient object. */ ResourceGuardsClient getResourceGuards(); + + /** + * Gets the DppResourceGuardProxiesClient object to access its operations. + * + * @return the DppResourceGuardProxiesClient object. + */ + DppResourceGuardProxiesClient getDppResourceGuardProxies(); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionOperationsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionOperationsClient.java index 63f06497a8bd..06f1443bbc4f 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionOperationsClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionOperationsClient.java @@ -17,7 +17,7 @@ public interface DataProtectionOperationsClient { * * @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 clientDiscoveryResponse. + * @return clientDiscoveryResponse as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface DataProtectionOperationsClient { * @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 clientDiscoveryResponse. + * @return clientDiscoveryResponse as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionsClient.java index e9c2cca27835..63984448d84a 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionsClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionsClient.java @@ -18,26 +18,26 @@ public interface DataProtectionsClient { * * @param location The location parameter. * @param parameters Feature support request object. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for Backup Feature support. + * @return base class for Backup Feature support along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - FeatureValidationResponseBaseInner checkFeatureSupport(String location, FeatureValidationRequestBase parameters); + Response checkFeatureSupportWithResponse( + String location, FeatureValidationRequestBase parameters, Context context); /** * Validates if a feature is supported. * * @param location The location parameter. * @param parameters Feature support request object. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return base class for Backup Feature support. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkFeatureSupportWithResponse( - String location, FeatureValidationRequestBase parameters, Context context); + FeatureValidationResponseBaseInner checkFeatureSupport(String location, FeatureValidationRequestBase parameters); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DeletedBackupInstancesClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DeletedBackupInstancesClient.java new file mode 100644 index 000000000000..bc0509285672 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DeletedBackupInstancesClient.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dataprotection.fluent.models.DeletedBackupInstanceResourceInner; + +/** An instance of this class provides access to all the operations defined in DeletedBackupInstancesClient. */ +public interface DeletedBackupInstancesClient { + /** + * Gets deleted backup instances belonging to a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deleted backup instances belonging to a backup vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Gets deleted backup instances belonging to a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deleted backup instances belonging to a backup vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * Gets a deleted backup instance with name in a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @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 a deleted backup instance with name in a backup vault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * Gets a deleted backup instance with name in a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @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 a deleted backup instance with name in a backup vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeletedBackupInstanceResourceInner get(String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUndelete( + String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUndelete( + String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @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 undelete(String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @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 undelete(String resourceGroupName, String vaultName, String backupInstanceName, Context context); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DppResourceGuardProxiesClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DppResourceGuardProxiesClient.java new file mode 100644 index 000000000000..93e3fd0a63df --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DppResourceGuardProxiesClient.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dataprotection.fluent.models.ResourceGuardProxyBaseResourceInner; +import com.azure.resourcemanager.dataprotection.fluent.models.UnlockDeleteResponseInner; +import com.azure.resourcemanager.dataprotection.models.UnlockDeleteRequest; + +/** An instance of this class provides access to all the operations defined in DppResourceGuardProxiesClient. */ +public interface DppResourceGuardProxiesClient { + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ResourceGuardProxyBase resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ResourceGuardProxyBase resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String vaultName, Context context); + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String resourceGuardProxyName, Context context); + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 resourceGroupName, String vaultName, String resourceGuardProxyName); + + /** + * The put operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + ResourceGuardProxyBaseResourceInner parameters, + Context context); + + /** + * The put operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceGuardProxyBaseResourceInner put( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + ResourceGuardProxyBaseResourceInner parameters); + + /** + * The delete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String vaultName, String resourceGuardProxyName, Context context); + + /** + * The delete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 resourceGroupName, String vaultName, String resourceGuardProxyName); + + /** + * The unlockDelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response unlockDeleteWithResponse( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + UnlockDeleteRequest parameters, + Context context); + + /** + * The unlockDelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 resourceGroupName, String vaultName, String resourceGuardProxyName, UnlockDeleteRequest parameters); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ExportJobsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ExportJobsClient.java index 23717b87a1c0..18bb1be7a102 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ExportJobsClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ExportJobsClient.java @@ -20,7 +20,7 @@ public interface ExportJobsClient { * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginTrigger(String resourceGroupName, String vaultName); @@ -34,7 +34,7 @@ public interface ExportJobsClient { * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginTrigger(String resourceGroupName, String vaultName, Context context); diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ExportJobsOperationResultsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ExportJobsOperationResultsClient.java index 71636c714b0e..fc3c165c2cca 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ExportJobsOperationResultsClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ExportJobsOperationResultsClient.java @@ -20,13 +20,15 @@ public interface ExportJobsOperationResultsClient { * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. * @param operationId OperationID which represents the export job. + * @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 operation result of operation triggered by Export Jobs API. + * @return the operation result of operation triggered by Export Jobs API along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExportJobsResultInner get(String resourceGroupName, String vaultName, String operationId); + Response getWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context); /** * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also @@ -36,13 +38,11 @@ public interface ExportJobsOperationResultsClient { * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. * @param operationId OperationID which represents the export job. - * @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 operation result of operation triggered by Export Jobs API. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String vaultName, String operationId, Context context); + ExportJobsResultInner get(String resourceGroupName, String vaultName, String operationId); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/JobsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/JobsClient.java index d417b058c222..463fb218b2ba 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/JobsClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/JobsClient.java @@ -21,7 +21,7 @@ public interface JobsClient { * @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 AzureBackup Job resources. + * @return list of AzureBackup Job resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String vaultName); @@ -35,7 +35,7 @@ public interface JobsClient { * @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 AzureBackup Job resources. + * @return list of AzureBackup Job resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String vaultName, Context context); @@ -46,13 +46,15 @@ public interface JobsClient { * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. * @param jobId The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + * @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 a job with id in a backup vault. + * @return a job with id in a backup vault along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AzureBackupJobResourceInner get(String resourceGroupName, String vaultName, String jobId); + Response getWithResponse( + String resourceGroupName, String vaultName, String jobId, Context context); /** * Gets a job with id in a backup vault. @@ -60,13 +62,11 @@ public interface JobsClient { * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. * @param jobId The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * @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 a job with id in a backup vault. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String vaultName, String jobId, Context context); + AzureBackupJobResourceInner get(String resourceGroupName, String vaultName, String jobId); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationResultsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationResultsClient.java index 2660819b302d..b9abb974daf8 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationResultsClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationResultsClient.java @@ -13,29 +13,33 @@ /** An instance of this class provides access to all the operations defined in OperationResultsClient. */ public interface OperationResultsClient { /** - * Gets the operation result for a resource. + * Gets the operation status for a resource. + * + *

Gets the operation result for a resource. * * @param operationId The operationId parameter. * @param location The location 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 operation result for a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationJobExtendedInfoInner get(String operationId, String location); + OperationResultsGetResponse getWithResponse(String operationId, String location, Context context); /** - * Gets the operation result for a resource. + * Gets the operation status for a resource. + * + *

Gets the operation result for a resource. * * @param operationId The operationId parameter. * @param location The location 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 operation result for a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationResultsGetResponse getWithResponse(String operationId, String location, Context context); + OperationJobExtendedInfoInner get(String operationId, String location); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationStatusBackupVaultContextsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationStatusBackupVaultContextsClient.java new file mode 100644 index 000000000000..4c04f6d9dce8 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationStatusBackupVaultContextsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.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.dataprotection.fluent.models.OperationResourceInner; + +/** + * An instance of this class provides access to all the operations defined in OperationStatusBackupVaultContextsClient. + */ +public interface OperationStatusBackupVaultContextsClient { + /** + * Gets the operation status for an operation over a BackupVault's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 operation status for an operation over a BackupVault's context along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context); + + /** + * Gets the operation status for an operation over a BackupVault's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 the operation status for an operation over a BackupVault's context. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResourceInner get(String resourceGroupName, String vaultName, String operationId); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationStatusClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationStatusClient.java index d5259472bc83..9a726e19a266 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationStatusClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationStatusClient.java @@ -17,25 +17,25 @@ public interface OperationStatusClient { * * @param location The location parameter. * @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 operation status for a resource. + * @return the operation status for a resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationResourceInner get(String location, String operationId); + Response getWithResponse(String location, String operationId, Context context); /** * Gets the operation status for a resource. * * @param location The location parameter. * @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 operation status for a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String location, String operationId, Context context); + OperationResourceInner get(String location, String operationId); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationStatusResourceGroupContextsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationStatusResourceGroupContextsClient.java new file mode 100644 index 000000000000..472d40349e45 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationStatusResourceGroupContextsClient.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.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.dataprotection.fluent.models.OperationResourceInner; + +/** + * An instance of this class provides access to all the operations defined in + * OperationStatusResourceGroupContextsClient. + */ +public interface OperationStatusResourceGroupContextsClient { + /** + * Gets the operation status for an operation over a ResourceGroup's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @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 operation status for an operation over a ResourceGroup's context along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String operationId, Context context); + + /** + * Gets the operation status for an operation over a ResourceGroup's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @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 the operation status for an operation over a ResourceGroup's context. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResourceInner getByResourceGroup(String resourceGroupName, String operationId); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/RecoveryPointsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/RecoveryPointsClient.java index f710f45135a6..ccc9f82d795b 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/RecoveryPointsClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/RecoveryPointsClient.java @@ -16,23 +16,23 @@ public interface RecoveryPointsClient { /** * Returns a list of Recovery Points for a DataSource in a vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 azureBackupRecoveryPointResourceList. + * @return azureBackupRecoveryPointResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( - String vaultName, String resourceGroupName, String backupInstanceName); + String resourceGroupName, String vaultName, String backupInstanceName); /** * Returns a list of Recovery Points for a DataSource in a vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param filter OData filter options. * @param skipToken skipToken Filter. @@ -40,12 +40,12 @@ PagedIterable list( * @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 azureBackupRecoveryPointResourceList. + * @return azureBackupRecoveryPointResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, String filter, String skipToken, @@ -54,33 +54,33 @@ PagedIterable list( /** * Gets a Recovery Point using recoveryPointId for a Datasource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param recoveryPointId The recoveryPointId 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 a Recovery Point using recoveryPointId for a Datasource. + * @return a Recovery Point using recoveryPointId for a Datasource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AzureBackupRecoveryPointResourceInner get( - String vaultName, String resourceGroupName, String backupInstanceName, String recoveryPointId); + Response getWithResponse( + String resourceGroupName, String vaultName, String backupInstanceName, String recoveryPointId, Context context); /** * Gets a Recovery Point using recoveryPointId for a Datasource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param recoveryPointId The recoveryPointId 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 a Recovery Point using recoveryPointId for a Datasource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String vaultName, String resourceGroupName, String backupInstanceName, String recoveryPointId, Context context); + AzureBackupRecoveryPointResourceInner get( + String resourceGroupName, String vaultName, String backupInstanceName, String recoveryPointId); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ResourceGuardsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ResourceGuardsClient.java index cdb7b453d286..f61273aef70d 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ResourceGuardsClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ResourceGuardsClient.java @@ -20,7 +20,7 @@ public interface ResourceGuardsClient { * * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -32,7 +32,7 @@ public interface ResourceGuardsClient { * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -44,7 +44,7 @@ public interface ResourceGuardsClient { * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -57,7 +57,7 @@ public interface ResourceGuardsClient { * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -68,14 +68,15 @@ public interface ResourceGuardsClient { * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. * @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 the response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ResourceGuardResourceInner put( - String resourceGroupName, String resourceGuardsName, ResourceGuardResourceInner parameters); + Response putWithResponse( + String resourceGroupName, String resourceGuardsName, ResourceGuardResourceInner parameters, Context context); /** * Creates or updates a ResourceGuard resource belonging to a resource group. @@ -83,69 +84,68 @@ ResourceGuardResourceInner put( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. * @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 the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response putWithResponse( - String resourceGroupName, String resourceGuardsName, ResourceGuardResourceInner parameters, Context context); + ResourceGuardResourceInner put( + String resourceGroupName, String resourceGuardsName, ResourceGuardResourceInner parameters); /** * Returns a ResourceGuard belonging to a resource group. * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. + * @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 the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ResourceGuardResourceInner getByResourceGroup(String resourceGroupName, String resourceGuardsName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceGuardsName, Context context); /** * Returns a ResourceGuard belonging to a resource group. * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. - * @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 getByResourceGroupWithResponse( - String resourceGroupName, String resourceGuardsName, Context context); + ResourceGuardResourceInner getByResourceGroup(String resourceGroupName, String resourceGuardsName); /** * Deletes a ResourceGuard resource from the resource group. * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceGuardsName); + Response deleteWithResponse(String resourceGroupName, String resourceGuardsName, Context context); /** * Deletes a ResourceGuard resource from the resource group. * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. - * @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 resourceGroupName, String resourceGuardsName, Context context); + void delete(String resourceGroupName, String resourceGuardsName); /** * Updates a ResourceGuard resource belonging to a resource group. For example, updating tags for a resource. @@ -153,14 +153,15 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. * @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 the response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ResourceGuardResourceInner patch( - String resourceGroupName, String resourceGuardsName, PatchResourceRequestInput parameters); + Response patchWithResponse( + String resourceGroupName, String resourceGuardsName, PatchResourceRequestInput parameters, Context context); /** * Updates a ResourceGuard resource belonging to a resource group. For example, updating tags for a resource. @@ -168,15 +169,14 @@ ResourceGuardResourceInner patch( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. * @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 the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response patchWithResponse( - String resourceGroupName, String resourceGuardsName, PatchResourceRequestInput parameters, Context context); + ResourceGuardResourceInner patch( + String resourceGroupName, String resourceGuardsName, PatchResourceRequestInput parameters); /** * Returns collection of operation request objects for a critical operation protected by the given ResourceGuard @@ -187,7 +187,7 @@ Response patchWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable getDisableSoftDeleteRequestsObjects( @@ -203,7 +203,7 @@ PagedIterable getDisableSoftDeleteRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable getDisableSoftDeleteRequestsObjects( @@ -218,7 +218,7 @@ PagedIterable getDisableSoftDeleteRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable getDeleteResourceGuardProxyRequestsObjects( @@ -234,7 +234,7 @@ PagedIterable getDeleteResourceGuardProxyRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable getDeleteResourceGuardProxyRequestsObjects( @@ -249,7 +249,7 @@ PagedIterable getDeleteResourceGuardProxyRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable getBackupSecurityPinRequestsObjects( @@ -265,7 +265,7 @@ PagedIterable getBackupSecurityPinRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable getBackupSecurityPinRequestsObjects( @@ -280,7 +280,7 @@ PagedIterable getBackupSecurityPinRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable getDeleteProtectedItemRequestsObjects( @@ -296,7 +296,7 @@ PagedIterable getDeleteProtectedItemRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable getDeleteProtectedItemRequestsObjects( @@ -311,7 +311,7 @@ PagedIterable getDeleteProtectedItemRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable getUpdateProtectionPolicyRequestsObjects( @@ -327,7 +327,7 @@ PagedIterable getUpdateProtectionPolicyRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable getUpdateProtectionPolicyRequestsObjects( @@ -342,7 +342,7 @@ PagedIterable getUpdateProtectionPolicyRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable getUpdateProtectedItemRequestsObjects( @@ -358,28 +358,12 @@ PagedIterable getUpdateProtectedItemRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable getUpdateProtectedItemRequestsObjects( String resourceGroupName, String resourceGuardsName, Context context); - /** - * Returns collection of operation request objects for a critical operation protected by the given ResourceGuard - * resource. - * - * @param resourceGroupName The name of the resource group where the backup vault is present. - * @param resourceGuardsName The resourceGuardsName parameter. - * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DppBaseResourceInner getDefaultDisableSoftDeleteRequestsObject( - String resourceGroupName, String resourceGuardsName, String requestName); - /** * Returns collection of operation request objects for a critical operation protected by the given ResourceGuard * resource. @@ -391,7 +375,7 @@ DppBaseResourceInner getDefaultDisableSoftDeleteRequestsObject( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getDefaultDisableSoftDeleteRequestsObjectWithResponse( @@ -410,7 +394,7 @@ Response getDefaultDisableSoftDeleteRequestsObjectWithResp * @return base resource under Microsoft.DataProtection provider namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - DppBaseResourceInner getDefaultDeleteResourceGuardProxyRequestsObject( + DppBaseResourceInner getDefaultDisableSoftDeleteRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName); /** @@ -424,7 +408,7 @@ DppBaseResourceInner getDefaultDeleteResourceGuardProxyRequestsObject( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getDefaultDeleteResourceGuardProxyRequestsObjectWithResponse( @@ -443,7 +427,7 @@ Response getDefaultDeleteResourceGuardProxyRequestsObjectW * @return base resource under Microsoft.DataProtection provider namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - DppBaseResourceInner getDefaultBackupSecurityPinRequestsObject( + DppBaseResourceInner getDefaultDeleteResourceGuardProxyRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName); /** @@ -457,7 +441,7 @@ DppBaseResourceInner getDefaultBackupSecurityPinRequestsObject( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getDefaultBackupSecurityPinRequestsObjectWithResponse( @@ -476,7 +460,7 @@ Response getDefaultBackupSecurityPinRequestsObjectWithResp * @return base resource under Microsoft.DataProtection provider namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - DppBaseResourceInner getDefaultDeleteProtectedItemRequestsObject( + DppBaseResourceInner getDefaultBackupSecurityPinRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName); /** @@ -490,7 +474,7 @@ DppBaseResourceInner getDefaultDeleteProtectedItemRequestsObject( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getDefaultDeleteProtectedItemRequestsObjectWithResponse( @@ -509,7 +493,7 @@ Response getDefaultDeleteProtectedItemRequestsObjectWithRe * @return base resource under Microsoft.DataProtection provider namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - DppBaseResourceInner getDefaultUpdateProtectionPolicyRequestsObject( + DppBaseResourceInner getDefaultDeleteProtectedItemRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName); /** @@ -523,7 +507,7 @@ DppBaseResourceInner getDefaultUpdateProtectionPolicyRequestsObject( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getDefaultUpdateProtectionPolicyRequestsObjectWithResponse( @@ -542,7 +526,7 @@ Response getDefaultUpdateProtectionPolicyRequestsObjectWit * @return base resource under Microsoft.DataProtection provider namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - DppBaseResourceInner getDefaultUpdateProtectedItemRequestsObject( + DppBaseResourceInner getDefaultUpdateProtectionPolicyRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName); /** @@ -556,9 +540,25 @@ DppBaseResourceInner getDefaultUpdateProtectedItemRequestsObject( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getDefaultUpdateProtectedItemRequestsObjectWithResponse( String resourceGroupName, String resourceGuardsName, String requestName, Context context); + + /** + * Returns collection of operation request objects for a critical operation protected by the given ResourceGuard + * resource. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param resourceGuardsName The resourceGuardsName parameter. + * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DppBaseResourceInner getDefaultUpdateProtectedItemRequestsObject( + String resourceGroupName, String resourceGuardsName, String requestName); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/RestorableTimeRangesClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/RestorableTimeRangesClient.java index 740f4e479860..435034a8dec5 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/RestorableTimeRangesClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/RestorableTimeRangesClient.java @@ -14,38 +14,42 @@ /** An instance of this class provides access to all the operations defined in RestorableTimeRangesClient. */ public interface RestorableTimeRangesClient { /** - * @param vaultName The name of the backup vault. + * The find operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 list Restore Ranges Response. + * @return list Restore Ranges Response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AzureBackupFindRestorableTimeRangesResponseResourceInner find( - String vaultName, + Response findWithResponse( String resourceGroupName, + String vaultName, String backupInstanceName, - AzureBackupFindRestorableTimeRangesRequest parameters); + AzureBackupFindRestorableTimeRangesRequest parameters, + Context context); /** - * @param vaultName The name of the backup vault. + * The find operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 list Restore Ranges Response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response findWithResponse( - String vaultName, + AzureBackupFindRestorableTimeRangesResponseResourceInner find( String resourceGroupName, + String vaultName, String backupInstanceName, - AzureBackupFindRestorableTimeRangesRequest parameters, - Context context); + AzureBackupFindRestorableTimeRangesRequest parameters); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupFindRestorableTimeRangesResponseResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupFindRestorableTimeRangesResponseResourceInner.java index 4b674770ec44..5d5189d4ce27 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupFindRestorableTimeRangesResponseResourceInner.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupFindRestorableTimeRangesResponseResourceInner.java @@ -5,25 +5,23 @@ package com.azure.resourcemanager.dataprotection.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.models.AzureBackupFindRestorableTimeRangesResponse; import com.azure.resourcemanager.dataprotection.models.DppResource; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** List Restore Ranges Response. */ @Fluent public final class AzureBackupFindRestorableTimeRangesResponseResourceInner extends DppResource { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(AzureBackupFindRestorableTimeRangesResponseResourceInner.class); - /* * AzureBackupFindRestorableTimeRangesResponseResource properties */ @JsonProperty(value = "properties") private AzureBackupFindRestorableTimeRangesResponse properties; + /** Creates an instance of AzureBackupFindRestorableTimeRangesResponseResourceInner class. */ + public AzureBackupFindRestorableTimeRangesResponseResourceInner() { + } + /** * Get the properties property: AzureBackupFindRestorableTimeRangesResponseResource properties. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupJobResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupJobResourceInner.java index f3fc551c9511..17d703c255ba 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupJobResourceInner.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupJobResourceInner.java @@ -5,23 +5,23 @@ package com.azure.resourcemanager.dataprotection.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.models.AzureBackupJob; import com.azure.resourcemanager.dataprotection.models.DppResource; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** AzureBackup Job Resource Class. */ @Fluent public final class AzureBackupJobResourceInner extends DppResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupJobResourceInner.class); - /* * AzureBackupJobResource properties */ @JsonProperty(value = "properties") private AzureBackupJob properties; + /** Creates an instance of AzureBackupJobResourceInner class. */ + public AzureBackupJobResourceInner() { + } + /** * Get the properties property: AzureBackupJobResource properties. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupRecoveryPointResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupRecoveryPointResourceInner.java index 199b96c51848..8cb518ce0001 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupRecoveryPointResourceInner.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupRecoveryPointResourceInner.java @@ -5,25 +5,33 @@ package com.azure.resourcemanager.dataprotection.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.models.AzureBackupRecoveryPoint; import com.azure.resourcemanager.dataprotection.models.DppResource; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** AzureBackupRecoveryPointResource Azure backup recoveryPoint resource. */ +/** + * AzureBackupRecoveryPointResource + * + *

Azure backup recoveryPoint resource. + */ @Fluent public final class AzureBackupRecoveryPointResourceInner extends DppResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupRecoveryPointResourceInner.class); - /* - * AzureBackupRecoveryPoint AzureBackupRecoveryPointResource properties + * AzureBackupRecoveryPoint + * + * AzureBackupRecoveryPointResource properties */ @JsonProperty(value = "properties") private AzureBackupRecoveryPoint properties; + /** Creates an instance of AzureBackupRecoveryPointResourceInner class. */ + public AzureBackupRecoveryPointResourceInner() { + } + /** - * Get the properties property: AzureBackupRecoveryPoint AzureBackupRecoveryPointResource properties. + * Get the properties property: AzureBackupRecoveryPoint + * + *

AzureBackupRecoveryPointResource properties. * * @return the properties value. */ @@ -32,7 +40,9 @@ public AzureBackupRecoveryPoint properties() { } /** - * Set the properties property: AzureBackupRecoveryPoint AzureBackupRecoveryPointResource properties. + * Set the properties property: AzureBackupRecoveryPoint + * + *

AzureBackupRecoveryPointResource properties. * * @param properties the properties value to set. * @return the AzureBackupRecoveryPointResourceInner object itself. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BackupInstanceResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BackupInstanceResourceInner.java index 7e01834d05be..e02f5028b7d1 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BackupInstanceResourceInner.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BackupInstanceResourceInner.java @@ -5,23 +5,28 @@ package com.azure.resourcemanager.dataprotection.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.models.BackupInstance; -import com.azure.resourcemanager.dataprotection.models.DppResource; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.dataprotection.models.DppProxyResource; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; -/** BackupInstanceResource BackupInstance Resource. */ +/** + * BackupInstanceResource + * + *

BackupInstance Resource. + */ @Fluent -public final class BackupInstanceResourceInner extends DppResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupInstanceResourceInner.class); - +public final class BackupInstanceResourceInner extends DppProxyResource { /* * BackupInstanceResource properties */ @JsonProperty(value = "properties") private BackupInstance properties; + /** Creates an instance of BackupInstanceResourceInner class. */ + public BackupInstanceResourceInner() { + } + /** * Get the properties property: BackupInstanceResource properties. * @@ -42,6 +47,13 @@ public BackupInstanceResourceInner withProperties(BackupInstance properties) { return this; } + /** {@inheritDoc} */ + @Override + public BackupInstanceResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Validates the instance. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BackupVaultResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BackupVaultResourceInner.java index 05b9ee22e857..5dd507b2ed23 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BackupVaultResourceInner.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BackupVaultResourceInner.java @@ -9,23 +9,32 @@ import com.azure.resourcemanager.dataprotection.models.BackupVault; import com.azure.resourcemanager.dataprotection.models.DppIdentityDetails; import com.azure.resourcemanager.dataprotection.models.DppTrackedResource; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** BackupVault Resource Backup Vault Resource. */ +/** + * BackupVault Resource + * + *

Backup Vault Resource. + */ @Fluent public final class BackupVaultResourceInner extends DppTrackedResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupVaultResourceInner.class); - /* - * BackupVault BackupVaultResource properties + * BackupVault + * + * BackupVaultResource properties */ @JsonProperty(value = "properties", required = true) private BackupVault properties; + /** Creates an instance of BackupVaultResourceInner class. */ + public BackupVaultResourceInner() { + } + /** - * Get the properties property: BackupVault BackupVaultResource properties. + * Get the properties property: BackupVault + * + *

BackupVaultResource properties. * * @return the properties value. */ @@ -34,7 +43,9 @@ public BackupVault properties() { } /** - * Set the properties property: BackupVault BackupVaultResource properties. + * Set the properties property: BackupVault + * + *

BackupVaultResource properties. * * @param properties the properties value to set. * @return the BackupVaultResourceInner object itself. @@ -81,7 +92,7 @@ public BackupVaultResourceInner withTags(Map tags) { public void validate() { super.validate(); if (properties() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property properties in model BackupVaultResourceInner")); @@ -89,4 +100,6 @@ public void validate() { properties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(BackupVaultResourceInner.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BaseBackupPolicyResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BaseBackupPolicyResourceInner.java index f714b63e6363..2212727fe07e 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BaseBackupPolicyResourceInner.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BaseBackupPolicyResourceInner.java @@ -5,25 +5,33 @@ package com.azure.resourcemanager.dataprotection.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.models.BaseBackupPolicy; import com.azure.resourcemanager.dataprotection.models.DppResource; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** BaseBackupPolicyResource BaseBackupPolicy resource. */ +/** + * BaseBackupPolicyResource + * + *

BaseBackupPolicy resource. + */ @Fluent public final class BaseBackupPolicyResourceInner extends DppResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BaseBackupPolicyResourceInner.class); - /* - * BaseBackupPolicy BaseBackupPolicyResource properties + * BaseBackupPolicy + * + * BaseBackupPolicyResource properties */ @JsonProperty(value = "properties") private BaseBackupPolicy properties; + /** Creates an instance of BaseBackupPolicyResourceInner class. */ + public BaseBackupPolicyResourceInner() { + } + /** - * Get the properties property: BaseBackupPolicy BaseBackupPolicyResource properties. + * Get the properties property: BaseBackupPolicy + * + *

BaseBackupPolicyResource properties. * * @return the properties value. */ @@ -32,7 +40,9 @@ public BaseBackupPolicy properties() { } /** - * Set the properties property: BaseBackupPolicy BaseBackupPolicyResource properties. + * Set the properties property: BaseBackupPolicy + * + *

BaseBackupPolicyResource properties. * * @param properties the properties value to set. * @return the BaseBackupPolicyResourceInner object itself. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/CheckNameAvailabilityResultInner.java index 4f702656ff02..7adeff1ad143 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/CheckNameAvailabilityResultInner.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/CheckNameAvailabilityResultInner.java @@ -5,15 +5,15 @@ package com.azure.resourcemanager.dataprotection.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; -/** CheckNameAvailabilityResult CheckNameAvailability Result. */ +/** + * CheckNameAvailabilityResult + * + *

CheckNameAvailability Result. + */ @Fluent public final class CheckNameAvailabilityResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityResultInner.class); - /* * Gets or sets the message. */ @@ -32,6 +32,10 @@ public final class CheckNameAvailabilityResultInner { @JsonProperty(value = "reason") private String reason; + /** Creates an instance of CheckNameAvailabilityResultInner class. */ + public CheckNameAvailabilityResultInner() { + } + /** * Get the message property: Gets or sets the message. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ClientDiscoveryValueForSingleApiInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ClientDiscoveryValueForSingleApiInner.java index 4a7f24e3601b..b7177303fb6d 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ClientDiscoveryValueForSingleApiInner.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ClientDiscoveryValueForSingleApiInner.java @@ -5,20 +5,21 @@ package com.azure.resourcemanager.dataprotection.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.models.ClientDiscoveryDisplay; import com.azure.resourcemanager.dataprotection.models.ClientDiscoveryForProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** ClientDiscoveryValueForSingleApi Available operation details. */ +/** + * ClientDiscoveryValueForSingleApi + * + *

Available operation details. + */ @Fluent public final class ClientDiscoveryValueForSingleApiInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryValueForSingleApiInner.class); - /* - * ClientDiscoveryDisplay Contains the localized display information for - * this particular operation + * ClientDiscoveryDisplay + * + * Contains the localized display information for this particular operation */ @JsonProperty(value = "display") private ClientDiscoveryDisplay display; @@ -36,21 +37,27 @@ public final class ClientDiscoveryValueForSingleApiInner { private Boolean isDataAction; /* - * The intended executor of the operation;governs the display of the - * operation in the RBAC UX and the audit logs UX + * The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX */ @JsonProperty(value = "origin") private String origin; /* - * ClientDiscoveryForProperties Properties for the given operation. + * ClientDiscoveryForProperties + * + * Properties for the given operation. */ @JsonProperty(value = "properties") private ClientDiscoveryForProperties properties; + /** Creates an instance of ClientDiscoveryValueForSingleApiInner class. */ + public ClientDiscoveryValueForSingleApiInner() { + } + /** - * Get the display property: ClientDiscoveryDisplay Contains the localized display information for this particular - * operation. + * Get the display property: ClientDiscoveryDisplay + * + *

Contains the localized display information for this particular operation. * * @return the display value. */ @@ -59,8 +66,9 @@ public ClientDiscoveryDisplay display() { } /** - * Set the display property: ClientDiscoveryDisplay Contains the localized display information for this particular - * operation. + * Set the display property: ClientDiscoveryDisplay + * + *

Contains the localized display information for this particular operation. * * @param display the display value to set. * @return the ClientDiscoveryValueForSingleApiInner object itself. @@ -133,7 +141,9 @@ public ClientDiscoveryValueForSingleApiInner withOrigin(String origin) { } /** - * Get the properties property: ClientDiscoveryForProperties Properties for the given operation. + * Get the properties property: ClientDiscoveryForProperties + * + *

Properties for the given operation. * * @return the properties value. */ @@ -142,7 +152,9 @@ public ClientDiscoveryForProperties properties() { } /** - * Set the properties property: ClientDiscoveryForProperties Properties for the given operation. + * Set the properties property: ClientDiscoveryForProperties + * + *

Properties for the given operation. * * @param properties the properties value to set. * @return the ClientDiscoveryValueForSingleApiInner object itself. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/DeletedBackupInstanceResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/DeletedBackupInstanceResourceInner.java new file mode 100644 index 000000000000..d43cf4218284 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/DeletedBackupInstanceResourceInner.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dataprotection.models.DeletedBackupInstance; +import com.azure.resourcemanager.dataprotection.models.DppResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deleted Backup Instance. */ +@Fluent +public final class DeletedBackupInstanceResourceInner extends DppResource { + /* + * DeletedBackupInstanceResource properties + */ + @JsonProperty(value = "properties") + private DeletedBackupInstance properties; + + /** Creates an instance of DeletedBackupInstanceResourceInner class. */ + public DeletedBackupInstanceResourceInner() { + } + + /** + * Get the properties property: DeletedBackupInstanceResource properties. + * + * @return the properties value. + */ + public DeletedBackupInstance properties() { + return this.properties; + } + + /** + * Set the properties property: DeletedBackupInstanceResource properties. + * + * @param properties the properties value to set. + * @return the DeletedBackupInstanceResourceInner object itself. + */ + public DeletedBackupInstanceResourceInner withProperties(DeletedBackupInstance properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/DppBaseResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/DppBaseResourceInner.java index 60bfac685e8b..50dd4144fbc8 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/DppBaseResourceInner.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/DppBaseResourceInner.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.dataprotection.fluent.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; /** Base resource under Microsoft.DataProtection provider namespace. */ @Immutable public final class DppBaseResourceInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DppBaseResourceInner.class); - /* * Resource Id represents the complete path to the resource. */ @@ -27,12 +23,15 @@ public final class DppBaseResourceInner { private String name; /* - * Resource type represents the complete path of the form - * Namespace/ResourceType/ResourceType/... + * Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... */ @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; + /** Creates an instance of DppBaseResourceInner class. */ + public DppBaseResourceInner() { + } + /** * Get the id property: Resource Id represents the complete path to the resource. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ExportJobsResultInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ExportJobsResultInner.java index fcd4ef9d68a7..2f302711c684 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ExportJobsResultInner.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ExportJobsResultInner.java @@ -5,18 +5,17 @@ package com.azure.resourcemanager.dataprotection.fluent.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; -/** ExportJobsResult The result for export jobs containing blob details. */ +/** + * ExportJobsResult + * + *

The result for export jobs containing blob details. + */ @Immutable public final class ExportJobsResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportJobsResultInner.class); - /* - * URL of the blob into which the serialized string of list of jobs is - * exported. + * URL of the blob into which the serialized string of list of jobs is exported. */ @JsonProperty(value = "blobUrl", access = JsonProperty.Access.WRITE_ONLY) private String blobUrl; @@ -39,6 +38,10 @@ public final class ExportJobsResultInner { @JsonProperty(value = "excelFileBlobSasKey", access = JsonProperty.Access.WRITE_ONLY) private String excelFileBlobSasKey; + /** Creates an instance of ExportJobsResultInner class. */ + public ExportJobsResultInner() { + } + /** * Get the blobUrl property: URL of the blob into which the serialized string of list of jobs is exported. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/FeatureValidationResponseBaseInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/FeatureValidationResponseBaseInner.java index 0e9a3db10739..adea05edb0ae 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/FeatureValidationResponseBaseInner.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/FeatureValidationResponseBaseInner.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.dataprotection.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.models.FeatureValidationResponse; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -22,7 +20,9 @@ @JsonSubTypes({@JsonSubTypes.Type(name = "FeatureValidationResponse", value = FeatureValidationResponse.class)}) @Immutable public class FeatureValidationResponseBaseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FeatureValidationResponseBaseInner.class); + /** Creates an instance of FeatureValidationResponseBaseInner class. */ + public FeatureValidationResponseBaseInner() { + } /** * Validates the instance. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/OperationJobExtendedInfoInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/OperationJobExtendedInfoInner.java index df6a5423476c..8fcec9539b9e 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/OperationJobExtendedInfoInner.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/OperationJobExtendedInfoInner.java @@ -5,26 +5,30 @@ package com.azure.resourcemanager.dataprotection.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.models.OperationExtendedInfo; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** OperationJobExtendedInfo Operation Job Extended Info. */ +/** + * OperationJobExtendedInfo + * + *

Operation Job Extended Info. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("OperationJobExtendedInfo") @Fluent public final class OperationJobExtendedInfoInner extends OperationExtendedInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationJobExtendedInfoInner.class); - /* * Arm Id of the job created for this operation. */ @JsonProperty(value = "jobId") private String jobId; + /** Creates an instance of OperationJobExtendedInfoInner class. */ + public OperationJobExtendedInfoInner() { + } + /** * Get the jobId property: Arm Id of the job created for this operation. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/OperationResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/OperationResourceInner.java index b7b4a59eae79..b4a756ef7ea3 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/OperationResourceInner.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/OperationResourceInner.java @@ -6,17 +6,17 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.models.OperationExtendedInfo; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** OperationResource Operation Resource. */ +/** + * OperationResource + * + *

Operation Resource. + */ @Fluent public final class OperationResourceInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResourceInner.class); - /* * End time of the operation */ @@ -24,11 +24,9 @@ public final class OperationResourceInner { private OffsetDateTime endTime; /* - * Required if status == failed or status == canceled. This is the OData v4 - * error format, used by the RPC and will go into the v2.2 Azure REST API - * guidelines. - * The full set of optional properties (e.g. inner errors / details) can be - * found in the "Error Response" section. + * Required if status == failed or status == canceled. This is the OData v4 error format, used by the RPC and will + * go into the v2.2 Azure REST API guidelines. + * The full set of optional properties (e.g. inner errors / details) can be found in the "Error Response" section. */ @JsonProperty(value = "error") private ManagementError error; @@ -40,14 +38,15 @@ public final class OperationResourceInner { private String id; /* - * It must match the last segment of the "id" field, and will typically be - * a GUID / system generated value + * It must match the last segment of the "id" field, and will typically be a GUID / system generated value */ @JsonProperty(value = "name") private String name; /* - * OperationExtendedInfo End time of the operation + * OperationExtendedInfo + * + * End time of the operation */ @JsonProperty(value = "properties") private OperationExtendedInfo properties; @@ -64,6 +63,10 @@ public final class OperationResourceInner { @JsonProperty(value = "status") private String status; + /** Creates an instance of OperationResourceInner class. */ + public OperationResourceInner() { + } + /** * Get the endTime property: End time of the operation. * @@ -151,7 +154,9 @@ public OperationResourceInner withName(String name) { } /** - * Get the properties property: OperationExtendedInfo End time of the operation. + * Get the properties property: OperationExtendedInfo + * + *

End time of the operation. * * @return the properties value. */ @@ -160,7 +165,9 @@ public OperationExtendedInfo properties() { } /** - * Set the properties property: OperationExtendedInfo End time of the operation. + * Set the properties property: OperationExtendedInfo + * + *

End time of the operation. * * @param properties the properties value to set. * @return the OperationResourceInner object itself. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ResourceGuardProxyBaseResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ResourceGuardProxyBaseResourceInner.java new file mode 100644 index 000000000000..23d0e34c42ef --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ResourceGuardProxyBaseResourceInner.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dataprotection.models.DppResource; +import com.azure.resourcemanager.dataprotection.models.ResourceGuardProxyBase; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourceGuardProxyBaseResource model. */ +@Fluent +public final class ResourceGuardProxyBaseResourceInner extends DppResource { + /* + * ResourceGuardProxyBaseResource properties + */ + @JsonProperty(value = "properties") + private ResourceGuardProxyBase properties; + + /** Creates an instance of ResourceGuardProxyBaseResourceInner class. */ + public ResourceGuardProxyBaseResourceInner() { + } + + /** + * Get the properties property: ResourceGuardProxyBaseResource properties. + * + * @return the properties value. + */ + public ResourceGuardProxyBase properties() { + return this.properties; + } + + /** + * Set the properties property: ResourceGuardProxyBaseResource properties. + * + * @param properties the properties value to set. + * @return the ResourceGuardProxyBaseResourceInner object itself. + */ + public ResourceGuardProxyBaseResourceInner withProperties(ResourceGuardProxyBase properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ResourceGuardResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ResourceGuardResourceInner.java index a5c68fc13b2e..3c4c354bd647 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ResourceGuardResourceInner.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ResourceGuardResourceInner.java @@ -5,25 +5,25 @@ package com.azure.resourcemanager.dataprotection.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.models.DppIdentityDetails; import com.azure.resourcemanager.dataprotection.models.DppTrackedResource; import com.azure.resourcemanager.dataprotection.models.ResourceGuard; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The ResourceGuardResource model. */ @Fluent public final class ResourceGuardResourceInner extends DppTrackedResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGuardResourceInner.class); - /* * ResourceGuardResource properties */ @JsonProperty(value = "properties") private ResourceGuard properties; + /** Creates an instance of ResourceGuardResourceInner class. */ + public ResourceGuardResourceInner() { + } + /** * Get the properties property: ResourceGuardResource properties. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/UnlockDeleteResponseInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/UnlockDeleteResponseInner.java new file mode 100644 index 000000000000..3a18c252bb9a --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/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.dataprotection.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response of Unlock Delete API. */ +@Fluent +public final class UnlockDeleteResponseInner { + /* + * This is the time when unlock delete privileges will get expired. + */ + @JsonProperty(value = "unlockDeleteExpiryTime") + private String unlockDeleteExpiryTime; + + /** Creates an instance of UnlockDeleteResponseInner class. */ + public UnlockDeleteResponseInner() { + } + + /** + * 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/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstanceResourceImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstanceResourceImpl.java index 949cf0caed1b..e88d4d1159de 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstanceResourceImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstanceResourceImpl.java @@ -12,8 +12,11 @@ import com.azure.resourcemanager.dataprotection.models.BackupInstance; import com.azure.resourcemanager.dataprotection.models.BackupInstanceResource; import com.azure.resourcemanager.dataprotection.models.OperationJobExtendedInfo; +import com.azure.resourcemanager.dataprotection.models.SyncBackupInstanceRequest; import com.azure.resourcemanager.dataprotection.models.TriggerBackupRequest; import com.azure.resourcemanager.dataprotection.models.ValidateRestoreRequestObject; +import java.util.Collections; +import java.util.Map; public final class BackupInstanceResourceImpl implements BackupInstanceResource, BackupInstanceResource.Definition, BackupInstanceResource.Update { @@ -33,6 +36,15 @@ public String type() { return this.innerModel().type(); } + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -41,6 +53,10 @@ public BackupInstance properties() { return this.innerModel().properties(); } + public String resourceGroupName() { + return resourceGroupName; + } + public BackupInstanceResourceInner innerModel() { return this.innerObject; } @@ -49,15 +65,15 @@ private com.azure.resourcemanager.dataprotection.DataProtectionManager manager() return this.serviceManager; } - private String vaultName; - private String resourceGroupName; + private String vaultName; + private String backupInstanceName; - public BackupInstanceResourceImpl withExistingBackupVault(String vaultName, String resourceGroupName) { - this.vaultName = vaultName; + public BackupInstanceResourceImpl withExistingBackupVault(String resourceGroupName, String vaultName) { this.resourceGroupName = resourceGroupName; + this.vaultName = vaultName; return this; } @@ -66,7 +82,7 @@ public BackupInstanceResource create() { serviceManager .serviceClient() .getBackupInstances() - .createOrUpdate(vaultName, resourceGroupName, backupInstanceName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, vaultName, backupInstanceName, this.innerModel(), Context.NONE); return this; } @@ -75,7 +91,7 @@ public BackupInstanceResource create(Context context) { serviceManager .serviceClient() .getBackupInstances() - .createOrUpdate(vaultName, resourceGroupName, backupInstanceName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, vaultName, backupInstanceName, this.innerModel(), context); return this; } @@ -95,7 +111,7 @@ public BackupInstanceResource apply() { serviceManager .serviceClient() .getBackupInstances() - .createOrUpdate(vaultName, resourceGroupName, backupInstanceName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, vaultName, backupInstanceName, this.innerModel(), Context.NONE); return this; } @@ -104,7 +120,7 @@ public BackupInstanceResource apply(Context context) { serviceManager .serviceClient() .getBackupInstances() - .createOrUpdate(vaultName, resourceGroupName, backupInstanceName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, vaultName, backupInstanceName, this.innerModel(), context); return this; } @@ -113,8 +129,8 @@ public BackupInstanceResource apply(Context context) { com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "backupVaults"); this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "backupVaults"); this.backupInstanceName = Utils.getValueFromIdByName(innerObject.id(), "backupInstances"); } @@ -123,7 +139,7 @@ public BackupInstanceResource refresh() { serviceManager .serviceClient() .getBackupInstances() - .getWithResponse(vaultName, resourceGroupName, backupInstanceName, Context.NONE) + .getWithResponse(resourceGroupName, vaultName, backupInstanceName, Context.NONE) .getValue(); return this; } @@ -133,7 +149,7 @@ public BackupInstanceResource refresh(Context context) { serviceManager .serviceClient() .getBackupInstances() - .getWithResponse(vaultName, resourceGroupName, backupInstanceName, context) + .getWithResponse(resourceGroupName, vaultName, backupInstanceName, context) .getValue(); return this; } @@ -141,13 +157,13 @@ public BackupInstanceResource refresh(Context context) { public OperationJobExtendedInfo adhocBackup(TriggerBackupRequest parameters) { return serviceManager .backupInstances() - .adhocBackup(vaultName, resourceGroupName, backupInstanceName, parameters); + .adhocBackup(resourceGroupName, vaultName, backupInstanceName, parameters); } public OperationJobExtendedInfo adhocBackup(TriggerBackupRequest parameters, Context context) { return serviceManager .backupInstances() - .adhocBackup(vaultName, resourceGroupName, backupInstanceName, parameters, context); + .adhocBackup(resourceGroupName, vaultName, backupInstanceName, parameters, context); } public void triggerRehydrate(AzureBackupRehydrationRequest parameters) { @@ -163,25 +179,74 @@ public void triggerRehydrate(AzureBackupRehydrationRequest parameters, Context c public OperationJobExtendedInfo triggerRestore(AzureBackupRestoreRequest parameters) { return serviceManager .backupInstances() - .triggerRestore(vaultName, resourceGroupName, backupInstanceName, parameters); + .triggerRestore(resourceGroupName, vaultName, backupInstanceName, parameters); } public OperationJobExtendedInfo triggerRestore(AzureBackupRestoreRequest parameters, Context context) { return serviceManager .backupInstances() - .triggerRestore(vaultName, resourceGroupName, backupInstanceName, parameters, context); + .triggerRestore(resourceGroupName, vaultName, backupInstanceName, parameters, context); + } + + public void resumeBackups() { + serviceManager.backupInstances().resumeBackups(resourceGroupName, vaultName, backupInstanceName); + } + + public void resumeBackups(Context context) { + serviceManager.backupInstances().resumeBackups(resourceGroupName, vaultName, backupInstanceName, context); + } + + public void resumeProtection() { + serviceManager.backupInstances().resumeProtection(resourceGroupName, vaultName, backupInstanceName); + } + + public void resumeProtection(Context context) { + serviceManager.backupInstances().resumeProtection(resourceGroupName, vaultName, backupInstanceName, context); + } + + public void stopProtection() { + serviceManager.backupInstances().stopProtection(resourceGroupName, vaultName, backupInstanceName); + } + + public void stopProtection(Context context) { + serviceManager.backupInstances().stopProtection(resourceGroupName, vaultName, backupInstanceName, context); + } + + public void suspendBackups() { + serviceManager.backupInstances().suspendBackups(resourceGroupName, vaultName, backupInstanceName); + } + + public void suspendBackups(Context context) { + serviceManager.backupInstances().suspendBackups(resourceGroupName, vaultName, backupInstanceName, context); + } + + public void syncBackupInstance(SyncBackupInstanceRequest parameters) { + serviceManager + .backupInstances() + .syncBackupInstance(resourceGroupName, vaultName, backupInstanceName, parameters); + } + + public void syncBackupInstance(SyncBackupInstanceRequest parameters, Context context) { + serviceManager + .backupInstances() + .syncBackupInstance(resourceGroupName, vaultName, backupInstanceName, parameters, context); } public OperationJobExtendedInfo validateForRestore(ValidateRestoreRequestObject parameters) { return serviceManager .backupInstances() - .validateForRestore(vaultName, resourceGroupName, backupInstanceName, parameters); + .validateForRestore(resourceGroupName, vaultName, backupInstanceName, parameters); } public OperationJobExtendedInfo validateForRestore(ValidateRestoreRequestObject parameters, Context context) { return serviceManager .backupInstances() - .validateForRestore(vaultName, resourceGroupName, backupInstanceName, parameters, context); + .validateForRestore(resourceGroupName, vaultName, backupInstanceName, parameters, context); + } + + public BackupInstanceResourceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; } public BackupInstanceResourceImpl withProperties(BackupInstance properties) { diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesClientImpl.java index 0c9bfe046d6b..fdaea40092fc 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesClientImpl.java @@ -30,7 +30,6 @@ 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.dataprotection.fluent.BackupInstancesClient; @@ -39,6 +38,7 @@ import com.azure.resourcemanager.dataprotection.models.AzureBackupRehydrationRequest; import com.azure.resourcemanager.dataprotection.models.AzureBackupRestoreRequest; import com.azure.resourcemanager.dataprotection.models.BackupInstanceResourceList; +import com.azure.resourcemanager.dataprotection.models.SyncBackupInstanceRequest; import com.azure.resourcemanager.dataprotection.models.TriggerBackupRequest; import com.azure.resourcemanager.dataprotection.models.ValidateForBackupRequest; import com.azure.resourcemanager.dataprotection.models.ValidateRestoreRequestObject; @@ -48,8 +48,6 @@ /** An instance of this class provides access to all the operations defined in BackupInstancesClient. */ public final class BackupInstancesClientImpl implements BackupInstancesClient { - private final ClientLogger logger = new ClientLogger(BackupInstancesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final BackupInstancesService service; @@ -73,7 +71,7 @@ public final class BackupInstancesClientImpl implements BackupInstancesClient { */ @Host("{$host}") @ServiceInterface(name = "DataProtectionClient") - private interface BackupInstancesService { + public interface BackupInstancesService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" @@ -83,9 +81,9 @@ private interface BackupInstancesService { Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @HeaderParam("Accept") String accept, Context context); @@ -98,9 +96,9 @@ 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, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @HeaderParam("Accept") String accept, Context context); @@ -109,14 +107,14 @@ Mono> get( @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @BodyParam("application/json") BackupInstanceResourceInner parameters, @HeaderParam("Accept") String accept, @@ -131,9 +129,9 @@ Mono>> createOrUpdate( Mono>> delete( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @HeaderParam("Accept") String accept, Context context); @@ -147,9 +145,9 @@ Mono>> delete( Mono>> adhocBackup( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @BodyParam("application/json") TriggerBackupRequest parameters, @HeaderParam("Accept") String accept, @@ -164,13 +162,30 @@ Mono>> adhocBackup( Mono>> validateForBackup( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @BodyParam("application/json") ValidateForBackupRequest parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/operationResults/{operationId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBackupInstanceOperationResult( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("backupInstanceName") String backupInstanceName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" @@ -197,11 +212,92 @@ Mono>> triggerRehydrate( Mono>> triggerRestore( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("backupInstanceName") String backupInstanceName, + @BodyParam("application/json") AzureBackupRestoreRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/resumeBackups") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resumeBackups( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("backupInstanceName") String backupInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/resumeProtection") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resumeProtection( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("backupInstanceName") String backupInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/stopProtection") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stopProtection( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("backupInstanceName") String backupInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/suspendBackups") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> suspendBackups( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("backupInstanceName") String backupInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/sync") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> syncBackupInstance( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, - @BodyParam("application/json") AzureBackupRestoreRequest parameters, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SyncBackupInstanceRequest parameters, @HeaderParam("Accept") String accept, Context context); @@ -214,9 +310,9 @@ Mono>> triggerRestore( Mono>> validateForRestore( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @BodyParam("application/json") ValidateRestoreRequestObject parameters, @HeaderParam("Accept") String accept, @@ -236,35 +332,36 @@ Mono> listNext( /** * Gets a backup instances belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup instances belonging to a backup vault. + * @return a backup instances belonging to a backup vault along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String vaultName, String resourceGroupName) { + String resourceGroupName, String vaultName) { 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( @@ -273,9 +370,9 @@ private Mono> listSinglePageAsync( .list( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, accept, context)) .>map( @@ -285,7 +382,7 @@ private Mono> listSinglePageAsync( res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -293,45 +390,46 @@ private Mono> listSinglePageAsync( /** * Gets a backup instances belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup instances belonging to a backup vault. + * @return a backup instances belonging to a backup vault along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String vaultName, String resourceGroupName, Context context) { + String resourceGroupName, String vaultName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, accept, context) .map( @@ -341,110 +439,111 @@ private Mono> listSinglePageAsync( res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } /** * Gets a backup instances belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup instances belonging to a backup vault. + * @return a backup instances belonging to a backup vault as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName) { + private PagedFlux listAsync(String resourceGroupName, String vaultName) { return new PagedFlux<>( - () -> listSinglePageAsync(vaultName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + () -> listSinglePageAsync(resourceGroupName, vaultName), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets a backup instances belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup instances belonging to a backup vault. + * @return a backup instances belonging to a backup vault as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String vaultName, String resourceGroupName, Context context) { + String resourceGroupName, String vaultName, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(vaultName, resourceGroupName, context), + () -> listSinglePageAsync(resourceGroupName, vaultName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets a backup instances belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup instances belonging to a backup vault. + * @return a backup instances belonging to a backup vault as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName) { - return new PagedIterable<>(listAsync(vaultName, resourceGroupName)); + public PagedIterable list(String resourceGroupName, String vaultName) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName)); } /** * Gets a backup instances belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup instances belonging to a backup vault. + * @return a backup instances belonging to a backup vault as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String vaultName, String resourceGroupName, Context context) { - return new PagedIterable<>(listAsync(vaultName, resourceGroupName, context)); + String resourceGroupName, String vaultName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, context)); } /** * Gets a backup instance with name in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup instance with name in a backup vault. + * @return a backup instance with name in a backup vault along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String vaultName, String resourceGroupName, String backupInstanceName) { + String resourceGroupName, String vaultName, String backupInstanceName) { 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -457,9 +556,9 @@ private Mono> getWithResponseAsync( .get( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, accept, context)) @@ -469,37 +568,38 @@ private Mono> getWithResponseAsync( /** * Gets a backup instance with name in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 a backup instance with name in a backup vault. + * @return a backup instance with name in a backup vault along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String vaultName, String resourceGroupName, String backupInstanceName, Context context) { + String resourceGroupName, String vaultName, String backupInstanceName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -510,9 +610,9 @@ private Mono> getWithResponseAsync( .get( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, accept, context); @@ -521,96 +621,89 @@ private Mono> getWithResponseAsync( /** * Gets a backup instance with name in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup instance with name in a backup vault. + * @return a backup instance with name in a backup vault on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( - String vaultName, String resourceGroupName, String backupInstanceName) { - return getWithResponseAsync(vaultName, resourceGroupName, backupInstanceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + String resourceGroupName, String vaultName, String backupInstanceName) { + return getWithResponseAsync(resourceGroupName, vaultName, backupInstanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a backup instance with name in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. + * @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 a backup instance with name in a backup vault. + * @return a backup instance with name in a backup vault along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BackupInstanceResourceInner get(String vaultName, String resourceGroupName, String backupInstanceName) { - return getAsync(vaultName, resourceGroupName, backupInstanceName).block(); + public Response getWithResponse( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, context).block(); } /** * Gets a backup instance with name in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. - * @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 a backup instance with name in a backup vault. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String vaultName, String resourceGroupName, String backupInstanceName, Context context) { - return getWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, context).block(); + public BackupInstanceResourceInner get(String resourceGroupName, String vaultName, String backupInstanceName) { + return getWithResponse(resourceGroupName, vaultName, backupInstanceName, Context.NONE).getValue(); } /** * Create or update a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 backupInstanceResource. + * @return backupInstanceResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( - String vaultName, String resourceGroupName, String backupInstanceName, BackupInstanceResourceInner parameters) { + String resourceGroupName, String vaultName, String backupInstanceName, BackupInstanceResourceInner 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -628,9 +721,9 @@ private Mono>> createOrUpdateWithResponseAsync( .createOrUpdate( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, parameters, accept, @@ -641,20 +734,20 @@ private Mono>> createOrUpdateWithResponseAsync( /** * Create or update a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 backupInstanceResource. + * @return backupInstanceResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, BackupInstanceResourceInner parameters, Context context) { @@ -664,25 +757,25 @@ private Mono>> createOrUpdateWithResponseAsync( 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 (backupInstanceName == null) { + if (resourceGroupName == null) { return Mono - .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName 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(); } @@ -692,9 +785,9 @@ private Mono>> createOrUpdateWithResponseAsync( .createOrUpdate( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, parameters, accept, @@ -704,20 +797,20 @@ private Mono>> createOrUpdateWithResponseAsync( /** * Create or update a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 backupInstanceResource. + * @return the {@link PollerFlux} for polling of backupInstanceResource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BackupInstanceResourceInner> beginCreateOrUpdateAsync( - String vaultName, String resourceGroupName, String backupInstanceName, BackupInstanceResourceInner parameters) { + String resourceGroupName, String vaultName, String backupInstanceName, BackupInstanceResourceInner parameters) { Mono>> mono = - createOrUpdateWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters); + createOrUpdateWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters); return this .client .getLroResult( @@ -725,32 +818,32 @@ private PollerFlux, BackupInstanceResour this.client.getHttpPipeline(), BackupInstanceResourceInner.class, BackupInstanceResourceInner.class, - Context.NONE); + this.client.getContext()); } /** * Create or update a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 backupInstanceResource. + * @return the {@link PollerFlux} for polling of backupInstanceResource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BackupInstanceResourceInner> beginCreateOrUpdateAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, BackupInstanceResourceInner parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono = - createOrUpdateWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context); + createOrUpdateWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context); return this .client .getLroResult( @@ -764,61 +857,61 @@ private PollerFlux, BackupInstanceResour /** * Create or update a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 backupInstanceResource. + * @return the {@link SyncPoller} for polling of backupInstanceResource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, BackupInstanceResourceInner> beginCreateOrUpdate( - String vaultName, String resourceGroupName, String backupInstanceName, BackupInstanceResourceInner parameters) { - return beginCreateOrUpdateAsync(vaultName, resourceGroupName, backupInstanceName, parameters).getSyncPoller(); + String resourceGroupName, String vaultName, String backupInstanceName, BackupInstanceResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, backupInstanceName, parameters).getSyncPoller(); } /** * Create or update a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 backupInstanceResource. + * @return the {@link SyncPoller} for polling of backupInstanceResource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, BackupInstanceResourceInner> beginCreateOrUpdate( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, BackupInstanceResourceInner parameters, Context context) { - return beginCreateOrUpdateAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context) + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context) .getSyncPoller(); } /** * Create or update a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 backupInstanceResource. + * @return backupInstanceResource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( - String vaultName, String resourceGroupName, String backupInstanceName, BackupInstanceResourceInner parameters) { - return beginCreateOrUpdateAsync(vaultName, resourceGroupName, backupInstanceName, parameters) + String resourceGroupName, String vaultName, String backupInstanceName, BackupInstanceResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, backupInstanceName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -826,24 +919,24 @@ private Mono createOrUpdateAsync( /** * Create or update a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 backupInstanceResource. + * @return backupInstanceResource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, BackupInstanceResourceInner parameters, Context context) { - return beginCreateOrUpdateAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context) + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -851,8 +944,8 @@ private Mono createOrUpdateAsync( /** * Create or update a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -862,15 +955,15 @@ private Mono createOrUpdateAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public BackupInstanceResourceInner createOrUpdate( - String vaultName, String resourceGroupName, String backupInstanceName, BackupInstanceResourceInner parameters) { - return createOrUpdateAsync(vaultName, resourceGroupName, backupInstanceName, parameters).block(); + String resourceGroupName, String vaultName, String backupInstanceName, BackupInstanceResourceInner parameters) { + return createOrUpdateAsync(resourceGroupName, vaultName, backupInstanceName, parameters).block(); } /** * Create or update a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @param context The context to associate with this operation. @@ -881,47 +974,47 @@ public BackupInstanceResourceInner createOrUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) public BackupInstanceResourceInner createOrUpdate( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, BackupInstanceResourceInner parameters, Context context) { - return createOrUpdateAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context).block(); + return createOrUpdateAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context).block(); } /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( - String vaultName, String resourceGroupName, String backupInstanceName) { + String resourceGroupName, String vaultName, String backupInstanceName) { 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -934,9 +1027,9 @@ private Mono>> deleteWithResponseAsync( .delete( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, accept, context)) @@ -946,37 +1039,37 @@ private Mono>> deleteWithResponseAsync( /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( - String vaultName, String resourceGroupName, String backupInstanceName, Context context) { + String resourceGroupName, String vaultName, String backupInstanceName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -987,9 +1080,9 @@ private Mono>> deleteWithResponseAsync( .delete( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, accept, context); @@ -998,42 +1091,43 @@ private Mono>> deleteWithResponseAsync( /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( - String vaultName, String resourceGroupName, String backupInstanceName) { + String resourceGroupName, String vaultName, String backupInstanceName) { Mono>> mono = - deleteWithResponseAsync(vaultName, resourceGroupName, backupInstanceName); + deleteWithResponseAsync(resourceGroupName, vaultName, backupInstanceName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( - String vaultName, String resourceGroupName, String backupInstanceName, Context context) { + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { context = this.client.mergeContext(context); Mono>> mono = - deleteWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, context); + deleteWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, context); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); @@ -1042,52 +1136,52 @@ private PollerFlux, Void> beginDeleteAsync( /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( - String vaultName, String resourceGroupName, String backupInstanceName) { - return beginDeleteAsync(vaultName, resourceGroupName, backupInstanceName).getSyncPoller(); + String resourceGroupName, String vaultName, String backupInstanceName) { + return beginDeleteAsync(resourceGroupName, vaultName, backupInstanceName).getSyncPoller(); } /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( - String vaultName, String resourceGroupName, String backupInstanceName, Context context) { - return beginDeleteAsync(vaultName, resourceGroupName, backupInstanceName, context).getSyncPoller(); + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, vaultName, backupInstanceName, context).getSyncPoller(); } /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String vaultName, String resourceGroupName, String backupInstanceName) { - return beginDeleteAsync(vaultName, resourceGroupName, backupInstanceName) + private Mono deleteAsync(String resourceGroupName, String vaultName, String backupInstanceName) { + return beginDeleteAsync(resourceGroupName, vaultName, backupInstanceName) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1095,19 +1189,19 @@ private Mono deleteAsync(String vaultName, String resourceGroupName, Strin /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( - String vaultName, String resourceGroupName, String backupInstanceName, Context context) { - return beginDeleteAsync(vaultName, resourceGroupName, backupInstanceName, context) + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, vaultName, backupInstanceName, context) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1115,23 +1209,23 @@ private Mono deleteAsync( /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 backupInstanceName) { - deleteAsync(vaultName, resourceGroupName, backupInstanceName).block(); + public void delete(String resourceGroupName, String vaultName, String backupInstanceName) { + deleteAsync(resourceGroupName, vaultName, backupInstanceName).block(); } /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1139,44 +1233,44 @@ public void delete(String vaultName, String resourceGroupName, String backupInst * @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 backupInstanceName, Context context) { - deleteAsync(vaultName, resourceGroupName, backupInstanceName, context).block(); + public void delete(String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + deleteAsync(resourceGroupName, vaultName, backupInstanceName, context).block(); } /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> adhocBackupWithResponseAsync( - String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters) { + String resourceGroupName, String vaultName, String backupInstanceName, TriggerBackupRequest 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -1194,9 +1288,9 @@ private Mono>> adhocBackupWithResponseAsync( .adhocBackup( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, parameters, accept, @@ -1207,20 +1301,20 @@ private Mono>> adhocBackupWithResponseAsync( /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> adhocBackupWithResponseAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, TriggerBackupRequest parameters, Context context) { @@ -1230,19 +1324,19 @@ private Mono>> adhocBackupWithResponseAsync( 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -1258,9 +1352,9 @@ private Mono>> adhocBackupWithResponseAsync( .adhocBackup( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, parameters, accept, @@ -1270,20 +1364,20 @@ private Mono>> adhocBackupWithResponseAsync( /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link PollerFlux} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationJobExtendedInfoInner> beginAdhocBackupAsync( - String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters) { + String resourceGroupName, String vaultName, String backupInstanceName, TriggerBackupRequest parameters) { Mono>> mono = - adhocBackupWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters); + adhocBackupWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters); return this .client .getLroResult( @@ -1291,32 +1385,32 @@ private PollerFlux, OperationJobExtend this.client.getHttpPipeline(), OperationJobExtendedInfoInner.class, OperationJobExtendedInfoInner.class, - Context.NONE); + this.client.getContext()); } /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link PollerFlux} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationJobExtendedInfoInner> beginAdhocBackupAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, TriggerBackupRequest parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono = - adhocBackupWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context); + adhocBackupWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context); return this .client .getLroResult( @@ -1330,61 +1424,61 @@ private PollerFlux, OperationJobExtend /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationJobExtendedInfoInner> beginAdhocBackup( - String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters) { - return beginAdhocBackupAsync(vaultName, resourceGroupName, backupInstanceName, parameters).getSyncPoller(); + String resourceGroupName, String vaultName, String backupInstanceName, TriggerBackupRequest parameters) { + return beginAdhocBackupAsync(resourceGroupName, vaultName, backupInstanceName, parameters).getSyncPoller(); } /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationJobExtendedInfoInner> beginAdhocBackup( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, TriggerBackupRequest parameters, Context context) { - return beginAdhocBackupAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context) + return beginAdhocBackupAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context) .getSyncPoller(); } /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono adhocBackupAsync( - String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters) { - return beginAdhocBackupAsync(vaultName, resourceGroupName, backupInstanceName, parameters) + String resourceGroupName, String vaultName, String backupInstanceName, TriggerBackupRequest parameters) { + return beginAdhocBackupAsync(resourceGroupName, vaultName, backupInstanceName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1392,24 +1486,24 @@ private Mono adhocBackupAsync( /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono adhocBackupAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, TriggerBackupRequest parameters, Context context) { - return beginAdhocBackupAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context) + return beginAdhocBackupAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1417,8 +1511,8 @@ private Mono adhocBackupAsync( /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1428,15 +1522,15 @@ private Mono adhocBackupAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public OperationJobExtendedInfoInner adhocBackup( - String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters) { - return adhocBackupAsync(vaultName, resourceGroupName, backupInstanceName, parameters).block(); + String resourceGroupName, String vaultName, String backupInstanceName, TriggerBackupRequest parameters) { + return adhocBackupAsync(resourceGroupName, vaultName, backupInstanceName, parameters).block(); } /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @param context The context to associate with this operation. @@ -1447,47 +1541,47 @@ public OperationJobExtendedInfoInner adhocBackup( */ @ServiceMethod(returns = ReturnType.SINGLE) public OperationJobExtendedInfoInner adhocBackup( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, TriggerBackupRequest parameters, Context context) { - return adhocBackupAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context).block(); + return adhocBackupAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context).block(); } /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> validateForBackupWithResponseAsync( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters) { + String resourceGroupName, String vaultName, ValidateForBackupRequest 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { @@ -1501,9 +1595,9 @@ private Mono>> validateForBackupWithResponseAsync( .validateForBackup( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, parameters, accept, context)) @@ -1513,37 +1607,37 @@ private Mono>> validateForBackupWithResponseAsync( /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> validateForBackupWithResponseAsync( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context) { + String resourceGroupName, String vaultName, ValidateForBackupRequest 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { @@ -1555,9 +1649,9 @@ private Mono>> validateForBackupWithResponseAsync( .validateForBackup( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, parameters, accept, context); @@ -1566,19 +1660,19 @@ private Mono>> validateForBackupWithResponseAsync( /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 operationJobExtendedInfo. + * @return the {@link PollerFlux} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationJobExtendedInfoInner> - beginValidateForBackupAsync(String vaultName, String resourceGroupName, ValidateForBackupRequest parameters) { + beginValidateForBackupAsync(String resourceGroupName, String vaultName, ValidateForBackupRequest parameters) { Mono>> mono = - validateForBackupWithResponseAsync(vaultName, resourceGroupName, parameters); + validateForBackupWithResponseAsync(resourceGroupName, vaultName, parameters); return this .client .getLroResult( @@ -1586,28 +1680,28 @@ private Mono>> validateForBackupWithResponseAsync( this.client.getHttpPipeline(), OperationJobExtendedInfoInner.class, OperationJobExtendedInfoInner.class, - Context.NONE); + this.client.getContext()); } /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 operationJobExtendedInfo. + * @return the {@link PollerFlux} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationJobExtendedInfoInner> beginValidateForBackupAsync( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context) { + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono = - validateForBackupWithResponseAsync(vaultName, resourceGroupName, parameters, context); + validateForBackupWithResponseAsync(resourceGroupName, vaultName, parameters, context); return this .client .getLroResult( @@ -1621,53 +1715,53 @@ private Mono>> validateForBackupWithResponseAsync( /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationJobExtendedInfoInner> beginValidateForBackup( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters) { - return beginValidateForBackupAsync(vaultName, resourceGroupName, parameters).getSyncPoller(); + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters) { + return beginValidateForBackupAsync(resourceGroupName, vaultName, parameters).getSyncPoller(); } /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationJobExtendedInfoInner> beginValidateForBackup( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context) { - return beginValidateForBackupAsync(vaultName, resourceGroupName, parameters, context).getSyncPoller(); + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters, Context context) { + return beginValidateForBackupAsync(resourceGroupName, vaultName, parameters, context).getSyncPoller(); } /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono validateForBackupAsync( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters) { - return beginValidateForBackupAsync(vaultName, resourceGroupName, parameters) + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters) { + return beginValidateForBackupAsync(resourceGroupName, vaultName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1675,19 +1769,19 @@ private Mono validateForBackupAsync( /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono validateForBackupAsync( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context) { - return beginValidateForBackupAsync(vaultName, resourceGroupName, parameters, context) + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters, Context context) { + return beginValidateForBackupAsync(resourceGroupName, vaultName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1695,8 +1789,8 @@ private Mono validateForBackupAsync( /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param parameters Request body for operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1705,15 +1799,15 @@ private Mono validateForBackupAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public OperationJobExtendedInfoInner validateForBackup( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters) { - return validateForBackupAsync(vaultName, resourceGroupName, parameters).block(); + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters) { + return validateForBackupAsync(resourceGroupName, vaultName, parameters).block(); } /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param parameters Request body for operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1723,44 +1817,42 @@ public OperationJobExtendedInfoInner validateForBackup( */ @ServiceMethod(returns = ReturnType.SINGLE) public OperationJobExtendedInfoInner validateForBackup( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context) { - return validateForBackupAsync(vaultName, resourceGroupName, parameters, context).block(); + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters, Context context) { + return validateForBackupAsync(resourceGroupName, vaultName, parameters, context).block(); } /** - * rehydrate recovery point for restore for a BackupInstance. + * Get result of backup instance creation operation. * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. * @param backupInstanceName The backupInstanceName parameter. - * @param parameters Request body for operation. + * @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. + * @return result of backup instance creation operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> triggerRehydrateWithResponseAsync( - String resourceGroupName, - String vaultName, - String backupInstanceName, - AzureBackupRehydrationRequest parameters) { + private Mono> getBackupInstanceOperationResultWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName, String operationId) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } if (vaultName == null) { return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } @@ -1768,10 +1860,191 @@ private Mono>> triggerRehydrateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter backupInstanceName 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(); + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getBackupInstanceOperationResult( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get result of backup instance creation operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @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 result of backup instance creation operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBackupInstanceOperationResultWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName, 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 (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getBackupInstanceOperationResult( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + operationId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get result of backup instance creation operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @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 result of backup instance creation operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getBackupInstanceOperationResultAsync( + String resourceGroupName, String vaultName, String backupInstanceName, String operationId) { + return getBackupInstanceOperationResultWithResponseAsync( + resourceGroupName, vaultName, backupInstanceName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get result of backup instance creation operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @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 result of backup instance creation operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBackupInstanceOperationResultWithResponse( + String resourceGroupName, String vaultName, String backupInstanceName, String operationId, Context context) { + return getBackupInstanceOperationResultWithResponseAsync( + resourceGroupName, vaultName, backupInstanceName, operationId, context) + .block(); + } + + /** + * Get result of backup instance creation operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @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 result of backup instance creation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupInstanceResourceInner getBackupInstanceOperationResult( + String resourceGroupName, String vaultName, String backupInstanceName, String operationId) { + return getBackupInstanceOperationResultWithResponse( + resourceGroupName, vaultName, backupInstanceName, operationId, Context.NONE) + .getValue(); + } + + /** + * rehydrate recovery point for restore for a BackupInstance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerRehydrateWithResponseAsync( + String resourceGroupName, + String vaultName, + String backupInstanceName, + AzureBackupRehydrationRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName 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 @@ -1802,7 +2075,7 @@ private Mono>> triggerRehydrateWithResponseAsync( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> triggerRehydrateWithResponseAsync( @@ -1864,7 +2137,7 @@ private Mono>> triggerRehydrateWithResponseAsync( * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTriggerRehydrateAsync( @@ -1876,7 +2149,8 @@ private PollerFlux, Void> beginTriggerRehydrateAsync( triggerRehydrateWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1890,7 +2164,7 @@ private PollerFlux, Void> beginTriggerRehydrateAsync( * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTriggerRehydrateAsync( @@ -1917,7 +2191,7 @@ private PollerFlux, Void> beginTriggerRehydrateAsync( * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTriggerRehydrate( @@ -1939,7 +2213,7 @@ public SyncPoller, Void> beginTriggerRehydrate( * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTriggerRehydrate( @@ -1962,7 +2236,7 @@ public SyncPoller, Void> beginTriggerRehydrate( * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono triggerRehydrateAsync( @@ -1986,7 +2260,7 @@ private Mono triggerRehydrateAsync( * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono triggerRehydrateAsync( @@ -2045,37 +2319,37 @@ public void triggerRehydrate( /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> triggerRestoreWithResponseAsync( - String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters) { + String resourceGroupName, String vaultName, String backupInstanceName, AzureBackupRestoreRequest 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -2093,9 +2367,9 @@ private Mono>> triggerRestoreWithResponseAsync( .triggerRestore( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, parameters, accept, @@ -2106,20 +2380,20 @@ private Mono>> triggerRestoreWithResponseAsync( /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> triggerRestoreWithResponseAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters, Context context) { @@ -2129,19 +2403,19 @@ private Mono>> triggerRestoreWithResponseAsync( 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -2157,9 +2431,9 @@ private Mono>> triggerRestoreWithResponseAsync( .triggerRestore( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, parameters, accept, @@ -2169,24 +2443,24 @@ private Mono>> triggerRestoreWithResponseAsync( /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link PollerFlux} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationJobExtendedInfoInner> beginTriggerRestoreAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters) { Mono>> mono = - triggerRestoreWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters); + triggerRestoreWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters); return this .client .getLroResult( @@ -2194,33 +2468,33 @@ private Mono>> triggerRestoreWithResponseAsync( this.client.getHttpPipeline(), OperationJobExtendedInfoInner.class, OperationJobExtendedInfoInner.class, - Context.NONE); + this.client.getContext()); } /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link PollerFlux} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationJobExtendedInfoInner> beginTriggerRestoreAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono = - triggerRestoreWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context); + triggerRestoreWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context); return this .client .getLroResult( @@ -2234,61 +2508,61 @@ private Mono>> triggerRestoreWithResponseAsync( /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationJobExtendedInfoInner> beginTriggerRestore( - String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters) { - return beginTriggerRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters).getSyncPoller(); + String resourceGroupName, String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters) { + return beginTriggerRestoreAsync(resourceGroupName, vaultName, backupInstanceName, parameters).getSyncPoller(); } /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationJobExtendedInfoInner> beginTriggerRestore( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters, Context context) { - return beginTriggerRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context) + return beginTriggerRestoreAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context) .getSyncPoller(); } /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono triggerRestoreAsync( - String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters) { - return beginTriggerRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters) + String resourceGroupName, String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters) { + return beginTriggerRestoreAsync(resourceGroupName, vaultName, backupInstanceName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -2296,24 +2570,24 @@ private Mono triggerRestoreAsync( /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono triggerRestoreAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters, Context context) { - return beginTriggerRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context) + return beginTriggerRestoreAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -2321,8 +2595,8 @@ private Mono triggerRestoreAsync( /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2332,15 +2606,15 @@ private Mono triggerRestoreAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public OperationJobExtendedInfoInner triggerRestore( - String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters) { - return triggerRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters).block(); + String resourceGroupName, String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters) { + return triggerRestoreAsync(resourceGroupName, vaultName, backupInstanceName, parameters).block(); } /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @param context The context to associate with this operation. @@ -2351,71 +2625,1414 @@ public OperationJobExtendedInfoInner triggerRestore( */ @ServiceMethod(returns = ReturnType.SINGLE) public OperationJobExtendedInfoInner triggerRestore( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters, Context context) { - return triggerRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context).block(); + return triggerRestoreAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context).block(); } /** - * Validates if Restore can be triggered for a DataSource. + * This operation will resume backups for backup instance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. - * @param backupInstanceName The name of the backup instance. - * @param parameters Request body for operation. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 operationJobExtendedInfo. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateForRestoreWithResponseAsync( - String vaultName, - String resourceGroupName, - String backupInstanceName, - ValidateRestoreRequestObject parameters) { + private Mono>> resumeBackupsWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName) { 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName 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 - .validateForRestore( + .resumeBackups( this.client.getEndpoint(), - this.client.getApiVersion(), - vaultName, + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This operation will resume backups for backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeBackupsWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resumeBackups( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * This operation will resume backups for backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResumeBackupsAsync( + String resourceGroupName, String vaultName, String backupInstanceName) { + Mono>> mono = + resumeBackupsWithResponseAsync(resourceGroupName, vaultName, backupInstanceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * This operation will resume backups for backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResumeBackupsAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resumeBackupsWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * This operation will resume backups for backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResumeBackups( + String resourceGroupName, String vaultName, String backupInstanceName) { + return beginResumeBackupsAsync(resourceGroupName, vaultName, backupInstanceName).getSyncPoller(); + } + + /** + * This operation will resume backups for backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResumeBackups( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + return beginResumeBackupsAsync(resourceGroupName, vaultName, backupInstanceName, context).getSyncPoller(); + } + + /** + * This operation will resume backups for backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeBackupsAsync(String resourceGroupName, String vaultName, String backupInstanceName) { + return beginResumeBackupsAsync(resourceGroupName, vaultName, backupInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation will resume backups for backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeBackupsAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + return beginResumeBackupsAsync(resourceGroupName, vaultName, backupInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation will resume backups for backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 resumeBackups(String resourceGroupName, String vaultName, String backupInstanceName) { + resumeBackupsAsync(resourceGroupName, vaultName, backupInstanceName).block(); + } + + /** + * This operation will resume backups for backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resumeBackups(String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + resumeBackupsAsync(resourceGroupName, vaultName, backupInstanceName, context).block(); + } + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeProtectionWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resumeProtection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeProtectionWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resumeProtection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResumeProtectionAsync( + String resourceGroupName, String vaultName, String backupInstanceName) { + Mono>> mono = + resumeProtectionWithResponseAsync(resourceGroupName, vaultName, backupInstanceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResumeProtectionAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resumeProtectionWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResumeProtection( + String resourceGroupName, String vaultName, String backupInstanceName) { + return beginResumeProtectionAsync(resourceGroupName, vaultName, backupInstanceName).getSyncPoller(); + } + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResumeProtection( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + return beginResumeProtectionAsync(resourceGroupName, vaultName, backupInstanceName, context).getSyncPoller(); + } + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeProtectionAsync(String resourceGroupName, String vaultName, String backupInstanceName) { + return beginResumeProtectionAsync(resourceGroupName, vaultName, backupInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeProtectionAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + return beginResumeProtectionAsync(resourceGroupName, vaultName, backupInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 resumeProtection(String resourceGroupName, String vaultName, String backupInstanceName) { + resumeProtectionAsync(resourceGroupName, vaultName, backupInstanceName).block(); + } + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resumeProtection( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + resumeProtectionAsync(resourceGroupName, vaultName, backupInstanceName, context).block(); + } + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopProtectionWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stopProtection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopProtectionWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopProtection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopProtectionAsync( + String resourceGroupName, String vaultName, String backupInstanceName) { + Mono>> mono = + stopProtectionWithResponseAsync(resourceGroupName, vaultName, backupInstanceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopProtectionAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopProtectionWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStopProtection( + String resourceGroupName, String vaultName, String backupInstanceName) { + return beginStopProtectionAsync(resourceGroupName, vaultName, backupInstanceName).getSyncPoller(); + } + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStopProtection( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + return beginStopProtectionAsync(resourceGroupName, vaultName, backupInstanceName, context).getSyncPoller(); + } + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopProtectionAsync(String resourceGroupName, String vaultName, String backupInstanceName) { + return beginStopProtectionAsync(resourceGroupName, vaultName, backupInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopProtectionAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + return beginStopProtectionAsync(resourceGroupName, vaultName, backupInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 stopProtection(String resourceGroupName, String vaultName, String backupInstanceName) { + stopProtectionAsync(resourceGroupName, vaultName, backupInstanceName).block(); + } + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stopProtection(String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + stopProtectionAsync(resourceGroupName, vaultName, backupInstanceName, context).block(); + } + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> suspendBackupsWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .suspendBackups( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> suspendBackupsWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .suspendBackups( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginSuspendBackupsAsync( + String resourceGroupName, String vaultName, String backupInstanceName) { + Mono>> mono = + suspendBackupsWithResponseAsync(resourceGroupName, vaultName, backupInstanceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginSuspendBackupsAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + suspendBackupsWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSuspendBackups( + String resourceGroupName, String vaultName, String backupInstanceName) { + return beginSuspendBackupsAsync(resourceGroupName, vaultName, backupInstanceName).getSyncPoller(); + } + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSuspendBackups( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + return beginSuspendBackupsAsync(resourceGroupName, vaultName, backupInstanceName, context).getSyncPoller(); + } + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono suspendBackupsAsync(String resourceGroupName, String vaultName, String backupInstanceName) { + return beginSuspendBackupsAsync(resourceGroupName, vaultName, backupInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono suspendBackupsAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + return beginSuspendBackupsAsync(resourceGroupName, vaultName, backupInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 suspendBackups(String resourceGroupName, String vaultName, String backupInstanceName) { + suspendBackupsAsync(resourceGroupName, vaultName, backupInstanceName).block(); + } + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void suspendBackups(String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + suspendBackupsAsync(resourceGroupName, vaultName, backupInstanceName, context).block(); + } + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> syncBackupInstanceWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName, SyncBackupInstanceRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName 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 + .syncBackupInstance( + this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, + vaultName, + backupInstanceName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> syncBackupInstanceWithResponseAsync( + String resourceGroupName, + String vaultName, + String backupInstanceName, + SyncBackupInstanceRequest parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName 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 + .syncBackupInstance( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginSyncBackupInstanceAsync( + String resourceGroupName, String vaultName, String backupInstanceName, SyncBackupInstanceRequest parameters) { + Mono>> mono = + syncBackupInstanceWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginSyncBackupInstanceAsync( + String resourceGroupName, + String vaultName, + String backupInstanceName, + SyncBackupInstanceRequest parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + syncBackupInstanceWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSyncBackupInstance( + String resourceGroupName, String vaultName, String backupInstanceName, SyncBackupInstanceRequest parameters) { + return beginSyncBackupInstanceAsync(resourceGroupName, vaultName, backupInstanceName, parameters) + .getSyncPoller(); + } + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSyncBackupInstance( + String resourceGroupName, + String vaultName, + String backupInstanceName, + SyncBackupInstanceRequest parameters, + Context context) { + return beginSyncBackupInstanceAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context) + .getSyncPoller(); + } + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono syncBackupInstanceAsync( + String resourceGroupName, String vaultName, String backupInstanceName, SyncBackupInstanceRequest parameters) { + return beginSyncBackupInstanceAsync(resourceGroupName, vaultName, backupInstanceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono syncBackupInstanceAsync( + String resourceGroupName, + String vaultName, + String backupInstanceName, + SyncBackupInstanceRequest parameters, + Context context) { + return beginSyncBackupInstanceAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void syncBackupInstance( + String resourceGroupName, String vaultName, String backupInstanceName, SyncBackupInstanceRequest parameters) { + syncBackupInstanceAsync(resourceGroupName, vaultName, backupInstanceName, parameters).block(); + } + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void syncBackupInstance( + String resourceGroupName, + String vaultName, + String backupInstanceName, + SyncBackupInstanceRequest parameters, + Context context) { + syncBackupInstanceAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context).block(); + } + + /** + * Validates if Restore can be triggered for a DataSource. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the backup instance. + * @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 operationJobExtendedInfo along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateForRestoreWithResponseAsync( + String resourceGroupName, + String vaultName, + String backupInstanceName, + ValidateRestoreRequestObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName 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 + .validateForRestore( + this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, parameters, accept, @@ -2426,20 +4043,20 @@ private Mono>> validateForRestoreWithResponseAsync( /** * Validates if Restore can be triggered for a DataSource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> validateForRestoreWithResponseAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters, Context context) { @@ -2449,19 +4066,19 @@ private Mono>> validateForRestoreWithResponseAsync( 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -2477,9 +4094,9 @@ private Mono>> validateForRestoreWithResponseAsync( .validateForRestore( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, parameters, accept, @@ -2489,24 +4106,24 @@ private Mono>> validateForRestoreWithResponseAsync( /** * Validates if Restore can be triggered for a DataSource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link PollerFlux} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationJobExtendedInfoInner> beginValidateForRestoreAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters) { Mono>> mono = - validateForRestoreWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters); + validateForRestoreWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters); return this .client .getLroResult( @@ -2514,33 +4131,33 @@ private Mono>> validateForRestoreWithResponseAsync( this.client.getHttpPipeline(), OperationJobExtendedInfoInner.class, OperationJobExtendedInfoInner.class, - Context.NONE); + this.client.getContext()); } /** * Validates if Restore can be triggered for a DataSource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link PollerFlux} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationJobExtendedInfoInner> beginValidateForRestoreAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono = - validateForRestoreWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context); + validateForRestoreWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context); return this .client .getLroResult( @@ -2554,68 +4171,68 @@ private Mono>> validateForRestoreWithResponseAsync( /** * Validates if Restore can be triggered for a DataSource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationJobExtendedInfoInner> beginValidateForRestore( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters) { - return beginValidateForRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters) + return beginValidateForRestoreAsync(resourceGroupName, vaultName, backupInstanceName, parameters) .getSyncPoller(); } /** * Validates if Restore can be triggered for a DataSource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return the {@link SyncPoller} for polling of operationJobExtendedInfo. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationJobExtendedInfoInner> beginValidateForRestore( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters, Context context) { - return beginValidateForRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context) + return beginValidateForRestoreAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context) .getSyncPoller(); } /** * Validates if Restore can be triggered for a DataSource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono validateForRestoreAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters) { - return beginValidateForRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters) + return beginValidateForRestoreAsync(resourceGroupName, vaultName, backupInstanceName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -2623,24 +4240,24 @@ private Mono validateForRestoreAsync( /** * Validates if Restore can be triggered for a DataSource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 operationJobExtendedInfo. + * @return operationJobExtendedInfo on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono validateForRestoreAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters, Context context) { - return beginValidateForRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context) + return beginValidateForRestoreAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -2648,8 +4265,8 @@ private Mono validateForRestoreAsync( /** * Validates if Restore can be triggered for a DataSource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2659,18 +4276,18 @@ private Mono validateForRestoreAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public OperationJobExtendedInfoInner validateForRestore( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters) { - return validateForRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters).block(); + return validateForRestoreAsync(resourceGroupName, vaultName, backupInstanceName, parameters).block(); } /** * Validates if Restore can be triggered for a DataSource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @param context The context to associate with this operation. @@ -2681,22 +4298,23 @@ public OperationJobExtendedInfoInner validateForRestore( */ @ServiceMethod(returns = ReturnType.SINGLE) public OperationJobExtendedInfoInner validateForRestore( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters, Context context) { - return validateForRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context).block(); + return validateForRestoreAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context).block(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 backupInstanceResourceList. + * @return backupInstanceResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2719,7 +4337,7 @@ private Mono> listNextSinglePageAsync res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2727,12 +4345,13 @@ private Mono> listNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 backupInstanceResourceList. + * @return backupInstanceResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -2756,7 +4375,7 @@ private Mono> listNextSinglePageAsync res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesExtensionRoutingsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesExtensionRoutingsClientImpl.java new file mode 100644 index 000000000000..807d3ca1026d --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesExtensionRoutingsClientImpl.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.dataprotection.fluent.BackupInstancesExtensionRoutingsClient; +import com.azure.resourcemanager.dataprotection.fluent.models.BackupInstanceResourceInner; +import com.azure.resourcemanager.dataprotection.models.BackupInstanceResourceList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BackupInstancesExtensionRoutingsClient. + */ +public final class BackupInstancesExtensionRoutingsClientImpl implements BackupInstancesExtensionRoutingsClient { + /** The proxy service used to perform REST calls. */ + private final BackupInstancesExtensionRoutingsService service; + + /** The service client containing this operation class. */ + private final DataProtectionClientImpl client; + + /** + * Initializes an instance of BackupInstancesExtensionRoutingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupInstancesExtensionRoutingsClientImpl(DataProtectionClientImpl client) { + this.service = + RestProxy + .create( + BackupInstancesExtensionRoutingsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataProtectionClientBackupInstancesExtensionRoutings to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataProtectionClient") + public interface BackupInstancesExtensionRoutingsService { + @Headers({"Content-Type: application/json"}) + @Get("/{resourceId}/providers/Microsoft.DataProtection/backupInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceId") String resourceId, + @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 a list backup instances associated with a tracked resource. + * + * @param resourceId ARM path of the resource to be protected using Microsoft.DataProtection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list backup instances associated with a tracked resource along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceId, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink().toString(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list backup instances associated with a tracked resource. + * + * @param resourceId ARM path of the resource to be protected using Microsoft.DataProtection. + * @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 a list backup instances associated with a tracked resource along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), resourceId, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink().toString(), + null)); + } + + /** + * Gets a list backup instances associated with a tracked resource. + * + * @param resourceId ARM path of the resource to be protected using Microsoft.DataProtection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list backup instances associated with a tracked resource as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceId) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceId), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list backup instances associated with a tracked resource. + * + * @param resourceId ARM path of the resource to be protected using Microsoft.DataProtection. + * @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 a list backup instances associated with a tracked resource as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceId, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceId, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list backup instances associated with a tracked resource. + * + * @param resourceId ARM path of the resource to be protected using Microsoft.DataProtection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list backup instances associated with a tracked resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceId) { + return new PagedIterable<>(listAsync(resourceId)); + } + + /** + * Gets a list backup instances associated with a tracked resource. + * + * @param resourceId ARM path of the resource to be protected using Microsoft.DataProtection. + * @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 a list backup instances associated with a tracked resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceId, Context context) { + return new PagedIterable<>(listAsync(resourceId, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 backupInstanceResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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().toString(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 backupInstanceResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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().toString(), + null)); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesExtensionRoutingsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesExtensionRoutingsImpl.java new file mode 100644 index 000000000000..cafd38d8058a --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesExtensionRoutingsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.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.dataprotection.fluent.BackupInstancesExtensionRoutingsClient; +import com.azure.resourcemanager.dataprotection.fluent.models.BackupInstanceResourceInner; +import com.azure.resourcemanager.dataprotection.models.BackupInstanceResource; +import com.azure.resourcemanager.dataprotection.models.BackupInstancesExtensionRoutings; + +public final class BackupInstancesExtensionRoutingsImpl implements BackupInstancesExtensionRoutings { + private static final ClientLogger LOGGER = new ClientLogger(BackupInstancesExtensionRoutingsImpl.class); + + private final BackupInstancesExtensionRoutingsClient innerClient; + + private final com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager; + + public BackupInstancesExtensionRoutingsImpl( + BackupInstancesExtensionRoutingsClient innerClient, + com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceId) { + PagedIterable inner = this.serviceClient().list(resourceId); + return Utils.mapPage(inner, inner1 -> new BackupInstanceResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceId, Context context) { + PagedIterable inner = this.serviceClient().list(resourceId, context); + return Utils.mapPage(inner, inner1 -> new BackupInstanceResourceImpl(inner1, this.manager())); + } + + private BackupInstancesExtensionRoutingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dataprotection.DataProtectionManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesImpl.java index d4380187ee44..e57967c90d92 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesImpl.java @@ -17,13 +17,13 @@ import com.azure.resourcemanager.dataprotection.models.BackupInstanceResource; import com.azure.resourcemanager.dataprotection.models.BackupInstances; import com.azure.resourcemanager.dataprotection.models.OperationJobExtendedInfo; +import com.azure.resourcemanager.dataprotection.models.SyncBackupInstanceRequest; import com.azure.resourcemanager.dataprotection.models.TriggerBackupRequest; import com.azure.resourcemanager.dataprotection.models.ValidateForBackupRequest; import com.azure.resourcemanager.dataprotection.models.ValidateRestoreRequestObject; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class BackupInstancesImpl implements BackupInstances { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupInstancesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(BackupInstancesImpl.class); private final BackupInstancesClient innerClient; @@ -36,30 +36,21 @@ public BackupInstancesImpl( this.serviceManager = serviceManager; } - public PagedIterable list(String vaultName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); return Utils.mapPage(inner, inner1 -> new BackupInstanceResourceImpl(inner1, this.manager())); } - public PagedIterable list(String vaultName, String resourceGroupName, Context context) { + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { PagedIterable inner = - this.serviceClient().list(vaultName, resourceGroupName, context); + this.serviceClient().list(resourceGroupName, vaultName, context); return Utils.mapPage(inner, inner1 -> new BackupInstanceResourceImpl(inner1, this.manager())); } - public BackupInstanceResource get(String vaultName, String resourceGroupName, String backupInstanceName) { - BackupInstanceResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName, backupInstanceName); - if (inner != null) { - return new BackupInstanceResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( - String vaultName, String resourceGroupName, String backupInstanceName, Context context) { + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { Response inner = - this.serviceClient().getWithResponse(vaultName, resourceGroupName, backupInstanceName, context); + this.serviceClient().getWithResponse(resourceGroupName, vaultName, backupInstanceName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -71,18 +62,27 @@ public Response getWithResponse( } } - public void delete(String vaultName, String resourceGroupName, String backupInstanceName) { - this.serviceClient().delete(vaultName, resourceGroupName, backupInstanceName); + public BackupInstanceResource get(String resourceGroupName, String vaultName, String backupInstanceName) { + BackupInstanceResourceInner inner = this.serviceClient().get(resourceGroupName, vaultName, backupInstanceName); + if (inner != null) { + return new BackupInstanceResourceImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String vaultName, String resourceGroupName, String backupInstanceName, Context context) { - this.serviceClient().delete(vaultName, resourceGroupName, backupInstanceName, context); + public void delete(String resourceGroupName, String vaultName, String backupInstanceName) { + this.serviceClient().delete(resourceGroupName, vaultName, backupInstanceName); + } + + public void delete(String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + this.serviceClient().delete(resourceGroupName, vaultName, backupInstanceName, context); } public OperationJobExtendedInfo adhocBackup( - String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters) { + String resourceGroupName, String vaultName, String backupInstanceName, TriggerBackupRequest parameters) { OperationJobExtendedInfoInner inner = - this.serviceClient().adhocBackup(vaultName, resourceGroupName, backupInstanceName, parameters); + this.serviceClient().adhocBackup(resourceGroupName, vaultName, backupInstanceName, parameters); if (inner != null) { return new OperationJobExtendedInfoImpl(inner, this.manager()); } else { @@ -91,13 +91,13 @@ public OperationJobExtendedInfo adhocBackup( } public OperationJobExtendedInfo adhocBackup( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, TriggerBackupRequest parameters, Context context) { OperationJobExtendedInfoInner inner = - this.serviceClient().adhocBackup(vaultName, resourceGroupName, backupInstanceName, parameters, context); + this.serviceClient().adhocBackup(resourceGroupName, vaultName, backupInstanceName, parameters, context); if (inner != null) { return new OperationJobExtendedInfoImpl(inner, this.manager()); } else { @@ -106,9 +106,9 @@ public OperationJobExtendedInfo adhocBackup( } public OperationJobExtendedInfo validateForBackup( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters) { + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters) { OperationJobExtendedInfoInner inner = - this.serviceClient().validateForBackup(vaultName, resourceGroupName, parameters); + this.serviceClient().validateForBackup(resourceGroupName, vaultName, parameters); if (inner != null) { return new OperationJobExtendedInfoImpl(inner, this.manager()); } else { @@ -117,9 +117,9 @@ public OperationJobExtendedInfo validateForBackup( } public OperationJobExtendedInfo validateForBackup( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context) { + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters, Context context) { OperationJobExtendedInfoInner inner = - this.serviceClient().validateForBackup(vaultName, resourceGroupName, parameters, context); + this.serviceClient().validateForBackup(resourceGroupName, vaultName, parameters, context); if (inner != null) { return new OperationJobExtendedInfoImpl(inner, this.manager()); } else { @@ -127,6 +127,37 @@ public OperationJobExtendedInfo validateForBackup( } } + public Response getBackupInstanceOperationResultWithResponse( + String resourceGroupName, String vaultName, String backupInstanceName, String operationId, Context context) { + Response inner = + this + .serviceClient() + .getBackupInstanceOperationResultWithResponse( + resourceGroupName, vaultName, backupInstanceName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackupInstanceResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BackupInstanceResource getBackupInstanceOperationResult( + String resourceGroupName, String vaultName, String backupInstanceName, String operationId) { + BackupInstanceResourceInner inner = + this + .serviceClient() + .getBackupInstanceOperationResult(resourceGroupName, vaultName, backupInstanceName, operationId); + if (inner != null) { + return new BackupInstanceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + public void triggerRehydrate( String resourceGroupName, String vaultName, @@ -145,9 +176,9 @@ public void triggerRehydrate( } public OperationJobExtendedInfo triggerRestore( - String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters) { + String resourceGroupName, String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters) { OperationJobExtendedInfoInner inner = - this.serviceClient().triggerRestore(vaultName, resourceGroupName, backupInstanceName, parameters); + this.serviceClient().triggerRestore(resourceGroupName, vaultName, backupInstanceName, parameters); if (inner != null) { return new OperationJobExtendedInfoImpl(inner, this.manager()); } else { @@ -156,13 +187,13 @@ public OperationJobExtendedInfo triggerRestore( } public OperationJobExtendedInfo triggerRestore( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters, Context context) { OperationJobExtendedInfoInner inner = - this.serviceClient().triggerRestore(vaultName, resourceGroupName, backupInstanceName, parameters, context); + this.serviceClient().triggerRestore(resourceGroupName, vaultName, backupInstanceName, parameters, context); if (inner != null) { return new OperationJobExtendedInfoImpl(inner, this.manager()); } else { @@ -170,13 +201,60 @@ public OperationJobExtendedInfo triggerRestore( } } - public OperationJobExtendedInfo validateForRestore( + public void resumeBackups(String resourceGroupName, String vaultName, String backupInstanceName) { + this.serviceClient().resumeBackups(resourceGroupName, vaultName, backupInstanceName); + } + + public void resumeBackups(String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + this.serviceClient().resumeBackups(resourceGroupName, vaultName, backupInstanceName, context); + } + + public void resumeProtection(String resourceGroupName, String vaultName, String backupInstanceName) { + this.serviceClient().resumeProtection(resourceGroupName, vaultName, backupInstanceName); + } + + public void resumeProtection( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + this.serviceClient().resumeProtection(resourceGroupName, vaultName, backupInstanceName, context); + } + + public void stopProtection(String resourceGroupName, String vaultName, String backupInstanceName) { + this.serviceClient().stopProtection(resourceGroupName, vaultName, backupInstanceName); + } + + public void stopProtection(String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + this.serviceClient().stopProtection(resourceGroupName, vaultName, backupInstanceName, context); + } + + public void suspendBackups(String resourceGroupName, String vaultName, String backupInstanceName) { + this.serviceClient().suspendBackups(resourceGroupName, vaultName, backupInstanceName); + } + + public void suspendBackups(String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + this.serviceClient().suspendBackups(resourceGroupName, vaultName, backupInstanceName, context); + } + + public void syncBackupInstance( + String resourceGroupName, String vaultName, String backupInstanceName, SyncBackupInstanceRequest parameters) { + this.serviceClient().syncBackupInstance(resourceGroupName, vaultName, backupInstanceName, parameters); + } + + public void syncBackupInstance( + String resourceGroupName, String vaultName, + String backupInstanceName, + SyncBackupInstanceRequest parameters, + Context context) { + this.serviceClient().syncBackupInstance(resourceGroupName, vaultName, backupInstanceName, parameters, context); + } + + public OperationJobExtendedInfo validateForRestore( String resourceGroupName, + String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters) { OperationJobExtendedInfoInner inner = - this.serviceClient().validateForRestore(vaultName, resourceGroupName, backupInstanceName, parameters); + this.serviceClient().validateForRestore(resourceGroupName, vaultName, backupInstanceName, parameters); if (inner != null) { return new OperationJobExtendedInfoImpl(inner, this.manager()); } else { @@ -185,15 +263,15 @@ public OperationJobExtendedInfo validateForRestore( } public OperationJobExtendedInfo validateForRestore( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters, Context context) { OperationJobExtendedInfoInner inner = this .serviceClient() - .validateForRestore(vaultName, resourceGroupName, backupInstanceName, parameters, context); + .validateForRestore(resourceGroupName, vaultName, backupInstanceName, parameters, context); if (inner != null) { return new OperationJobExtendedInfoImpl(inner, this.manager()); } else { @@ -202,111 +280,111 @@ public OperationJobExtendedInfo validateForRestore( } public BackupInstanceResource getById(String id) { - String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); - if (vaultName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); - } String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } + String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); + } String backupInstanceName = Utils.getValueFromIdByName(id, "backupInstances"); if (backupInstanceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'backupInstances'.", id))); } - return this.getWithResponse(vaultName, resourceGroupName, backupInstanceName, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, vaultName, backupInstanceName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); - if (vaultName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); - } String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } + String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); + } String backupInstanceName = Utils.getValueFromIdByName(id, "backupInstances"); if (backupInstanceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'backupInstances'.", id))); } - return this.getWithResponse(vaultName, resourceGroupName, backupInstanceName, context); + return this.getWithResponse(resourceGroupName, vaultName, backupInstanceName, context); } public void deleteById(String id) { - String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); - if (vaultName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); - } String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } + String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); + } String backupInstanceName = Utils.getValueFromIdByName(id, "backupInstances"); if (backupInstanceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'backupInstances'.", id))); } - this.delete(vaultName, resourceGroupName, backupInstanceName, Context.NONE); + this.delete(resourceGroupName, vaultName, backupInstanceName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); - if (vaultName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); - } String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } + String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); + } String backupInstanceName = Utils.getValueFromIdByName(id, "backupInstances"); if (backupInstanceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'backupInstances'.", id))); } - this.delete(vaultName, resourceGroupName, backupInstanceName, context); + this.delete(resourceGroupName, vaultName, backupInstanceName, context); } private BackupInstancesClient serviceClient() { diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupPoliciesClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupPoliciesClientImpl.java index 745ec656b5f5..13d3836ef9ca 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupPoliciesClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupPoliciesClientImpl.java @@ -28,7 +28,6 @@ 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.dataprotection.fluent.BackupPoliciesClient; import com.azure.resourcemanager.dataprotection.fluent.models.BaseBackupPolicyResourceInner; import com.azure.resourcemanager.dataprotection.models.BaseBackupPolicyResourceList; @@ -36,8 +35,6 @@ /** An instance of this class provides access to all the operations defined in BackupPoliciesClient. */ public final class BackupPoliciesClientImpl implements BackupPoliciesClient { - private final ClientLogger logger = new ClientLogger(BackupPoliciesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final BackupPoliciesService service; @@ -61,7 +58,7 @@ public final class BackupPoliciesClientImpl implements BackupPoliciesClient { */ @Host("{$host}") @ServiceInterface(name = "DataProtectionClient") - private interface BackupPoliciesService { + public interface BackupPoliciesService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" @@ -71,9 +68,9 @@ private interface BackupPoliciesService { Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @HeaderParam("Accept") String accept, Context context); @@ -86,9 +83,9 @@ 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, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @PathParam("backupPolicyName") String backupPolicyName, @HeaderParam("Accept") String accept, Context context); @@ -102,9 +99,9 @@ Mono> get( Mono> createOrUpdate( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @PathParam("backupPolicyName") String backupPolicyName, @BodyParam("application/json") BaseBackupPolicyResourceInner parameters, @HeaderParam("Accept") String accept, @@ -119,9 +116,9 @@ Mono> createOrUpdate( Mono> delete( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @PathParam("backupPolicyName") String backupPolicyName, @HeaderParam("Accept") String accept, Context context); @@ -140,35 +137,35 @@ Mono> listNext( /** * Returns list of backup policies belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return baseBackupPolicyResourceList. + * @return baseBackupPolicyResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String vaultName, String resourceGroupName) { + String resourceGroupName, String vaultName) { 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( @@ -177,9 +174,9 @@ private Mono> listSinglePageAsync( .list( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, accept, context)) .>map( @@ -189,7 +186,7 @@ private Mono> listSinglePageAsync( res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -197,45 +194,45 @@ private Mono> listSinglePageAsync( /** * Returns list of backup policies belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return baseBackupPolicyResourceList. + * @return baseBackupPolicyResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String vaultName, String resourceGroupName, Context context) { + String resourceGroupName, String vaultName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, accept, context) .map( @@ -245,110 +242,111 @@ private Mono> listSinglePageAsync( res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } /** * Returns list of backup policies belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return baseBackupPolicyResourceList. + * @return baseBackupPolicyResourceList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName) { + private PagedFlux listAsync(String resourceGroupName, String vaultName) { return new PagedFlux<>( - () -> listSinglePageAsync(vaultName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + () -> listSinglePageAsync(resourceGroupName, vaultName), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Returns list of backup policies belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return baseBackupPolicyResourceList. + * @return baseBackupPolicyResourceList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String vaultName, String resourceGroupName, Context context) { + String resourceGroupName, String vaultName, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(vaultName, resourceGroupName, context), + () -> listSinglePageAsync(resourceGroupName, vaultName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Returns list of backup policies belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return baseBackupPolicyResourceList. + * @return baseBackupPolicyResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName) { - return new PagedIterable<>(listAsync(vaultName, resourceGroupName)); + public PagedIterable list(String resourceGroupName, String vaultName) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName)); } /** * Returns list of backup policies belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return baseBackupPolicyResourceList. + * @return baseBackupPolicyResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String vaultName, String resourceGroupName, Context context) { - return new PagedIterable<>(listAsync(vaultName, resourceGroupName, context)); + String resourceGroupName, String vaultName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, context)); } /** * Gets a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup policy belonging to a backup vault. + * @return a backup policy belonging to a backup vault along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String vaultName, String resourceGroupName, String backupPolicyName) { + String resourceGroupName, String vaultName, String backupPolicyName) { 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupPolicyName == null) { return Mono .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null.")); @@ -361,9 +359,9 @@ private Mono> getWithResponseAsync( .get( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupPolicyName, accept, context)) @@ -373,37 +371,38 @@ private Mono> getWithResponseAsync( /** * Gets a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName 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 a backup policy belonging to a backup vault. + * @return a backup policy belonging to a backup vault along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String vaultName, String resourceGroupName, String backupPolicyName, Context context) { + String resourceGroupName, String vaultName, String backupPolicyName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupPolicyName == null) { return Mono .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null.")); @@ -414,9 +413,9 @@ private Mono> getWithResponseAsync( .get( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupPolicyName, accept, context); @@ -425,96 +424,89 @@ private Mono> getWithResponseAsync( /** * Gets a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup policy belonging to a backup vault. + * @return a backup policy belonging to a backup vault on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( - String vaultName, String resourceGroupName, String backupPolicyName) { - return getWithResponseAsync(vaultName, resourceGroupName, backupPolicyName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + String resourceGroupName, String vaultName, String backupPolicyName) { + return getWithResponseAsync(resourceGroupName, vaultName, backupPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName 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 a backup policy belonging to a backup vault. + * @return a backup policy belonging to a backup vault along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BaseBackupPolicyResourceInner get(String vaultName, String resourceGroupName, String backupPolicyName) { - return getAsync(vaultName, resourceGroupName, backupPolicyName).block(); + public Response getWithResponse( + String resourceGroupName, String vaultName, String backupPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, backupPolicyName, context).block(); } /** * Gets a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName 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 a backup policy belonging to a backup vault. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String vaultName, String resourceGroupName, String backupPolicyName, Context context) { - return getWithResponseAsync(vaultName, resourceGroupName, backupPolicyName, context).block(); + public BaseBackupPolicyResourceInner get(String resourceGroupName, String vaultName, String backupPolicyName) { + return getWithResponse(resourceGroupName, vaultName, backupPolicyName, Context.NONE).getValue(); } /** * Creates or Updates a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName Name of the policy. * @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 baseBackupPolicyResource. + * @return baseBackupPolicyResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( - String vaultName, String resourceGroupName, String backupPolicyName, BaseBackupPolicyResourceInner parameters) { + String resourceGroupName, String vaultName, String backupPolicyName, BaseBackupPolicyResourceInner 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupPolicyName == null) { return Mono .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null.")); @@ -532,9 +524,9 @@ private Mono> createOrUpdateWithResponse .createOrUpdate( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupPolicyName, parameters, accept, @@ -545,20 +537,20 @@ private Mono> createOrUpdateWithResponse /** * Creates or Updates a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName Name of the policy. * @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 baseBackupPolicyResource. + * @return baseBackupPolicyResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupPolicyName, BaseBackupPolicyResourceInner parameters, Context context) { @@ -568,19 +560,19 @@ private Mono> createOrUpdateWithResponse 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupPolicyName == null) { return Mono .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null.")); @@ -596,9 +588,9 @@ private Mono> createOrUpdateWithResponse .createOrUpdate( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupPolicyName, parameters, accept, @@ -608,104 +600,98 @@ private Mono> createOrUpdateWithResponse /** * Creates or Updates a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName Name of the policy. * @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 baseBackupPolicyResource. + * @return baseBackupPolicyResource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( - String vaultName, String resourceGroupName, String backupPolicyName, BaseBackupPolicyResourceInner parameters) { - return createOrUpdateWithResponseAsync(vaultName, resourceGroupName, backupPolicyName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + String resourceGroupName, String vaultName, String backupPolicyName, BaseBackupPolicyResourceInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, backupPolicyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Creates or Updates a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName Name of the policy. * @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 baseBackupPolicyResource. + * @return baseBackupPolicyResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BaseBackupPolicyResourceInner createOrUpdate( - String vaultName, String resourceGroupName, String backupPolicyName, BaseBackupPolicyResourceInner parameters) { - return createOrUpdateAsync(vaultName, resourceGroupName, backupPolicyName, parameters).block(); + public Response createOrUpdateWithResponse( + String resourceGroupName, + String vaultName, + String backupPolicyName, + BaseBackupPolicyResourceInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, backupPolicyName, parameters, context) + .block(); } /** * Creates or Updates a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName Name of the policy. * @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 baseBackupPolicyResource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String vaultName, - String resourceGroupName, - String backupPolicyName, - BaseBackupPolicyResourceInner parameters, - Context context) { - return createOrUpdateWithResponseAsync(vaultName, resourceGroupName, backupPolicyName, parameters, context) - .block(); + public BaseBackupPolicyResourceInner createOrUpdate( + String resourceGroupName, String vaultName, String backupPolicyName, BaseBackupPolicyResourceInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, vaultName, backupPolicyName, parameters, Context.NONE) + .getValue(); } /** * Deletes a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName 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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( - String vaultName, String resourceGroupName, String backupPolicyName) { + String resourceGroupName, String vaultName, String backupPolicyName) { 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupPolicyName == null) { return Mono .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null.")); @@ -718,9 +704,9 @@ private Mono> deleteWithResponseAsync( .delete( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupPolicyName, accept, context)) @@ -730,37 +716,37 @@ private Mono> deleteWithResponseAsync( /** * Deletes a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName 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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( - String vaultName, String resourceGroupName, String backupPolicyName, Context context) { + String resourceGroupName, String vaultName, String backupPolicyName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupPolicyName == null) { return Mono .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null.")); @@ -771,9 +757,9 @@ private Mono> deleteWithResponseAsync( .delete( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupPolicyName, accept, context); @@ -782,61 +768,61 @@ private Mono> deleteWithResponseAsync( /** * Deletes a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName 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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String vaultName, String resourceGroupName, String backupPolicyName) { - return deleteWithResponseAsync(vaultName, resourceGroupName, backupPolicyName) - .flatMap((Response res) -> Mono.empty()); + private Mono deleteAsync(String resourceGroupName, String vaultName, String backupPolicyName) { + return deleteWithResponseAsync(resourceGroupName, vaultName, backupPolicyName).flatMap(ignored -> Mono.empty()); } /** * Deletes a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String vaultName, String resourceGroupName, String backupPolicyName) { - deleteAsync(vaultName, resourceGroupName, backupPolicyName).block(); + public Response deleteWithResponse( + String resourceGroupName, String vaultName, String backupPolicyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, vaultName, backupPolicyName, context).block(); } /** * Deletes a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName 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 backupPolicyName, Context context) { - return deleteWithResponseAsync(vaultName, resourceGroupName, backupPolicyName, context).block(); + public void delete(String resourceGroupName, String vaultName, String backupPolicyName) { + deleteWithResponse(resourceGroupName, vaultName, backupPolicyName, Context.NONE); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 baseBackupPolicyResourceList. + * @return baseBackupPolicyResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -859,7 +845,7 @@ private Mono> listNextSinglePageAsy res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -867,12 +853,13 @@ private Mono> listNextSinglePageAsy /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 baseBackupPolicyResourceList. + * @return baseBackupPolicyResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync( @@ -897,7 +884,7 @@ private Mono> listNextSinglePageAsy res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupPoliciesImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupPoliciesImpl.java index 61a5f2704755..7351212eddab 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupPoliciesImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupPoliciesImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.dataprotection.fluent.models.BaseBackupPolicyResourceInner; import com.azure.resourcemanager.dataprotection.models.BackupPolicies; import com.azure.resourcemanager.dataprotection.models.BaseBackupPolicyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class BackupPoliciesImpl implements BackupPolicies { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupPoliciesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(BackupPoliciesImpl.class); private final BackupPoliciesClient innerClient; @@ -29,30 +28,21 @@ public BackupPoliciesImpl( this.serviceManager = serviceManager; } - public PagedIterable list(String vaultName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); return Utils.mapPage(inner, inner1 -> new BaseBackupPolicyResourceImpl(inner1, this.manager())); } - public PagedIterable list(String vaultName, String resourceGroupName, Context context) { + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { PagedIterable inner = - this.serviceClient().list(vaultName, resourceGroupName, context); + this.serviceClient().list(resourceGroupName, vaultName, context); return Utils.mapPage(inner, inner1 -> new BaseBackupPolicyResourceImpl(inner1, this.manager())); } - public BaseBackupPolicyResource get(String vaultName, String resourceGroupName, String backupPolicyName) { - BaseBackupPolicyResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName, backupPolicyName); - if (inner != null) { - return new BaseBackupPolicyResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( - String vaultName, String resourceGroupName, String backupPolicyName, Context context) { + String resourceGroupName, String vaultName, String backupPolicyName, Context context) { Response inner = - this.serviceClient().getWithResponse(vaultName, resourceGroupName, backupPolicyName, context); + this.serviceClient().getWithResponse(resourceGroupName, vaultName, backupPolicyName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -64,121 +54,130 @@ public Response getWithResponse( } } - public void delete(String vaultName, String resourceGroupName, String backupPolicyName) { - this.serviceClient().delete(vaultName, resourceGroupName, backupPolicyName); + public BaseBackupPolicyResource get(String resourceGroupName, String vaultName, String backupPolicyName) { + BaseBackupPolicyResourceInner inner = this.serviceClient().get(resourceGroupName, vaultName, backupPolicyName); + if (inner != null) { + return new BaseBackupPolicyResourceImpl(inner, this.manager()); + } else { + return null; + } } public Response deleteWithResponse( - String vaultName, String resourceGroupName, String backupPolicyName, Context context) { - return this.serviceClient().deleteWithResponse(vaultName, resourceGroupName, backupPolicyName, context); + String resourceGroupName, String vaultName, String backupPolicyName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, vaultName, backupPolicyName, context); + } + + public void delete(String resourceGroupName, String vaultName, String backupPolicyName) { + this.serviceClient().delete(resourceGroupName, vaultName, backupPolicyName); } public BaseBackupPolicyResource getById(String id) { - String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); - if (vaultName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); - } String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } + String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); + } String backupPolicyName = Utils.getValueFromIdByName(id, "backupPolicies"); if (backupPolicyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); } - return this.getWithResponse(vaultName, resourceGroupName, backupPolicyName, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, vaultName, backupPolicyName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); - if (vaultName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); - } String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } + String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); + } String backupPolicyName = Utils.getValueFromIdByName(id, "backupPolicies"); if (backupPolicyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); } - return this.getWithResponse(vaultName, resourceGroupName, backupPolicyName, context); + return this.getWithResponse(resourceGroupName, vaultName, backupPolicyName, context); } public void deleteById(String id) { - String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); - if (vaultName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); - } String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } + String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); + } String backupPolicyName = Utils.getValueFromIdByName(id, "backupPolicies"); if (backupPolicyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); } - this.deleteWithResponse(vaultName, resourceGroupName, backupPolicyName, Context.NONE); + this.deleteWithResponse(resourceGroupName, vaultName, backupPolicyName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); - if (vaultName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); - } String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } + String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); + } String backupPolicyName = Utils.getValueFromIdByName(id, "backupPolicies"); if (backupPolicyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); } - return this.deleteWithResponse(vaultName, resourceGroupName, backupPolicyName, context); + return this.deleteWithResponse(resourceGroupName, vaultName, backupPolicyName, context); } private BackupPoliciesClient serviceClient() { diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultOperationResultsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultOperationResultsClientImpl.java index 9cb08e1eb523..167ca15471af 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultOperationResultsClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultOperationResultsClientImpl.java @@ -20,7 +20,6 @@ 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.dataprotection.fluent.BackupVaultOperationResultsClient; import com.azure.resourcemanager.dataprotection.fluent.models.BackupVaultResourceInner; import com.azure.resourcemanager.dataprotection.models.BackupVaultOperationResultsGetResponse; @@ -28,8 +27,6 @@ /** An instance of this class provides access to all the operations defined in BackupVaultOperationResultsClient. */ public final class BackupVaultOperationResultsClientImpl implements BackupVaultOperationResultsClient { - private final ClientLogger logger = new ClientLogger(BackupVaultOperationResultsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final BackupVaultOperationResultsService service; @@ -55,7 +52,7 @@ public final class BackupVaultOperationResultsClientImpl implements BackupVaultO */ @Host("{$host}") @ServiceInterface(name = "DataProtectionClient") - private interface BackupVaultOperationResultsService { + public interface BackupVaultOperationResultsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" @@ -65,45 +62,47 @@ private interface BackupVaultOperationResultsService { Mono get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); } /** - * @param vaultName The name of the backup vault. + * The get operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return backupVault Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getWithResponseAsync( - String vaultName, String resourceGroupName, String operationId) { + String resourceGroupName, String vaultName, String operationId) { 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } @@ -115,9 +114,9 @@ private Mono getWithResponseAsync( .get( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, operationId, accept, context)) @@ -125,37 +124,39 @@ private Mono getWithResponseAsync( } /** - * @param vaultName The name of the backup vault. + * The get operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return backupVault Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getWithResponseAsync( - String vaultName, String resourceGroupName, String operationId, Context context) { + String resourceGroupName, String vaultName, 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 (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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } @@ -165,63 +166,62 @@ private Mono getWithResponseAsync( .get( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, operationId, accept, context); } /** - * @param vaultName The name of the backup vault. + * The get operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return backupVault Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, String operationId) { - return getWithResponseAsync(vaultName, resourceGroupName, operationId) - .flatMap( - (BackupVaultOperationResultsGetResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono getAsync(String resourceGroupName, String vaultName, String operationId) { + return getWithResponseAsync(resourceGroupName, vaultName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * @param vaultName The name of the backup vault. + * The get operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BackupVaultResourceInner get(String vaultName, String resourceGroupName, String operationId) { - return getAsync(vaultName, resourceGroupName, operationId).block(); + public BackupVaultOperationResultsGetResponse getWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, operationId, context).block(); } /** - * @param vaultName The name of the backup vault. + * The get operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BackupVaultOperationResultsGetResponse getWithResponse( - String vaultName, String resourceGroupName, String operationId, Context context) { - return getWithResponseAsync(vaultName, resourceGroupName, operationId, context).block(); + public BackupVaultResourceInner get(String resourceGroupName, String vaultName, String operationId) { + return getWithResponse(resourceGroupName, vaultName, operationId, Context.NONE).getValue(); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultOperationResultsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultOperationResultsImpl.java index 2046845383f6..eab222c1f089 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultOperationResultsImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultOperationResultsImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.dataprotection.models.BackupVaultOperationResults; import com.azure.resourcemanager.dataprotection.models.BackupVaultOperationResultsGetResponse; import com.azure.resourcemanager.dataprotection.models.BackupVaultResource; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class BackupVaultOperationResultsImpl implements BackupVaultOperationResults { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupVaultOperationResultsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(BackupVaultOperationResultsImpl.class); private final BackupVaultOperationResultsClient innerClient; @@ -29,19 +28,10 @@ public BackupVaultOperationResultsImpl( this.serviceManager = serviceManager; } - public BackupVaultResource get(String vaultName, String resourceGroupName, String operationId) { - BackupVaultResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName, operationId); - if (inner != null) { - return new BackupVaultResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( - String vaultName, String resourceGroupName, String operationId, Context context) { + String resourceGroupName, String vaultName, String operationId, Context context) { BackupVaultOperationResultsGetResponse inner = - this.serviceClient().getWithResponse(vaultName, resourceGroupName, operationId, context); + this.serviceClient().getWithResponse(resourceGroupName, vaultName, operationId, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -53,6 +43,15 @@ public Response getWithResponse( } } + public BackupVaultResource get(String resourceGroupName, String vaultName, String operationId) { + BackupVaultResourceInner inner = this.serviceClient().get(resourceGroupName, vaultName, operationId); + if (inner != null) { + return new BackupVaultResourceImpl(inner, this.manager()); + } else { + return null; + } + } + private BackupVaultOperationResultsClient serviceClient() { return this.innerClient; } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultResourceImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultResourceImpl.java index 866824bb7241..96c95c48b316 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultResourceImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultResourceImpl.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.dataprotection.models.BackupVault; import com.azure.resourcemanager.dataprotection.models.BackupVaultResource; import com.azure.resourcemanager.dataprotection.models.DppIdentityDetails; +import com.azure.resourcemanager.dataprotection.models.PatchBackupVaultInput; import com.azure.resourcemanager.dataprotection.models.PatchResourceRequestInput; import java.util.Collections; import java.util.Map; @@ -70,6 +71,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public BackupVaultResourceInner innerModel() { return this.innerObject; } @@ -78,10 +83,10 @@ private com.azure.resourcemanager.dataprotection.DataProtectionManager manager() return this.serviceManager; } - private String vaultName; - private String resourceGroupName; + private String vaultName; + private PatchResourceRequestInput updateParameters; public BackupVaultResourceImpl withExistingResourceGroup(String resourceGroupName) { @@ -94,7 +99,7 @@ public BackupVaultResource create() { serviceManager .serviceClient() .getBackupVaults() - .createOrUpdate(vaultName, resourceGroupName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, vaultName, this.innerModel(), Context.NONE); return this; } @@ -103,7 +108,7 @@ public BackupVaultResource create(Context context) { serviceManager .serviceClient() .getBackupVaults() - .createOrUpdate(vaultName, resourceGroupName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, vaultName, this.innerModel(), context); return this; } @@ -124,7 +129,7 @@ public BackupVaultResource apply() { serviceManager .serviceClient() .getBackupVaults() - .update(vaultName, resourceGroupName, updateParameters, Context.NONE); + .update(resourceGroupName, vaultName, updateParameters, Context.NONE); return this; } @@ -133,7 +138,7 @@ public BackupVaultResource apply(Context context) { serviceManager .serviceClient() .getBackupVaults() - .update(vaultName, resourceGroupName, updateParameters, context); + .update(resourceGroupName, vaultName, updateParameters, context); return this; } @@ -142,8 +147,8 @@ public BackupVaultResource apply(Context context) { com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "backupVaults"); this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "backupVaults"); } public BackupVaultResource refresh() { @@ -206,6 +211,11 @@ public BackupVaultResourceImpl withIdentity(DppIdentityDetails identity) { } } + public BackupVaultResourceImpl withProperties(PatchBackupVaultInput properties) { + this.updateParameters.withProperties(properties); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultsClientImpl.java index e702298e6403..5842ee912899 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultsClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultsClientImpl.java @@ -31,7 +31,6 @@ 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.dataprotection.fluent.BackupVaultsClient; @@ -46,8 +45,6 @@ /** An instance of this class provides access to all the operations defined in BackupVaultsClient. */ public final class BackupVaultsClientImpl implements BackupVaultsClient { - private final ClientLogger logger = new ClientLogger(BackupVaultsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final BackupVaultsService service; @@ -71,7 +68,7 @@ public final class BackupVaultsClientImpl implements BackupVaultsClient { */ @Host("{$host}") @ServiceInterface(name = "DataProtectionClient") - private interface BackupVaultsService { + public interface BackupVaultsService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/backupVaults") @ExpectedResponses({200}) @@ -106,9 +103,9 @@ Mono> listByResourceGroup( Mono> getByResourceGroup( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -121,9 +118,9 @@ Mono> getByResourceGroup( Mono>> createOrUpdate( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @BodyParam("application/json") BackupVaultResourceInner parameters, @HeaderParam("Accept") String accept, Context context); @@ -137,9 +134,9 @@ Mono>> createOrUpdate( Mono> delete( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -152,9 +149,9 @@ Mono> delete( Mono>> update( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @BodyParam("application/json") PatchResourceRequestInput parameters, @HeaderParam("Accept") String accept, Context context); @@ -201,7 +198,7 @@ Mono> getInResourceGroupNext( * * @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 backupVaultResourceList. + * @return backupVaultResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -235,7 +232,7 @@ private Mono> listSinglePageAsync() { res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -247,7 +244,7 @@ private Mono> listSinglePageAsync() { * @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 backupVaultResourceList. + * @return backupVaultResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -279,7 +276,7 @@ private Mono> listSinglePageAsync(Contex res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } @@ -288,7 +285,7 @@ private Mono> listSinglePageAsync(Contex * * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -302,7 +299,7 @@ private PagedFlux listAsync() { * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -315,7 +312,7 @@ private PagedFlux listAsync(Context context) { * * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -329,7 +326,7 @@ 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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -343,7 +340,7 @@ public PagedIterable list(Context context) { * @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 backupVaultResourceList. + * @return backupVaultResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -382,7 +379,7 @@ private Mono> listByResourceGroupSingleP res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -395,7 +392,7 @@ private Mono> listByResourceGroupSingleP * @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 backupVaultResourceList. + * @return backupVaultResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -433,7 +430,7 @@ private Mono> listByResourceGroupSingleP res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } @@ -444,7 +441,7 @@ private Mono> listByResourceGroupSingleP * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -461,7 +458,7 @@ private PagedFlux listByResourceGroupAsync(String reso * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -477,7 +474,7 @@ private PagedFlux listByResourceGroupAsync(String reso * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -492,7 +489,7 @@ public PagedIterable listByResourceGroup(String resour * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -507,7 +504,7 @@ public PagedIterable listByResourceGroup(String resour * @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 backupVault Resource. + * @return backupVault Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -518,6 +515,12 @@ private Mono> getByResourceGroupWithResponseA new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -525,12 +528,6 @@ private Mono> getByResourceGroupWithResponseA if (vaultName == null) { return Mono.error(new IllegalArgumentException("Parameter vaultName 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 accept = "application/json"; return FluxUtil .withContext( @@ -539,9 +536,9 @@ private Mono> getByResourceGroupWithResponseA .getByResourceGroup( this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, - this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -556,7 +553,7 @@ private Mono> getByResourceGroupWithResponseA * @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 backupVault Resource. + * @return backupVault Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -567,6 +564,12 @@ private Mono> getByResourceGroupWithResponseA new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -574,21 +577,15 @@ private Mono> getByResourceGroupWithResponseA if (vaultName == null) { return Mono.error(new IllegalArgumentException("Parameter vaultName 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 accept = "application/json"; context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, - this.client.getSubscriptionId(), accept, context); } @@ -601,19 +598,12 @@ private Mono> getByResourceGroupWithResponseA * @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 backupVault Resource. + * @return backupVault Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String vaultName) { return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -621,14 +611,16 @@ private Mono getByResourceGroupAsync(String resourceGr * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backupVault Resource. + * @return backupVault Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BackupVaultResourceInner getByResourceGroup(String resourceGroupName, String vaultName) { - return getByResourceGroupAsync(resourceGroupName, vaultName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vaultName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName, context).block(); } /** @@ -636,51 +628,49 @@ public BackupVaultResourceInner getByResourceGroup(String resourceGroupName, Str * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return backupVault Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String vaultName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName, context).block(); + public BackupVaultResourceInner getByResourceGroup(String resourceGroupName, String vaultName) { + return getByResourceGroupWithResponse(resourceGroupName, vaultName, Context.NONE).getValue(); } /** * Creates or updates a BackupVault resource belonging to a resource group. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return backupVault Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( - String vaultName, String resourceGroupName, BackupVaultResourceInner parameters) { + String resourceGroupName, String vaultName, BackupVaultResourceInner 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { @@ -694,9 +684,9 @@ private Mono>> createOrUpdateWithResponseAsync( .createOrUpdate( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, parameters, accept, context)) @@ -706,37 +696,37 @@ private Mono>> createOrUpdateWithResponseAsync( /** * Creates or updates a BackupVault resource belonging to a resource group. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return backupVault Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( - String vaultName, String resourceGroupName, BackupVaultResourceInner parameters, Context context) { + String resourceGroupName, String vaultName, BackupVaultResourceInner 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { @@ -748,9 +738,9 @@ private Mono>> createOrUpdateWithResponseAsync( .createOrUpdate( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, parameters, accept, context); @@ -759,19 +749,19 @@ private Mono>> createOrUpdateWithResponseAsync( /** * Creates or updates a BackupVault resource belonging to a resource group. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return the {@link PollerFlux} for polling of backupVault Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BackupVaultResourceInner> beginCreateOrUpdateAsync( - String vaultName, String resourceGroupName, BackupVaultResourceInner parameters) { + String resourceGroupName, String vaultName, BackupVaultResourceInner parameters) { Mono>> mono = - createOrUpdateWithResponseAsync(vaultName, resourceGroupName, parameters); + createOrUpdateWithResponseAsync(resourceGroupName, vaultName, parameters); return this .client .getLroResult( @@ -779,27 +769,27 @@ private PollerFlux, BackupVaultResourceInne this.client.getHttpPipeline(), BackupVaultResourceInner.class, BackupVaultResourceInner.class, - Context.NONE); + this.client.getContext()); } /** * Creates or updates a BackupVault resource belonging to a resource group. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return the {@link PollerFlux} for polling of backupVault Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BackupVaultResourceInner> beginCreateOrUpdateAsync( - String vaultName, String resourceGroupName, BackupVaultResourceInner parameters, Context context) { + String resourceGroupName, String vaultName, BackupVaultResourceInner parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono = - createOrUpdateWithResponseAsync(vaultName, resourceGroupName, parameters, context); + createOrUpdateWithResponseAsync(resourceGroupName, vaultName, parameters, context); return this .client .getLroResult( @@ -813,53 +803,53 @@ private PollerFlux, BackupVaultResourceInne /** * Creates or updates a BackupVault resource belonging to a resource group. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return the {@link SyncPoller} for polling of backupVault Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, BackupVaultResourceInner> beginCreateOrUpdate( - String vaultName, String resourceGroupName, BackupVaultResourceInner parameters) { - return beginCreateOrUpdateAsync(vaultName, resourceGroupName, parameters).getSyncPoller(); + String resourceGroupName, String vaultName, BackupVaultResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters).getSyncPoller(); } /** * Creates or updates a BackupVault resource belonging to a resource group. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return the {@link SyncPoller} for polling of backupVault Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, BackupVaultResourceInner> beginCreateOrUpdate( - String vaultName, String resourceGroupName, BackupVaultResourceInner parameters, Context context) { - return beginCreateOrUpdateAsync(vaultName, resourceGroupName, parameters, context).getSyncPoller(); + String resourceGroupName, String vaultName, BackupVaultResourceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters, context).getSyncPoller(); } /** * Creates or updates a BackupVault resource belonging to a resource group. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return backupVault Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( - String vaultName, String resourceGroupName, BackupVaultResourceInner parameters) { - return beginCreateOrUpdateAsync(vaultName, resourceGroupName, parameters) + String resourceGroupName, String vaultName, BackupVaultResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -867,19 +857,19 @@ private Mono createOrUpdateAsync( /** * Creates or updates a BackupVault resource belonging to a resource group. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return backupVault Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( - String vaultName, String resourceGroupName, BackupVaultResourceInner parameters, Context context) { - return beginCreateOrUpdateAsync(vaultName, resourceGroupName, parameters, context) + String resourceGroupName, String vaultName, BackupVaultResourceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -887,8 +877,8 @@ private Mono createOrUpdateAsync( /** * Creates or updates a BackupVault resource belonging to a resource group. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param parameters Request body for operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -897,15 +887,15 @@ private Mono createOrUpdateAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public BackupVaultResourceInner createOrUpdate( - String vaultName, String resourceGroupName, BackupVaultResourceInner parameters) { - return createOrUpdateAsync(vaultName, resourceGroupName, parameters).block(); + String resourceGroupName, String vaultName, BackupVaultResourceInner parameters) { + return createOrUpdateAsync(resourceGroupName, vaultName, parameters).block(); } /** * Creates or updates a BackupVault resource belonging to a resource group. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param parameters Request body for operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -915,8 +905,8 @@ public BackupVaultResourceInner createOrUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) public BackupVaultResourceInner createOrUpdate( - String vaultName, String resourceGroupName, BackupVaultResourceInner parameters, Context context) { - return createOrUpdateAsync(vaultName, resourceGroupName, parameters, context).block(); + String resourceGroupName, String vaultName, BackupVaultResourceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, vaultName, parameters, context).block(); } /** @@ -927,7 +917,7 @@ public BackupVaultResourceInner createOrUpdate( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String vaultName) { @@ -937,6 +927,12 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -944,12 +940,6 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (vaultName == null) { return Mono.error(new IllegalArgumentException("Parameter vaultName 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 accept = "application/json"; return FluxUtil .withContext( @@ -958,9 +948,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S .delete( this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, - this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -975,7 +965,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String vaultName, Context context) { @@ -985,6 +975,12 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -992,21 +988,15 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (vaultName == null) { return Mono.error(new IllegalArgumentException("Parameter vaultName 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 accept = "application/json"; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, - this.client.getSubscriptionId(), accept, context); } @@ -1019,11 +1009,11 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String vaultName) { - return deleteWithResponseAsync(resourceGroupName, vaultName).flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, vaultName).flatMap(ignored -> Mono.empty()); } /** @@ -1031,13 +1021,15 @@ private Mono deleteAsync(String resourceGroupName, String vaultName) { * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vaultName) { - deleteAsync(resourceGroupName, vaultName).block(); + public Response deleteWithResponse(String resourceGroupName, String vaultName, Context context) { + return deleteWithResponseAsync(resourceGroupName, vaultName, context).block(); } /** @@ -1045,50 +1037,48 @@ public void delete(String resourceGroupName, String vaultName) { * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String vaultName, Context context) { - return deleteWithResponseAsync(resourceGroupName, vaultName, context).block(); + public void delete(String resourceGroupName, String vaultName) { + deleteWithResponse(resourceGroupName, vaultName, Context.NONE); } /** * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return backupVault Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( - String vaultName, String resourceGroupName, PatchResourceRequestInput parameters) { + String resourceGroupName, String vaultName, PatchResourceRequestInput 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { @@ -1102,9 +1092,9 @@ private Mono>> updateWithResponseAsync( .update( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, parameters, accept, context)) @@ -1114,37 +1104,37 @@ private Mono>> updateWithResponseAsync( /** * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return backupVault Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( - String vaultName, String resourceGroupName, PatchResourceRequestInput parameters, Context context) { + String resourceGroupName, String vaultName, PatchResourceRequestInput 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { @@ -1156,9 +1146,9 @@ private Mono>> updateWithResponseAsync( .update( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, parameters, accept, context); @@ -1167,18 +1157,18 @@ private Mono>> updateWithResponseAsync( /** * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return the {@link PollerFlux} for polling of backupVault Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BackupVaultResourceInner> beginUpdateAsync( - String vaultName, String resourceGroupName, PatchResourceRequestInput parameters) { - Mono>> mono = updateWithResponseAsync(vaultName, resourceGroupName, parameters); + String resourceGroupName, String vaultName, PatchResourceRequestInput parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, vaultName, parameters); return this .client .getLroResult( @@ -1186,27 +1176,27 @@ private PollerFlux, BackupVaultResourceInne this.client.getHttpPipeline(), BackupVaultResourceInner.class, BackupVaultResourceInner.class, - Context.NONE); + this.client.getContext()); } /** * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return the {@link PollerFlux} for polling of backupVault Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BackupVaultResourceInner> beginUpdateAsync( - String vaultName, String resourceGroupName, PatchResourceRequestInput parameters, Context context) { + String resourceGroupName, String vaultName, PatchResourceRequestInput parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono = - updateWithResponseAsync(vaultName, resourceGroupName, parameters, context); + updateWithResponseAsync(resourceGroupName, vaultName, parameters, context); return this .client .getLroResult( @@ -1220,53 +1210,53 @@ private PollerFlux, BackupVaultResourceInne /** * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return the {@link SyncPoller} for polling of backupVault Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, BackupVaultResourceInner> beginUpdate( - String vaultName, String resourceGroupName, PatchResourceRequestInput parameters) { - return beginUpdateAsync(vaultName, resourceGroupName, parameters).getSyncPoller(); + String resourceGroupName, String vaultName, PatchResourceRequestInput parameters) { + return beginUpdateAsync(resourceGroupName, vaultName, parameters).getSyncPoller(); } /** * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return the {@link SyncPoller} for polling of backupVault Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, BackupVaultResourceInner> beginUpdate( - String vaultName, String resourceGroupName, PatchResourceRequestInput parameters, Context context) { - return beginUpdateAsync(vaultName, resourceGroupName, parameters, context).getSyncPoller(); + String resourceGroupName, String vaultName, PatchResourceRequestInput parameters, Context context) { + return beginUpdateAsync(resourceGroupName, vaultName, parameters, context).getSyncPoller(); } /** * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return backupVault Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( - String vaultName, String resourceGroupName, PatchResourceRequestInput parameters) { - return beginUpdateAsync(vaultName, resourceGroupName, parameters) + String resourceGroupName, String vaultName, PatchResourceRequestInput parameters) { + return beginUpdateAsync(resourceGroupName, vaultName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1274,19 +1264,19 @@ private Mono updateAsync( /** * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. + * @return backupVault Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( - String vaultName, String resourceGroupName, PatchResourceRequestInput parameters, Context context) { - return beginUpdateAsync(vaultName, resourceGroupName, parameters, context) + String resourceGroupName, String vaultName, PatchResourceRequestInput parameters, Context context) { + return beginUpdateAsync(resourceGroupName, vaultName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1294,8 +1284,8 @@ private Mono updateAsync( /** * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param parameters Request body for operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1304,15 +1294,15 @@ private Mono updateAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public BackupVaultResourceInner update( - String vaultName, String resourceGroupName, PatchResourceRequestInput parameters) { - return updateAsync(vaultName, resourceGroupName, parameters).block(); + String resourceGroupName, String vaultName, PatchResourceRequestInput parameters) { + return updateAsync(resourceGroupName, vaultName, parameters).block(); } /** * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param parameters Request body for operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1322,8 +1312,8 @@ public BackupVaultResourceInner update( */ @ServiceMethod(returns = ReturnType.SINGLE) public BackupVaultResourceInner update( - String vaultName, String resourceGroupName, PatchResourceRequestInput parameters, Context context) { - return updateAsync(vaultName, resourceGroupName, parameters, context).block(); + String resourceGroupName, String vaultName, PatchResourceRequestInput parameters, Context context) { + return updateAsync(resourceGroupName, vaultName, parameters, context).block(); } /** @@ -1335,7 +1325,7 @@ public BackupVaultResourceInner update( * @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 checkNameAvailabilityResult. + * @return checkNameAvailabilityResult along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -1391,7 +1381,7 @@ private Mono> checkNameAvailabilityWi * @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 checkNameAvailabilityResult. + * @return checkNameAvailabilityResult along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -1443,20 +1433,13 @@ private Mono> checkNameAvailabilityWi * @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 checkNameAvailabilityResult. + * @return checkNameAvailabilityResult on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkNameAvailabilityAsync( String resourceGroupName, String location, CheckNameAvailabilityRequest parameters) { return checkNameAvailabilityWithResponseAsync(resourceGroupName, location, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1465,15 +1448,16 @@ private Mono checkNameAvailabilityAsync( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param location The location in which uniqueness will be verified. * @param parameters Check name availability 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 checkNameAvailabilityResult. + * @return checkNameAvailabilityResult along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityResultInner checkNameAvailability( - String resourceGroupName, String location, CheckNameAvailabilityRequest parameters) { - return checkNameAvailabilityAsync(resourceGroupName, location, parameters).block(); + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, String location, CheckNameAvailabilityRequest parameters, Context context) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, location, parameters, context).block(); } /** @@ -1482,26 +1466,26 @@ public CheckNameAvailabilityResultInner checkNameAvailability( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param location The location in which uniqueness will be verified. * @param parameters Check name availability 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 checkNameAvailabilityResult. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse( - String resourceGroupName, String location, CheckNameAvailabilityRequest parameters, Context context) { - return checkNameAvailabilityWithResponseAsync(resourceGroupName, location, parameters, context).block(); + public CheckNameAvailabilityResultInner checkNameAvailability( + String resourceGroupName, String location, CheckNameAvailabilityRequest parameters) { + return checkNameAvailabilityWithResponse(resourceGroupName, location, parameters, Context.NONE).getValue(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 backupVaultResourceList. + * @return backupVaultResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getInSubscriptionNextSinglePageAsync(String nextLink) { @@ -1524,7 +1508,7 @@ private Mono> getInSubscriptionNextSingl res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1532,12 +1516,13 @@ private Mono> getInSubscriptionNextSingl /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 backupVaultResourceList. + * @return backupVaultResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getInSubscriptionNextSinglePageAsync( @@ -1562,18 +1547,19 @@ private Mono> getInSubscriptionNextSingl res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 backupVaultResourceList. + * @return backupVaultResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getInResourceGroupNextSinglePageAsync(String nextLink) { @@ -1597,7 +1583,7 @@ private Mono> getInResourceGroupNextSing res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1605,12 +1591,13 @@ private Mono> getInResourceGroupNextSing /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 backupVaultResourceList. + * @return backupVaultResourceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getInResourceGroupNextSinglePageAsync( @@ -1635,7 +1622,7 @@ private Mono> getInResourceGroupNextSing res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultsImpl.java index c3542900bf17..fe29d7ccb30b 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultsImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultsImpl.java @@ -16,10 +16,9 @@ import com.azure.resourcemanager.dataprotection.models.BackupVaults; import com.azure.resourcemanager.dataprotection.models.CheckNameAvailabilityRequest; import com.azure.resourcemanager.dataprotection.models.CheckNameAvailabilityResult; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class BackupVaultsImpl implements BackupVaults { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupVaultsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(BackupVaultsImpl.class); private final BackupVaultsClient innerClient; @@ -52,15 +51,6 @@ public PagedIterable listByResourceGroup(String resourceGro return Utils.mapPage(inner, inner1 -> new BackupVaultResourceImpl(inner1, this.manager())); } - public BackupVaultResource getByResourceGroup(String resourceGroupName, String vaultName) { - BackupVaultResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vaultName); - if (inner != null) { - return new BackupVaultResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String vaultName, Context context) { Response inner = @@ -76,23 +66,22 @@ public Response getByResourceGroupWithResponse( } } - public void deleteByResourceGroup(String resourceGroupName, String vaultName) { - this.serviceClient().delete(resourceGroupName, vaultName); + public BackupVaultResource getByResourceGroup(String resourceGroupName, String vaultName) { + BackupVaultResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vaultName); + if (inner != null) { + return new BackupVaultResourceImpl(inner, this.manager()); + } else { + return null; + } } - public Response deleteWithResponse(String resourceGroupName, String vaultName, Context context) { + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String vaultName, Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, vaultName, context); } - public CheckNameAvailabilityResult checkNameAvailability( - String resourceGroupName, String location, CheckNameAvailabilityRequest parameters) { - CheckNameAvailabilityResultInner inner = - this.serviceClient().checkNameAvailability(resourceGroupName, location, parameters); - if (inner != null) { - return new CheckNameAvailabilityResultImpl(inner, this.manager()); - } else { - return null; - } + public void deleteByResourceGroup(String resourceGroupName, String vaultName) { + this.serviceClient().delete(resourceGroupName, vaultName); } public Response checkNameAvailabilityWithResponse( @@ -110,10 +99,21 @@ public Response checkNameAvailabilityWithResponse( } } + public CheckNameAvailabilityResult checkNameAvailability( + String resourceGroupName, String location, CheckNameAvailabilityRequest parameters) { + CheckNameAvailabilityResultInner inner = + this.serviceClient().checkNameAvailability(resourceGroupName, location, parameters); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + public BackupVaultResource getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -121,7 +121,7 @@ public BackupVaultResource getById(String id) { } String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); if (vaultName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); @@ -132,7 +132,7 @@ public BackupVaultResource getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -140,7 +140,7 @@ public Response getByIdWithResponse(String id, Context cont } String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); if (vaultName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); @@ -151,7 +151,7 @@ public Response getByIdWithResponse(String id, Context cont public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -159,18 +159,18 @@ public void deleteById(String id) { } String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); if (vaultName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); } - this.deleteWithResponse(resourceGroupName, vaultName, Context.NONE); + this.deleteByResourceGroupWithResponse(resourceGroupName, vaultName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -178,12 +178,12 @@ public Response deleteByIdWithResponse(String id, Context context) { } String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); if (vaultName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); } - return this.deleteWithResponse(resourceGroupName, vaultName, context); + return this.deleteByResourceGroupWithResponse(resourceGroupName, vaultName, context); } private BackupVaultsClient serviceClient() { diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BaseBackupPolicyResourceImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BaseBackupPolicyResourceImpl.java index 1e6f43498a57..34468db3c652 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BaseBackupPolicyResourceImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BaseBackupPolicyResourceImpl.java @@ -36,6 +36,10 @@ public BaseBackupPolicy properties() { return this.innerModel().properties(); } + public String resourceGroupName() { + return resourceGroupName; + } + public BaseBackupPolicyResourceInner innerModel() { return this.innerObject; } @@ -44,15 +48,15 @@ private com.azure.resourcemanager.dataprotection.DataProtectionManager manager() return this.serviceManager; } - private String vaultName; - private String resourceGroupName; + private String vaultName; + private String backupPolicyName; - public BaseBackupPolicyResourceImpl withExistingBackupVault(String vaultName, String resourceGroupName) { - this.vaultName = vaultName; + public BaseBackupPolicyResourceImpl withExistingBackupVault(String resourceGroupName, String vaultName) { this.resourceGroupName = resourceGroupName; + this.vaultName = vaultName; return this; } @@ -62,7 +66,7 @@ public BaseBackupPolicyResource create() { .serviceClient() .getBackupPolicies() .createOrUpdateWithResponse( - vaultName, resourceGroupName, backupPolicyName, this.innerModel(), Context.NONE) + resourceGroupName, vaultName, backupPolicyName, this.innerModel(), Context.NONE) .getValue(); return this; } @@ -72,7 +76,7 @@ public BaseBackupPolicyResource create(Context context) { serviceManager .serviceClient() .getBackupPolicies() - .createOrUpdateWithResponse(vaultName, resourceGroupName, backupPolicyName, this.innerModel(), context) + .createOrUpdateWithResponse(resourceGroupName, vaultName, backupPolicyName, this.innerModel(), context) .getValue(); return this; } @@ -94,7 +98,7 @@ public BaseBackupPolicyResource apply() { .serviceClient() .getBackupPolicies() .createOrUpdateWithResponse( - vaultName, resourceGroupName, backupPolicyName, this.innerModel(), Context.NONE) + resourceGroupName, vaultName, backupPolicyName, this.innerModel(), Context.NONE) .getValue(); return this; } @@ -104,7 +108,7 @@ public BaseBackupPolicyResource apply(Context context) { serviceManager .serviceClient() .getBackupPolicies() - .createOrUpdateWithResponse(vaultName, resourceGroupName, backupPolicyName, this.innerModel(), context) + .createOrUpdateWithResponse(resourceGroupName, vaultName, backupPolicyName, this.innerModel(), context) .getValue(); return this; } @@ -114,8 +118,8 @@ public BaseBackupPolicyResource apply(Context context) { com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "backupVaults"); this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "backupVaults"); this.backupPolicyName = Utils.getValueFromIdByName(innerObject.id(), "backupPolicies"); } @@ -124,7 +128,7 @@ public BaseBackupPolicyResource refresh() { serviceManager .serviceClient() .getBackupPolicies() - .getWithResponse(vaultName, resourceGroupName, backupPolicyName, Context.NONE) + .getWithResponse(resourceGroupName, vaultName, backupPolicyName, Context.NONE) .getValue(); return this; } @@ -134,7 +138,7 @@ public BaseBackupPolicyResource refresh(Context context) { serviceManager .serviceClient() .getBackupPolicies() - .getWithResponse(vaultName, resourceGroupName, backupPolicyName, context) + .getWithResponse(resourceGroupName, vaultName, backupPolicyName, context) .getValue(); return this; } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionClientBuilder.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionClientBuilder.java index 3b406729a3ef..ab6f501afa6d 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionClientBuilder.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionClientBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -67,34 +66,34 @@ public DataProtectionClientBuilder environment(AzureEnvironment environment) { } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the DataProtectionClientBuilder. */ - public DataProtectionClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public DataProtectionClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the DataProtectionClientBuilder. */ - public DataProtectionClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public DataProtectionClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -120,27 +119,26 @@ public DataProtectionClientBuilder serializerAdapter(SerializerAdapter serialize * @return an instance of DataProtectionClientImpl. */ public DataProtectionClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); DataProtectionClientImpl client = new DataProtectionClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionClientImpl.java index 9b21a94c02f4..b85b8f1d9843 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionClientImpl.java @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -22,17 +23,22 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.dataprotection.fluent.BackupInstancesClient; +import com.azure.resourcemanager.dataprotection.fluent.BackupInstancesExtensionRoutingsClient; import com.azure.resourcemanager.dataprotection.fluent.BackupPoliciesClient; import com.azure.resourcemanager.dataprotection.fluent.BackupVaultOperationResultsClient; import com.azure.resourcemanager.dataprotection.fluent.BackupVaultsClient; import com.azure.resourcemanager.dataprotection.fluent.DataProtectionClient; import com.azure.resourcemanager.dataprotection.fluent.DataProtectionOperationsClient; import com.azure.resourcemanager.dataprotection.fluent.DataProtectionsClient; +import com.azure.resourcemanager.dataprotection.fluent.DeletedBackupInstancesClient; +import com.azure.resourcemanager.dataprotection.fluent.DppResourceGuardProxiesClient; import com.azure.resourcemanager.dataprotection.fluent.ExportJobsClient; import com.azure.resourcemanager.dataprotection.fluent.ExportJobsOperationResultsClient; import com.azure.resourcemanager.dataprotection.fluent.JobsClient; import com.azure.resourcemanager.dataprotection.fluent.OperationResultsClient; +import com.azure.resourcemanager.dataprotection.fluent.OperationStatusBackupVaultContextsClient; import com.azure.resourcemanager.dataprotection.fluent.OperationStatusClient; +import com.azure.resourcemanager.dataprotection.fluent.OperationStatusResourceGroupContextsClient; import com.azure.resourcemanager.dataprotection.fluent.RecoveryPointsClient; import com.azure.resourcemanager.dataprotection.fluent.ResourceGuardsClient; import com.azure.resourcemanager.dataprotection.fluent.RestorableTimeRangesClient; @@ -42,15 +48,12 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** Initializes a new instance of the DataProtectionClientImpl type. */ @ServiceClient(builder = DataProtectionClientBuilder.class) public final class DataProtectionClientImpl implements DataProtectionClient { - private final ClientLogger logger = new ClientLogger(DataProtectionClientImpl.class); - /** The subscription Id. */ private final String subscriptionId; @@ -159,6 +162,30 @@ public OperationStatusClient getOperationStatus() { return this.operationStatus; } + /** The OperationStatusBackupVaultContextsClient object to access its operations. */ + private final OperationStatusBackupVaultContextsClient operationStatusBackupVaultContexts; + + /** + * Gets the OperationStatusBackupVaultContextsClient object to access its operations. + * + * @return the OperationStatusBackupVaultContextsClient object. + */ + public OperationStatusBackupVaultContextsClient getOperationStatusBackupVaultContexts() { + return this.operationStatusBackupVaultContexts; + } + + /** The OperationStatusResourceGroupContextsClient object to access its operations. */ + private final OperationStatusResourceGroupContextsClient operationStatusResourceGroupContexts; + + /** + * Gets the OperationStatusResourceGroupContextsClient object to access its operations. + * + * @return the OperationStatusResourceGroupContextsClient object. + */ + public OperationStatusResourceGroupContextsClient getOperationStatusResourceGroupContexts() { + return this.operationStatusResourceGroupContexts; + } + /** The BackupVaultOperationResultsClient object to access its operations. */ private final BackupVaultOperationResultsClient backupVaultOperationResults; @@ -219,6 +246,18 @@ public BackupInstancesClient getBackupInstances() { return this.backupInstances; } + /** The BackupInstancesExtensionRoutingsClient object to access its operations. */ + private final BackupInstancesExtensionRoutingsClient backupInstancesExtensionRoutings; + + /** + * Gets the BackupInstancesExtensionRoutingsClient object to access its operations. + * + * @return the BackupInstancesExtensionRoutingsClient object. + */ + public BackupInstancesExtensionRoutingsClient getBackupInstancesExtensionRoutings() { + return this.backupInstancesExtensionRoutings; + } + /** The RecoveryPointsClient object to access its operations. */ private final RecoveryPointsClient recoveryPoints; @@ -279,6 +318,18 @@ public ExportJobsOperationResultsClient getExportJobsOperationResults() { return this.exportJobsOperationResults; } + /** The DeletedBackupInstancesClient object to access its operations. */ + private final DeletedBackupInstancesClient deletedBackupInstances; + + /** + * Gets the DeletedBackupInstancesClient object to access its operations. + * + * @return the DeletedBackupInstancesClient object. + */ + public DeletedBackupInstancesClient getDeletedBackupInstances() { + return this.deletedBackupInstances; + } + /** The ResourceGuardsClient object to access its operations. */ private final ResourceGuardsClient resourceGuards; @@ -291,6 +342,18 @@ public ResourceGuardsClient getResourceGuards() { return this.resourceGuards; } + /** The DppResourceGuardProxiesClient object to access its operations. */ + private final DppResourceGuardProxiesClient dppResourceGuardProxies; + + /** + * Gets the DppResourceGuardProxiesClient object to access its operations. + * + * @return the DppResourceGuardProxiesClient object. + */ + public DppResourceGuardProxiesClient getDppResourceGuardProxies() { + return this.dppResourceGuardProxies; + } + /** * Initializes an instance of DataProtectionClient client. * @@ -313,21 +376,26 @@ public ResourceGuardsClient getResourceGuards() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-07-01"; + this.apiVersion = "2022-11-01-preview"; this.backupVaults = new BackupVaultsClientImpl(this); this.operationResults = new OperationResultsClientImpl(this); this.operationStatus = new OperationStatusClientImpl(this); + this.operationStatusBackupVaultContexts = new OperationStatusBackupVaultContextsClientImpl(this); + this.operationStatusResourceGroupContexts = new OperationStatusResourceGroupContextsClientImpl(this); this.backupVaultOperationResults = new BackupVaultOperationResultsClientImpl(this); this.dataProtections = new DataProtectionsClientImpl(this); this.dataProtectionOperations = new DataProtectionOperationsClientImpl(this); this.backupPolicies = new BackupPoliciesClientImpl(this); this.backupInstances = new BackupInstancesClientImpl(this); + this.backupInstancesExtensionRoutings = new BackupInstancesExtensionRoutingsClientImpl(this); this.recoveryPoints = new RecoveryPointsClientImpl(this); this.jobs = new JobsClientImpl(this); this.restorableTimeRanges = new RestorableTimeRangesClientImpl(this); this.exportJobs = new ExportJobsClientImpl(this); this.exportJobsOperationResults = new ExportJobsOperationResultsClientImpl(this); + this.deletedBackupInstances = new DeletedBackupInstancesClientImpl(this); this.resourceGuards = new ResourceGuardsClientImpl(this); + this.dppResourceGuardProxies = new DppResourceGuardProxiesClientImpl(this); } /** @@ -346,10 +414,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** @@ -413,7 +478,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -472,4 +537,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(DataProtectionClientImpl.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionOperationsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionOperationsClientImpl.java index 6055bbc399cf..2b860a909b76 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionOperationsClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionOperationsClientImpl.java @@ -25,7 +25,6 @@ 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.dataprotection.fluent.DataProtectionOperationsClient; import com.azure.resourcemanager.dataprotection.fluent.models.ClientDiscoveryValueForSingleApiInner; import com.azure.resourcemanager.dataprotection.models.ClientDiscoveryResponse; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in DataProtectionOperationsClient. */ public final class DataProtectionOperationsClientImpl implements DataProtectionOperationsClient { - private final ClientLogger logger = new ClientLogger(DataProtectionOperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final DataProtectionOperationsService service; @@ -59,7 +56,7 @@ public final class DataProtectionOperationsClientImpl implements DataProtectionO */ @Host("{$host}") @ServiceInterface(name = "DataProtectionClient") - private interface DataProtectionOperationsService { + public interface DataProtectionOperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.DataProtection/operations") @ExpectedResponses({200}) @@ -86,7 +83,7 @@ Mono> listNext( * * @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 clientDiscoveryResponse. + * @return clientDiscoveryResponse along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -119,7 +116,7 @@ private Mono> listSinglePag * @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 clientDiscoveryResponse. + * @return clientDiscoveryResponse along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -149,7 +146,7 @@ private Mono> listSinglePag * * @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 clientDiscoveryResponse. + * @return clientDiscoveryResponse as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -163,7 +160,7 @@ private PagedFlux listAsync() { * @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 clientDiscoveryResponse. + * @return clientDiscoveryResponse as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -176,7 +173,7 @@ private PagedFlux listAsync(Context conte * * @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 clientDiscoveryResponse. + * @return clientDiscoveryResponse as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -190,7 +187,7 @@ 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 clientDiscoveryResponse. + * @return clientDiscoveryResponse as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -200,11 +197,12 @@ public PagedIterable list(Context context /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 clientDiscoveryResponse. + * @return clientDiscoveryResponse along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -235,12 +233,13 @@ private Mono> listNextSingl /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 clientDiscoveryResponse. + * @return clientDiscoveryResponse along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync( diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionOperationsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionOperationsImpl.java index 114fdd3f24ab..661b14ac3f9f 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionOperationsImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionOperationsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.dataprotection.fluent.models.ClientDiscoveryValueForSingleApiInner; import com.azure.resourcemanager.dataprotection.models.ClientDiscoveryValueForSingleApi; import com.azure.resourcemanager.dataprotection.models.DataProtectionOperations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class DataProtectionOperationsImpl implements DataProtectionOperations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataProtectionOperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(DataProtectionOperationsImpl.class); private final DataProtectionOperationsClient innerClient; diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionsClientImpl.java index 3f10d955d562..bb1cf152b72a 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionsClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionsClientImpl.java @@ -22,7 +22,6 @@ 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.dataprotection.fluent.DataProtectionsClient; import com.azure.resourcemanager.dataprotection.fluent.models.FeatureValidationResponseBaseInner; import com.azure.resourcemanager.dataprotection.models.FeatureValidationRequestBase; @@ -30,8 +29,6 @@ /** An instance of this class provides access to all the operations defined in DataProtectionsClient. */ public final class DataProtectionsClientImpl implements DataProtectionsClient { - private final ClientLogger logger = new ClientLogger(DataProtectionsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final DataProtectionsService service; @@ -55,7 +52,7 @@ public final class DataProtectionsClientImpl implements DataProtectionsClient { */ @Host("{$host}") @ServiceInterface(name = "DataProtectionClient") - private interface DataProtectionsService { + public interface DataProtectionsService { @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}" @@ -80,7 +77,8 @@ Mono> checkFeatureSupport( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for Backup Feature support. + * @return base class for Backup Feature support along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkFeatureSupportWithResponseAsync( @@ -130,7 +128,8 @@ private Mono> checkFeatureSupportWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for Backup Feature support. + * @return base class for Backup Feature support along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkFeatureSupportWithResponseAsync( @@ -176,20 +175,13 @@ private Mono> checkFeatureSupportWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for Backup Feature support. + * @return base class for Backup Feature support on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkFeatureSupportAsync( String location, FeatureValidationRequestBase parameters) { return checkFeatureSupportWithResponseAsync(location, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -197,15 +189,16 @@ private Mono checkFeatureSupportAsync( * * @param location The location parameter. * @param parameters Feature support request object. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for Backup Feature support. + * @return base class for Backup Feature support along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FeatureValidationResponseBaseInner checkFeatureSupport( - String location, FeatureValidationRequestBase parameters) { - return checkFeatureSupportAsync(location, parameters).block(); + public Response checkFeatureSupportWithResponse( + String location, FeatureValidationRequestBase parameters, Context context) { + return checkFeatureSupportWithResponseAsync(location, parameters, context).block(); } /** @@ -213,15 +206,14 @@ public FeatureValidationResponseBaseInner checkFeatureSupport( * * @param location The location parameter. * @param parameters Feature support request object. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return base class for Backup Feature support. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkFeatureSupportWithResponse( - String location, FeatureValidationRequestBase parameters, Context context) { - return checkFeatureSupportWithResponseAsync(location, parameters, context).block(); + public FeatureValidationResponseBaseInner checkFeatureSupport( + String location, FeatureValidationRequestBase parameters) { + return checkFeatureSupportWithResponse(location, parameters, Context.NONE).getValue(); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionsImpl.java index dd2287e8677b..1b315ace4d4c 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionsImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionsImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.dataprotection.models.DataProtections; import com.azure.resourcemanager.dataprotection.models.FeatureValidationRequestBase; import com.azure.resourcemanager.dataprotection.models.FeatureValidationResponseBase; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class DataProtectionsImpl implements DataProtections { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataProtectionsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(DataProtectionsImpl.class); private final DataProtectionsClient innerClient; @@ -29,15 +28,6 @@ public DataProtectionsImpl( this.serviceManager = serviceManager; } - public FeatureValidationResponseBase checkFeatureSupport(String location, FeatureValidationRequestBase parameters) { - FeatureValidationResponseBaseInner inner = this.serviceClient().checkFeatureSupport(location, parameters); - if (inner != null) { - return new FeatureValidationResponseBaseImpl(inner, this.manager()); - } else { - return null; - } - } - public Response checkFeatureSupportWithResponse( String location, FeatureValidationRequestBase parameters, Context context) { Response inner = @@ -53,6 +43,15 @@ public Response checkFeatureSupportWithResponse( } } + public FeatureValidationResponseBase checkFeatureSupport(String location, FeatureValidationRequestBase parameters) { + FeatureValidationResponseBaseInner inner = this.serviceClient().checkFeatureSupport(location, parameters); + if (inner != null) { + return new FeatureValidationResponseBaseImpl(inner, this.manager()); + } else { + return null; + } + } + private DataProtectionsClient serviceClient() { return this.innerClient; } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstanceResourceImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstanceResourceImpl.java new file mode 100644 index 000000000000..6d0e790c746f --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstanceResourceImpl.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.dataprotection.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.dataprotection.fluent.models.DeletedBackupInstanceResourceInner; +import com.azure.resourcemanager.dataprotection.models.DeletedBackupInstance; +import com.azure.resourcemanager.dataprotection.models.DeletedBackupInstanceResource; + +public final class DeletedBackupInstanceResourceImpl implements DeletedBackupInstanceResource { + private DeletedBackupInstanceResourceInner innerObject; + + private final com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager; + + DeletedBackupInstanceResourceImpl( + DeletedBackupInstanceResourceInner innerObject, + com.azure.resourcemanager.dataprotection.DataProtectionManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public DeletedBackupInstance properties() { + return this.innerModel().properties(); + } + + public DeletedBackupInstanceResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dataprotection.DataProtectionManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesClientImpl.java new file mode 100644 index 000000000000..e77940bfb575 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesClientImpl.java @@ -0,0 +1,796 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.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.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dataprotection.fluent.DeletedBackupInstancesClient; +import com.azure.resourcemanager.dataprotection.fluent.models.DeletedBackupInstanceResourceInner; +import com.azure.resourcemanager.dataprotection.models.DeletedBackupInstanceResourceList; +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 DeletedBackupInstancesClient. */ +public final class DeletedBackupInstancesClientImpl implements DeletedBackupInstancesClient { + /** The proxy service used to perform REST calls. */ + private final DeletedBackupInstancesService service; + + /** The service client containing this operation class. */ + private final DataProtectionClientImpl client; + + /** + * Initializes an instance of DeletedBackupInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeletedBackupInstancesClientImpl(DataProtectionClientImpl client) { + this.service = + RestProxy + .create(DeletedBackupInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataProtectionClientDeletedBackupInstances to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataProtectionClient") + public interface DeletedBackupInstancesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/deletedBackupInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/deletedBackupInstances/{backupInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("backupInstanceName") String backupInstanceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/deletedBackupInstances/{backupInstanceName}/undelete") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> undelete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("backupInstanceName") String backupInstanceName, + @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 deleted backup instances belonging to a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deleted backup instances belonging to a backup vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink().toString(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets deleted backup instances belonging to a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deleted backup instances belonging to a backup vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink().toString(), + null)); + } + + /** + * Gets deleted backup instances belonging to a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deleted backup instances belonging to a backup vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets deleted backup instances belonging to a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deleted backup instances belonging to a backup vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String vaultName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets deleted backup instances belonging to a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deleted backup instances belonging to a backup vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName)); + } + + /** + * Gets deleted backup instances belonging to a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deleted backup instances belonging to a backup vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String vaultName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, context)); + } + + /** + * Gets a deleted backup instance with name in a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deleted backup instance with name in a backup vault along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a deleted backup instance with name in a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @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 a deleted backup instance with name in a backup vault along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + accept, + context); + } + + /** + * Gets a deleted backup instance with name in a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deleted backup instance with name in a backup vault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vaultName, String backupInstanceName) { + return getWithResponseAsync(resourceGroupName, vaultName, backupInstanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a deleted backup instance with name in a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @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 a deleted backup instance with name in a backup vault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, context).block(); + } + + /** + * Gets a deleted backup instance with name in a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deleted backup instance with name in a backup vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeletedBackupInstanceResourceInner get( + String resourceGroupName, String vaultName, String backupInstanceName) { + return getWithResponse(resourceGroupName, vaultName, backupInstanceName, Context.NONE).getValue(); + } + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> undeleteWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .undelete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> undeleteWithResponseAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (backupInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .undelete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + backupInstanceName, + accept, + context); + } + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUndeleteAsync( + String resourceGroupName, String vaultName, String backupInstanceName) { + Mono>> mono = + undeleteWithResponseAsync(resourceGroupName, vaultName, backupInstanceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUndeleteAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + undeleteWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUndelete( + String resourceGroupName, String vaultName, String backupInstanceName) { + return beginUndeleteAsync(resourceGroupName, vaultName, backupInstanceName).getSyncPoller(); + } + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUndelete( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + return beginUndeleteAsync(resourceGroupName, vaultName, backupInstanceName, context).getSyncPoller(); + } + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono undeleteAsync(String resourceGroupName, String vaultName, String backupInstanceName) { + return beginUndeleteAsync(resourceGroupName, vaultName, backupInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono undeleteAsync( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + return beginUndeleteAsync(resourceGroupName, vaultName, backupInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @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 undelete(String resourceGroupName, String vaultName, String backupInstanceName) { + undeleteAsync(resourceGroupName, vaultName, backupInstanceName).block(); + } + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @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 undelete(String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + undeleteAsync(resourceGroupName, vaultName, backupInstanceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 DeletedBackupInstance resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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().toString(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 DeletedBackupInstance resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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().toString(), + null)); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesImpl.java new file mode 100644 index 000000000000..646b308dbf81 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesImpl.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dataprotection.fluent.DeletedBackupInstancesClient; +import com.azure.resourcemanager.dataprotection.fluent.models.DeletedBackupInstanceResourceInner; +import com.azure.resourcemanager.dataprotection.models.DeletedBackupInstanceResource; +import com.azure.resourcemanager.dataprotection.models.DeletedBackupInstances; + +public final class DeletedBackupInstancesImpl implements DeletedBackupInstances { + private static final ClientLogger LOGGER = new ClientLogger(DeletedBackupInstancesImpl.class); + + private final DeletedBackupInstancesClient innerClient; + + private final com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager; + + public DeletedBackupInstancesImpl( + DeletedBackupInstancesClient innerClient, + com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vaultName); + return Utils.mapPage(inner, inner1 -> new DeletedBackupInstanceResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String vaultName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vaultName, context); + return Utils.mapPage(inner, inner1 -> new DeletedBackupInstanceResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, backupInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeletedBackupInstanceResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeletedBackupInstanceResource get(String resourceGroupName, String vaultName, String backupInstanceName) { + DeletedBackupInstanceResourceInner inner = + this.serviceClient().get(resourceGroupName, vaultName, backupInstanceName); + if (inner != null) { + return new DeletedBackupInstanceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void undelete(String resourceGroupName, String vaultName, String backupInstanceName) { + this.serviceClient().undelete(resourceGroupName, vaultName, backupInstanceName); + } + + public void undelete(String resourceGroupName, String vaultName, String backupInstanceName, Context context) { + this.serviceClient().undelete(resourceGroupName, vaultName, backupInstanceName, context); + } + + private DeletedBackupInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dataprotection.DataProtectionManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DppResourceGuardProxiesClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DppResourceGuardProxiesClientImpl.java new file mode 100644 index 000000000000..7002e98feb16 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DppResourceGuardProxiesClientImpl.java @@ -0,0 +1,1117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.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.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.dataprotection.fluent.DppResourceGuardProxiesClient; +import com.azure.resourcemanager.dataprotection.fluent.models.ResourceGuardProxyBaseResourceInner; +import com.azure.resourcemanager.dataprotection.fluent.models.UnlockDeleteResponseInner; +import com.azure.resourcemanager.dataprotection.models.ResourceGuardProxyBaseResourceList; +import com.azure.resourcemanager.dataprotection.models.UnlockDeleteRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DppResourceGuardProxiesClient. */ +public final class DppResourceGuardProxiesClientImpl implements DppResourceGuardProxiesClient { + /** The proxy service used to perform REST calls. */ + private final DppResourceGuardProxiesService service; + + /** The service client containing this operation class. */ + private final DataProtectionClientImpl client; + + /** + * Initializes an instance of DppResourceGuardProxiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DppResourceGuardProxiesClientImpl(DataProtectionClientImpl client) { + this.service = + RestProxy + .create(DppResourceGuardProxiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataProtectionClientDppResourceGuardProxies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataProtectionClient") + public interface DppResourceGuardProxiesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/backupResourceGuardProxies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGuardProxyName") String resourceGuardProxyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGuardProxyName") String resourceGuardProxyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResourceGuardProxyBaseResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGuardProxyName") String resourceGuardProxyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}/unlockDelete") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> unlockDelete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGuardProxyName") String resourceGuardProxyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UnlockDeleteRequest 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); + } + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ResourceGuardProxyBase resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink().toString(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ResourceGuardProxyBase resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink().toString(), + null)); + } + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ResourceGuardProxyBase resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ResourceGuardProxyBase resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String vaultName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ResourceGuardProxyBase resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName)); + } + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ResourceGuardProxyBase resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String vaultName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, context)); + } + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String resourceGuardProxyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (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.getSubscriptionId(), + resourceGroupName, + vaultName, + resourceGuardProxyName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, 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 (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (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.getSubscriptionId(), + resourceGroupName, + vaultName, + resourceGuardProxyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vaultName, String resourceGuardProxyName) { + return getWithResponseAsync(resourceGroupName, vaultName, resourceGuardProxyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String resourceGuardProxyName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, resourceGuardProxyName, context).block(); + } + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 resourceGroupName, String vaultName, String resourceGuardProxyName) { + return getWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, Context.NONE).getValue(); + } + + /** + * The put operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + ResourceGuardProxyBaseResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (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 + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + resourceGuardProxyName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The put operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + ResourceGuardProxyBaseResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (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 + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + resourceGuardProxyName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The put operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + ResourceGuardProxyBaseResourceInner parameters) { + return putWithResponseAsync(resourceGroupName, vaultName, resourceGuardProxyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The put operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + ResourceGuardProxyBaseResourceInner parameters, + Context context) { + return putWithResponseAsync(resourceGroupName, vaultName, resourceGuardProxyName, parameters, context).block(); + } + + /** + * The put operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceGuardProxyBaseResourceInner put( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + ResourceGuardProxyBaseResourceInner parameters) { + return putWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, parameters, Context.NONE) + .getValue(); + } + + /** + * The delete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String vaultName, String resourceGuardProxyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (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.getSubscriptionId(), + resourceGroupName, + vaultName, + resourceGuardProxyName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The delete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String vaultName, 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 (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (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.getSubscriptionId(), + resourceGroupName, + vaultName, + resourceGuardProxyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The delete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vaultName, String resourceGuardProxyName) { + return deleteWithResponseAsync(resourceGroupName, vaultName, resourceGuardProxyName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * The delete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String vaultName, String resourceGuardProxyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, vaultName, resourceGuardProxyName, context).block(); + } + + /** + * The delete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 resourceGroupName, String vaultName, String resourceGuardProxyName) { + deleteWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, Context.NONE); + } + + /** + * The unlockDelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> unlockDeleteWithResponseAsync( + String resourceGroupName, String vaultName, 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 (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (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.getSubscriptionId(), + resourceGroupName, + vaultName, + resourceGuardProxyName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The unlockDelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> unlockDeleteWithResponseAsync( + String resourceGroupName, + String vaultName, + 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 (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (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.getSubscriptionId(), + resourceGroupName, + vaultName, + resourceGuardProxyName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The unlockDelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono unlockDeleteAsync( + String resourceGroupName, String vaultName, String resourceGuardProxyName, UnlockDeleteRequest parameters) { + return unlockDeleteWithResponseAsync(resourceGroupName, vaultName, resourceGuardProxyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The unlockDelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response unlockDeleteWithResponse( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + UnlockDeleteRequest parameters, + Context context) { + return unlockDeleteWithResponseAsync(resourceGroupName, vaultName, resourceGuardProxyName, parameters, context) + .block(); + } + + /** + * The unlockDelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 resourceGroupName, String vaultName, String resourceGuardProxyName, UnlockDeleteRequest parameters) { + return unlockDeleteWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, parameters, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 ResourceGuardProxyBase resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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().toString(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 ResourceGuardProxyBase resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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().toString(), + null)); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DppResourceGuardProxiesImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DppResourceGuardProxiesImpl.java new file mode 100644 index 000000000000..44d58ddb918b --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DppResourceGuardProxiesImpl.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dataprotection.fluent.DppResourceGuardProxiesClient; +import com.azure.resourcemanager.dataprotection.fluent.models.ResourceGuardProxyBaseResourceInner; +import com.azure.resourcemanager.dataprotection.fluent.models.UnlockDeleteResponseInner; +import com.azure.resourcemanager.dataprotection.models.DppResourceGuardProxies; +import com.azure.resourcemanager.dataprotection.models.ResourceGuardProxyBaseResource; +import com.azure.resourcemanager.dataprotection.models.UnlockDeleteRequest; +import com.azure.resourcemanager.dataprotection.models.UnlockDeleteResponse; + +public final class DppResourceGuardProxiesImpl implements DppResourceGuardProxies { + private static final ClientLogger LOGGER = new ClientLogger(DppResourceGuardProxiesImpl.class); + + private final DppResourceGuardProxiesClient innerClient; + + private final com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager; + + public DppResourceGuardProxiesImpl( + DppResourceGuardProxiesClient innerClient, + com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vaultName); + return Utils.mapPage(inner, inner1 -> new ResourceGuardProxyBaseResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String vaultName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vaultName, context); + return Utils.mapPage(inner, inner1 -> new ResourceGuardProxyBaseResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String resourceGuardProxyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, 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 get( + String resourceGroupName, String vaultName, String resourceGuardProxyName) { + ResourceGuardProxyBaseResourceInner inner = + this.serviceClient().get(resourceGroupName, vaultName, resourceGuardProxyName); + if (inner != null) { + return new ResourceGuardProxyBaseResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse( + String resourceGroupName, String vaultName, String resourceGuardProxyName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, context); + } + + public void delete(String resourceGroupName, String vaultName, String resourceGuardProxyName) { + this.serviceClient().delete(resourceGroupName, vaultName, resourceGuardProxyName); + } + + public Response unlockDeleteWithResponse( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + UnlockDeleteRequest parameters, + Context context) { + Response inner = + this + .serviceClient() + .unlockDeleteWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UnlockDeleteResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UnlockDeleteResponse unlockDelete( + String resourceGroupName, String vaultName, String resourceGuardProxyName, UnlockDeleteRequest parameters) { + UnlockDeleteResponseInner inner = + this.serviceClient().unlockDelete(resourceGroupName, vaultName, resourceGuardProxyName, parameters); + if (inner != null) { + return new UnlockDeleteResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ResourceGuardProxyBaseResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); + } + String resourceGuardProxyName = Utils.getValueFromIdByName(id, "backupResourceGuardProxies"); + if (resourceGuardProxyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backupResourceGuardProxies'.", + id))); + } + return this.getWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); + } + String resourceGuardProxyName = Utils.getValueFromIdByName(id, "backupResourceGuardProxies"); + if (resourceGuardProxyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backupResourceGuardProxies'.", + id))); + } + return this.getWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); + } + String resourceGuardProxyName = Utils.getValueFromIdByName(id, "backupResourceGuardProxies"); + if (resourceGuardProxyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backupResourceGuardProxies'.", + id))); + } + this.deleteWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "backupVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id))); + } + String resourceGuardProxyName = Utils.getValueFromIdByName(id, "backupResourceGuardProxies"); + if (resourceGuardProxyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backupResourceGuardProxies'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, context); + } + + private DppResourceGuardProxiesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dataprotection.DataProtectionManager manager() { + return this.serviceManager; + } + + public ResourceGuardProxyBaseResourceImpl define(String name) { + return new ResourceGuardProxyBaseResourceImpl(name, this.manager()); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsClientImpl.java index 0f71214607b7..3a74b7b9c3ce 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsClientImpl.java @@ -22,7 +22,6 @@ 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.dataprotection.fluent.ExportJobsClient; @@ -32,8 +31,6 @@ /** An instance of this class provides access to all the operations defined in ExportJobsClient. */ public final class ExportJobsClientImpl implements ExportJobsClient { - private final ClientLogger logger = new ClientLogger(ExportJobsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ExportJobsService service; @@ -57,7 +54,7 @@ public final class ExportJobsClientImpl implements ExportJobsClient { */ @Host("{$host}") @ServiceInterface(name = "DataProtectionClient") - private interface ExportJobsService { + public interface ExportJobsService { @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" @@ -82,7 +79,7 @@ Mono>> trigger( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> triggerWithResponseAsync(String resourceGroupName, String vaultName) { @@ -130,7 +127,7 @@ private Mono>> triggerWithResponseAsync(String resourc * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> triggerWithResponseAsync( @@ -175,14 +172,15 @@ private Mono>> triggerWithResponseAsync( * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTriggerAsync(String resourceGroupName, String vaultName) { Mono>> mono = triggerWithResponseAsync(resourceGroupName, vaultName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -194,7 +192,7 @@ private PollerFlux, Void> beginTriggerAsync(String resourceGrou * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTriggerAsync( @@ -214,7 +212,7 @@ private PollerFlux, Void> beginTriggerAsync( * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTrigger(String resourceGroupName, String vaultName) { @@ -230,7 +228,7 @@ public SyncPoller, Void> beginTrigger(String resourceGroupName, * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTrigger( @@ -246,7 +244,7 @@ public SyncPoller, Void> beginTrigger( * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono triggerAsync(String resourceGroupName, String vaultName) { @@ -262,7 +260,7 @@ private Mono triggerAsync(String resourceGroupName, String vaultName) { * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono triggerAsync(String resourceGroupName, String vaultName, Context context) { diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsImpl.java index 7af592eaa57f..38570717c214 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsImpl.java @@ -8,10 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.fluent.ExportJobsClient; import com.azure.resourcemanager.dataprotection.models.ExportJobs; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ExportJobsImpl implements ExportJobs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportJobsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ExportJobsImpl.class); private final ExportJobsClient innerClient; diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsOperationResultsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsOperationResultsClientImpl.java index e9334f24905b..bd7b4c7aa28c 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsOperationResultsClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsOperationResultsClientImpl.java @@ -21,15 +21,12 @@ 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.dataprotection.fluent.ExportJobsOperationResultsClient; import com.azure.resourcemanager.dataprotection.fluent.models.ExportJobsResultInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in ExportJobsOperationResultsClient. */ public final class ExportJobsOperationResultsClientImpl implements ExportJobsOperationResultsClient { - private final ClientLogger logger = new ClientLogger(ExportJobsOperationResultsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ExportJobsOperationResultsService service; @@ -55,7 +52,7 @@ public final class ExportJobsOperationResultsClientImpl implements ExportJobsOpe */ @Host("{$host}") @ServiceInterface(name = "DataProtectionClient") - private interface ExportJobsOperationResultsService { + public interface ExportJobsOperationResultsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" @@ -84,7 +81,8 @@ Mono> get( * @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 operation result of operation triggered by Export Jobs API. + * @return the operation result of operation triggered by Export Jobs API along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -140,7 +138,8 @@ private Mono> getWithResponseAsync( * @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 operation result of operation triggered by Export Jobs API. + * @return the operation result of operation triggered by Export Jobs API along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -192,19 +191,12 @@ private Mono> getWithResponseAsync( * @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 operation result of operation triggered by Export Jobs API. + * @return the operation result of operation triggered by Export Jobs API on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String vaultName, String operationId) { return getWithResponseAsync(resourceGroupName, vaultName, operationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -215,14 +207,16 @@ private Mono getAsync(String resourceGroupName, String va * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. * @param operationId OperationID which represents the export job. + * @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 operation result of operation triggered by Export Jobs API. + * @return the operation result of operation triggered by Export Jobs API along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExportJobsResultInner get(String resourceGroupName, String vaultName, String operationId) { - return getAsync(resourceGroupName, vaultName, operationId).block(); + public Response getWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, operationId, context).block(); } /** @@ -233,15 +227,13 @@ public ExportJobsResultInner get(String resourceGroupName, String vaultName, Str * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. * @param operationId OperationID which represents the export job. - * @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 operation result of operation triggered by Export Jobs API. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String vaultName, String operationId, Context context) { - return getWithResponseAsync(resourceGroupName, vaultName, operationId, context).block(); + public ExportJobsResultInner get(String resourceGroupName, String vaultName, String operationId) { + return getWithResponse(resourceGroupName, vaultName, operationId, Context.NONE).getValue(); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsOperationResultsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsOperationResultsImpl.java index 582451cf433a..553e0f713dda 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsOperationResultsImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ExportJobsOperationResultsImpl.java @@ -12,10 +12,9 @@ import com.azure.resourcemanager.dataprotection.fluent.models.ExportJobsResultInner; import com.azure.resourcemanager.dataprotection.models.ExportJobsOperationResults; import com.azure.resourcemanager.dataprotection.models.ExportJobsResult; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ExportJobsOperationResultsImpl implements ExportJobsOperationResults { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportJobsOperationResultsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ExportJobsOperationResultsImpl.class); private final ExportJobsOperationResultsClient innerClient; @@ -28,15 +27,6 @@ public ExportJobsOperationResultsImpl( this.serviceManager = serviceManager; } - public ExportJobsResult get(String resourceGroupName, String vaultName, String operationId) { - ExportJobsResultInner inner = this.serviceClient().get(resourceGroupName, vaultName, operationId); - if (inner != null) { - return new ExportJobsResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String vaultName, String operationId, Context context) { Response inner = @@ -52,6 +42,15 @@ public Response getWithResponse( } } + public ExportJobsResult get(String resourceGroupName, String vaultName, String operationId) { + ExportJobsResultInner inner = this.serviceClient().get(resourceGroupName, vaultName, operationId); + if (inner != null) { + return new ExportJobsResultImpl(inner, this.manager()); + } else { + return null; + } + } + private ExportJobsOperationResultsClient serviceClient() { return this.innerClient; } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/JobsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/JobsClientImpl.java index 9b9e7f019fee..e429e8234d99 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/JobsClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/JobsClientImpl.java @@ -25,7 +25,6 @@ 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.dataprotection.fluent.JobsClient; import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupJobResourceInner; import com.azure.resourcemanager.dataprotection.models.AzureBackupJobResourceList; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in JobsClient. */ public final class JobsClientImpl implements JobsClient { - private final ClientLogger logger = new ClientLogger(JobsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final JobsService service; @@ -57,7 +54,7 @@ public final class JobsClientImpl implements JobsClient { */ @Host("{$host}") @ServiceInterface(name = "DataProtectionClient") - private interface JobsService { + public interface JobsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" @@ -108,7 +105,8 @@ Mono> listNext( * @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 AzureBackup Job resources. + * @return list of AzureBackup Job resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -152,7 +150,7 @@ private Mono> listSinglePageAsync( res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -166,7 +164,8 @@ private Mono> listSinglePageAsync( * @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 AzureBackup Job resources. + * @return list of AzureBackup Job resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -208,7 +207,7 @@ private Mono> listSinglePageAsync( res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } @@ -220,7 +219,7 @@ private Mono> listSinglePageAsync( * @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 AzureBackup Job resources. + * @return list of AzureBackup Job resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String vaultName) { @@ -237,7 +236,7 @@ private PagedFlux listAsync(String resourceGroupNam * @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 AzureBackup Job resources. + * @return list of AzureBackup Job resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -255,7 +254,7 @@ private PagedFlux listAsync( * @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 AzureBackup Job resources. + * @return list of AzureBackup Job resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String vaultName) { @@ -271,7 +270,7 @@ public PagedIterable list(String resourceGroupName, * @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 AzureBackup Job resources. + * @return list of AzureBackup Job resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -288,7 +287,7 @@ 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 a job with id in a backup vault. + * @return a job with id in a backup vault along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -342,7 +341,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a job with id in a backup vault. + * @return a job with id in a backup vault along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -392,19 +391,12 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a job with id in a backup vault. + * @return a job with id in a backup vault on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String vaultName, String jobId) { return getWithResponseAsync(resourceGroupName, vaultName, jobId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -413,14 +405,16 @@ private Mono getAsync(String resourceGroupName, Str * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. * @param jobId The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + * @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 a job with id in a backup vault. + * @return a job with id in a backup vault along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AzureBackupJobResourceInner get(String resourceGroupName, String vaultName, String jobId) { - return getAsync(resourceGroupName, vaultName, jobId).block(); + public Response getWithResponse( + String resourceGroupName, String vaultName, String jobId, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, jobId, context).block(); } /** @@ -429,26 +423,26 @@ public AzureBackupJobResourceInner get(String resourceGroupName, String vaultNam * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. * @param jobId The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * @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 a job with id in a backup vault. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String vaultName, String jobId, Context context) { - return getWithResponseAsync(resourceGroupName, vaultName, jobId, context).block(); + public AzureBackupJobResourceInner get(String resourceGroupName, String vaultName, String jobId) { + return getWithResponse(resourceGroupName, vaultName, jobId, Context.NONE).getValue(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 AzureBackup Job resources. + * @return list of AzureBackup Job resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -471,7 +465,7 @@ private Mono> listNextSinglePageAsync res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -479,12 +473,14 @@ private Mono> listNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 AzureBackup Job resources. + * @return list of AzureBackup Job resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -508,7 +504,7 @@ private Mono> listNextSinglePageAsync res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/JobsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/JobsImpl.java index 40eed436900a..a6a3b8c5988f 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/JobsImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/JobsImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupJobResourceInner; import com.azure.resourcemanager.dataprotection.models.AzureBackupJobResource; import com.azure.resourcemanager.dataprotection.models.Jobs; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class JobsImpl implements Jobs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(JobsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(JobsImpl.class); private final JobsClient innerClient; @@ -39,15 +38,6 @@ public PagedIterable list(String resourceGroupName, Stri return Utils.mapPage(inner, inner1 -> new AzureBackupJobResourceImpl(inner1, this.manager())); } - public AzureBackupJobResource get(String resourceGroupName, String vaultName, String jobId) { - AzureBackupJobResourceInner inner = this.serviceClient().get(resourceGroupName, vaultName, jobId); - if (inner != null) { - return new AzureBackupJobResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String vaultName, String jobId, Context context) { Response inner = @@ -63,6 +53,15 @@ public Response getWithResponse( } } + public AzureBackupJobResource get(String resourceGroupName, String vaultName, String jobId) { + AzureBackupJobResourceInner inner = this.serviceClient().get(resourceGroupName, vaultName, jobId); + if (inner != null) { + return new AzureBackupJobResourceImpl(inner, this.manager()); + } else { + return null; + } + } + private JobsClient serviceClient() { return this.innerClient; } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationResultsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationResultsClientImpl.java index e1c97bfa3aa1..b00a3bf03deb 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationResultsClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationResultsClientImpl.java @@ -20,7 +20,6 @@ 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.dataprotection.fluent.OperationResultsClient; import com.azure.resourcemanager.dataprotection.fluent.models.OperationJobExtendedInfoInner; import com.azure.resourcemanager.dataprotection.models.OperationResultsGetResponse; @@ -28,8 +27,6 @@ /** An instance of this class provides access to all the operations defined in OperationResultsClient. */ public final class OperationResultsClientImpl implements OperationResultsClient { - private final ClientLogger logger = new ClientLogger(OperationResultsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationResultsService service; @@ -53,7 +50,7 @@ public final class OperationResultsClientImpl implements OperationResultsClient */ @Host("{$host}") @ServiceInterface(name = "DataProtectionClient") - private interface OperationResultsService { + public interface OperationResultsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationResults" @@ -71,14 +68,16 @@ Mono get( } /** - * Gets the operation result for a resource. + * Gets the operation status for a resource. + * + *

Gets the operation result for a resource. * * @param operationId The operationId parameter. * @param location The location 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 operation result for a resource. + * @return the operation result for a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getWithResponseAsync(String operationId, String location) { @@ -117,7 +116,9 @@ private Mono getWithResponseAsync(String operationI } /** - * Gets the operation result for a resource. + * Gets the operation status for a resource. + * + *

Gets the operation result for a resource. * * @param operationId The operationId parameter. * @param location The location parameter. @@ -125,7 +126,7 @@ private Mono getWithResponseAsync(String operationI * @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 operation result for a resource. + * @return the operation result for a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getWithResponseAsync( @@ -162,56 +163,54 @@ private Mono getWithResponseAsync( } /** - * Gets the operation result for a resource. + * Gets the operation status for a resource. + * + *

Gets the operation result for a resource. * * @param operationId The operationId parameter. * @param location The location 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 operation result for a resource. + * @return the operation result for a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String operationId, String location) { - return getWithResponseAsync(operationId, location) - .flatMap( - (OperationResultsGetResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getWithResponseAsync(operationId, location).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets the operation result for a resource. + * Gets the operation status for a resource. + * + *

Gets the operation result for a resource. * * @param operationId The operationId parameter. * @param location The location 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 operation result for a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationJobExtendedInfoInner get(String operationId, String location) { - return getAsync(operationId, location).block(); + public OperationResultsGetResponse getWithResponse(String operationId, String location, Context context) { + return getWithResponseAsync(operationId, location, context).block(); } /** - * Gets the operation result for a resource. + * Gets the operation status for a resource. + * + *

Gets the operation result for a resource. * * @param operationId The operationId parameter. * @param location The location 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 operation result for a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationResultsGetResponse getWithResponse(String operationId, String location, Context context) { - return getWithResponseAsync(operationId, location, context).block(); + public OperationJobExtendedInfoInner get(String operationId, String location) { + return getWithResponse(operationId, location, Context.NONE).getValue(); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationResultsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationResultsImpl.java index 1e0fb849fea6..f55ba404e21e 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationResultsImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationResultsImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.dataprotection.models.OperationJobExtendedInfo; import com.azure.resourcemanager.dataprotection.models.OperationResults; import com.azure.resourcemanager.dataprotection.models.OperationResultsGetResponse; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationResultsImpl implements OperationResults { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResultsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationResultsImpl.class); private final OperationResultsClient innerClient; @@ -29,15 +28,6 @@ public OperationResultsImpl( this.serviceManager = serviceManager; } - public OperationJobExtendedInfo get(String operationId, String location) { - OperationJobExtendedInfoInner inner = this.serviceClient().get(operationId, location); - if (inner != null) { - return new OperationJobExtendedInfoImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String operationId, String location, Context context) { OperationResultsGetResponse inner = this.serviceClient().getWithResponse(operationId, location, context); if (inner != null) { @@ -51,6 +41,15 @@ public Response getWithResponse(String operationId, St } } + public OperationJobExtendedInfo get(String operationId, String location) { + OperationJobExtendedInfoInner inner = this.serviceClient().get(operationId, location); + if (inner != null) { + return new OperationJobExtendedInfoImpl(inner, this.manager()); + } else { + return null; + } + } + private OperationResultsClient serviceClient() { return this.innerClient; } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusBackupVaultContextsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusBackupVaultContextsClientImpl.java new file mode 100644 index 000000000000..c892d0fd0d4a --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusBackupVaultContextsClientImpl.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.dataprotection.fluent.OperationStatusBackupVaultContextsClient; +import com.azure.resourcemanager.dataprotection.fluent.models.OperationResourceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationStatusBackupVaultContextsClient. + */ +public final class OperationStatusBackupVaultContextsClientImpl implements OperationStatusBackupVaultContextsClient { + /** The proxy service used to perform REST calls. */ + private final OperationStatusBackupVaultContextsService service; + + /** The service client containing this operation class. */ + private final DataProtectionClientImpl client; + + /** + * Initializes an instance of OperationStatusBackupVaultContextsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationStatusBackupVaultContextsClientImpl(DataProtectionClientImpl client) { + this.service = + RestProxy + .create( + OperationStatusBackupVaultContextsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataProtectionClientOperationStatusBackupVaultContexts to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataProtectionClient") + public interface OperationStatusBackupVaultContextsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/backupVaults/{vaultName}/operationStatus/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the operation status for an operation over a BackupVault's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 operation status for an operation over a BackupVault's context along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the operation status for an operation over a BackupVault's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 operation status for an operation over a BackupVault's context along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, 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 (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + operationId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the operation status for an operation over a BackupVault's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 operation status for an operation over a BackupVault's context on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, String operationId) { + return getWithResponseAsync(resourceGroupName, vaultName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the operation status for an operation over a BackupVault's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 operation status for an operation over a BackupVault's context along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, operationId, context).block(); + } + + /** + * Gets the operation status for an operation over a BackupVault's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 operation status for an operation over a BackupVault's context. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResourceInner get(String resourceGroupName, String vaultName, String operationId) { + return getWithResponse(resourceGroupName, vaultName, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusBackupVaultContextsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusBackupVaultContextsImpl.java new file mode 100644 index 000000000000..29fe80f3cbe1 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusBackupVaultContextsImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.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.dataprotection.fluent.OperationStatusBackupVaultContextsClient; +import com.azure.resourcemanager.dataprotection.fluent.models.OperationResourceInner; +import com.azure.resourcemanager.dataprotection.models.OperationResource; +import com.azure.resourcemanager.dataprotection.models.OperationStatusBackupVaultContexts; + +public final class OperationStatusBackupVaultContextsImpl implements OperationStatusBackupVaultContexts { + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusBackupVaultContextsImpl.class); + + private final OperationStatusBackupVaultContextsClient innerClient; + + private final com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager; + + public OperationStatusBackupVaultContextsImpl( + OperationStatusBackupVaultContextsClient innerClient, + com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationResource get(String resourceGroupName, String vaultName, String operationId) { + OperationResourceInner inner = this.serviceClient().get(resourceGroupName, vaultName, operationId); + if (inner != null) { + return new OperationResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private OperationStatusBackupVaultContextsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dataprotection.DataProtectionManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusClientImpl.java index 96d2d67a1e22..17d731770f18 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusClientImpl.java @@ -21,15 +21,12 @@ 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.dataprotection.fluent.OperationStatusClient; import com.azure.resourcemanager.dataprotection.fluent.models.OperationResourceInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationStatusClient. */ public final class OperationStatusClientImpl implements OperationStatusClient { - private final ClientLogger logger = new ClientLogger(OperationStatusClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationStatusService service; @@ -53,7 +50,7 @@ public final class OperationStatusClientImpl implements OperationStatusClient { */ @Host("{$host}") @ServiceInterface(name = "DataProtectionClient") - private interface OperationStatusService { + public interface OperationStatusService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationStatus" @@ -78,7 +75,7 @@ Mono> get( * @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 operation status for a resource. + * @return the operation status for a resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String location, String operationId) { @@ -125,7 +122,7 @@ private Mono> getWithResponseAsync(String locat * @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 operation status for a resource. + * @return the operation status for a resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -169,19 +166,11 @@ private Mono> getWithResponseAsync( * @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 operation status for a resource. + * @return the operation status for a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String location, String operationId) { - return getWithResponseAsync(location, operationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getWithResponseAsync(location, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -189,14 +178,15 @@ private Mono getAsync(String location, String operationI * * @param location The location parameter. * @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 operation status for a resource. + * @return the operation status for a resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationResourceInner get(String location, String operationId) { - return getAsync(location, operationId).block(); + public Response getWithResponse(String location, String operationId, Context context) { + return getWithResponseAsync(location, operationId, context).block(); } /** @@ -204,14 +194,13 @@ public OperationResourceInner get(String location, String operationId) { * * @param location The location parameter. * @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 operation status for a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String location, String operationId, Context context) { - return getWithResponseAsync(location, operationId, context).block(); + public OperationResourceInner get(String location, String operationId) { + return getWithResponse(location, operationId, Context.NONE).getValue(); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusImpl.java index 33b77df3fb68..5e5aca72effc 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusImpl.java @@ -12,10 +12,9 @@ import com.azure.resourcemanager.dataprotection.fluent.models.OperationResourceInner; import com.azure.resourcemanager.dataprotection.models.OperationResource; import com.azure.resourcemanager.dataprotection.models.OperationStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationStatusImpl implements OperationStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusImpl.class); private final OperationStatusClient innerClient; @@ -28,15 +27,6 @@ public OperationStatusImpl( this.serviceManager = serviceManager; } - public OperationResource get(String location, String operationId) { - OperationResourceInner inner = this.serviceClient().get(location, operationId); - if (inner != null) { - return new OperationResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String location, String operationId, Context context) { Response inner = this.serviceClient().getWithResponse(location, operationId, context); if (inner != null) { @@ -50,6 +40,15 @@ public Response getWithResponse(String location, String opera } } + public OperationResource get(String location, String operationId) { + OperationResourceInner inner = this.serviceClient().get(location, operationId); + if (inner != null) { + return new OperationResourceImpl(inner, this.manager()); + } else { + return null; + } + } + private OperationStatusClient serviceClient() { return this.innerClient; } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusResourceGroupContextsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusResourceGroupContextsClientImpl.java new file mode 100644 index 000000000000..ae22676484a0 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusResourceGroupContextsClientImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.dataprotection.fluent.OperationStatusResourceGroupContextsClient; +import com.azure.resourcemanager.dataprotection.fluent.models.OperationResourceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * OperationStatusResourceGroupContextsClient. + */ +public final class OperationStatusResourceGroupContextsClientImpl + implements OperationStatusResourceGroupContextsClient { + /** The proxy service used to perform REST calls. */ + private final OperationStatusResourceGroupContextsService service; + + /** The service client containing this operation class. */ + private final DataProtectionClientImpl client; + + /** + * Initializes an instance of OperationStatusResourceGroupContextsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationStatusResourceGroupContextsClientImpl(DataProtectionClientImpl client) { + this.service = + RestProxy + .create( + OperationStatusResourceGroupContextsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataProtectionClientOperationStatusResourceGroupContexts to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataProtectionClient") + public interface OperationStatusResourceGroupContextsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" + + "/operationStatus/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the operation status for an operation over a ResourceGroup's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @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 operation status for an operation over a ResourceGroup's context along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() 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 (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceGroupName, + this.client.getSubscriptionId(), + operationId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the operation status for an operation over a ResourceGroup's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @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 operation status for an operation over a ResourceGroup's context along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, 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 (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 (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceGroupName, + this.client.getSubscriptionId(), + operationId, + accept, + context); + } + + /** + * Gets the operation status for an operation over a ResourceGroup's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @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 operation status for an operation over a ResourceGroup's context on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String operationId) { + return getByResourceGroupWithResponseAsync(resourceGroupName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the operation status for an operation over a ResourceGroup's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @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 operation status for an operation over a ResourceGroup's context along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String operationId, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, operationId, context).block(); + } + + /** + * Gets the operation status for an operation over a ResourceGroup's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @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 operation status for an operation over a ResourceGroup's context. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResourceInner getByResourceGroup(String resourceGroupName, String operationId) { + return getByResourceGroupWithResponse(resourceGroupName, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusResourceGroupContextsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusResourceGroupContextsImpl.java new file mode 100644 index 000000000000..927457bd0eee --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/OperationStatusResourceGroupContextsImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.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.dataprotection.fluent.OperationStatusResourceGroupContextsClient; +import com.azure.resourcemanager.dataprotection.fluent.models.OperationResourceInner; +import com.azure.resourcemanager.dataprotection.models.OperationResource; +import com.azure.resourcemanager.dataprotection.models.OperationStatusResourceGroupContexts; + +public final class OperationStatusResourceGroupContextsImpl implements OperationStatusResourceGroupContexts { + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResourceGroupContextsImpl.class); + + private final OperationStatusResourceGroupContextsClient innerClient; + + private final com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager; + + public OperationStatusResourceGroupContextsImpl( + OperationStatusResourceGroupContextsClient innerClient, + com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String operationId, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationResource getByResourceGroup(String resourceGroupName, String operationId) { + OperationResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, operationId); + if (inner != null) { + return new OperationResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private OperationStatusResourceGroupContextsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dataprotection.DataProtectionManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RecoveryPointsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RecoveryPointsClientImpl.java index bea162e175a8..4cb51344f0f2 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RecoveryPointsClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RecoveryPointsClientImpl.java @@ -25,7 +25,6 @@ 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.dataprotection.fluent.RecoveryPointsClient; import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupRecoveryPointResourceInner; import com.azure.resourcemanager.dataprotection.models.AzureBackupRecoveryPointResourceList; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in RecoveryPointsClient. */ public final class RecoveryPointsClientImpl implements RecoveryPointsClient { - private final ClientLogger logger = new ClientLogger(RecoveryPointsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final RecoveryPointsService service; @@ -58,7 +55,7 @@ public final class RecoveryPointsClientImpl implements RecoveryPointsClient { */ @Host("{$host}") @ServiceInterface(name = "DataProtectionClient") - private interface RecoveryPointsService { + public interface RecoveryPointsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" @@ -68,9 +65,9 @@ private interface RecoveryPointsService { Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, @@ -86,9 +83,9 @@ 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, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Accept") String accept, @@ -108,38 +105,39 @@ Mono> listNext( /** * Returns a list of Recovery Points for a DataSource in a vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 azureBackupRecoveryPointResourceList. + * @return azureBackupRecoveryPointResourceList along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String vaultName, String resourceGroupName, String backupInstanceName, String filter, String skipToken) { + String resourceGroupName, String vaultName, String backupInstanceName, 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.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -152,9 +150,9 @@ private Mono> listSinglePag .list( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, filter, skipToken, @@ -167,7 +165,7 @@ private Mono> listSinglePag res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -175,8 +173,8 @@ private Mono> listSinglePag /** * Returns a list of Recovery Points for a DataSource in a vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param filter OData filter options. * @param skipToken skipToken Filter. @@ -184,12 +182,13 @@ private Mono> listSinglePag * @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 azureBackupRecoveryPointResourceList. + * @return azureBackupRecoveryPointResourceList along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, String filter, String skipToken, @@ -200,19 +199,19 @@ private Mono> listSinglePag 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -223,9 +222,9 @@ private Mono> listSinglePag .list( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, filter, skipToken, @@ -238,57 +237,57 @@ private Mono> listSinglePag res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } /** * Returns a list of Recovery Points for a DataSource in a vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 azureBackupRecoveryPointResourceList. + * @return azureBackupRecoveryPointResourceList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String vaultName, String resourceGroupName, String backupInstanceName, String filter, String skipToken) { + String resourceGroupName, String vaultName, String backupInstanceName, String filter, String skipToken) { return new PagedFlux<>( - () -> listSinglePageAsync(vaultName, resourceGroupName, backupInstanceName, filter, skipToken), + () -> listSinglePageAsync(resourceGroupName, vaultName, backupInstanceName, filter, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Returns a list of Recovery Points for a DataSource in a vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 azureBackupRecoveryPointResourceList. + * @return azureBackupRecoveryPointResourceList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String vaultName, String resourceGroupName, String backupInstanceName) { + String resourceGroupName, String vaultName, String backupInstanceName) { final String filter = null; final String skipToken = null; return new PagedFlux<>( - () -> listSinglePageAsync(vaultName, resourceGroupName, backupInstanceName, filter, skipToken), + () -> listSinglePageAsync(resourceGroupName, vaultName, backupInstanceName, filter, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Returns a list of Recovery Points for a DataSource in a vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param filter OData filter options. * @param skipToken skipToken Filter. @@ -296,45 +295,45 @@ private PagedFlux listAsync( * @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 azureBackupRecoveryPointResourceList. + * @return azureBackupRecoveryPointResourceList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, String filter, String skipToken, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(vaultName, resourceGroupName, backupInstanceName, filter, skipToken, context), + () -> listSinglePageAsync(resourceGroupName, vaultName, backupInstanceName, filter, skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Returns a list of Recovery Points for a DataSource in a vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 azureBackupRecoveryPointResourceList. + * @return azureBackupRecoveryPointResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String vaultName, String resourceGroupName, String backupInstanceName) { + String resourceGroupName, String vaultName, String backupInstanceName) { final String filter = null; final String skipToken = null; - return new PagedIterable<>(listAsync(vaultName, resourceGroupName, backupInstanceName, filter, skipToken)); + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, backupInstanceName, filter, skipToken)); } /** * Returns a list of Recovery Points for a DataSource in a vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param filter OData filter options. * @param skipToken skipToken Filter. @@ -342,54 +341,55 @@ 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 azureBackupRecoveryPointResourceList. + * @return azureBackupRecoveryPointResourceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, String filter, String skipToken, Context context) { return new PagedIterable<>( - listAsync(vaultName, resourceGroupName, backupInstanceName, filter, skipToken, context)); + listAsync(resourceGroupName, vaultName, backupInstanceName, filter, skipToken, context)); } /** * Gets a Recovery Point using recoveryPointId for a Datasource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param recoveryPointId The recoveryPointId parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Recovery Point using recoveryPointId for a Datasource. + * @return a Recovery Point using recoveryPointId for a Datasource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String vaultName, String resourceGroupName, String backupInstanceName, String recoveryPointId) { + String resourceGroupName, String vaultName, String backupInstanceName, String recoveryPointId) { 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -406,9 +406,9 @@ private Mono> getWithResponseAsy .get( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, recoveryPointId, accept, @@ -419,20 +419,21 @@ private Mono> getWithResponseAsy /** * Gets a Recovery Point using recoveryPointId for a Datasource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param recoveryPointId The recoveryPointId 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 a Recovery Point using recoveryPointId for a Datasource. + * @return a Recovery Point using recoveryPointId for a Datasource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, String recoveryPointId, Context context) { @@ -442,19 +443,19 @@ private Mono> getWithResponseAsy 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -469,9 +470,9 @@ private Mono> getWithResponseAsy .get( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, recoveryPointId, accept, @@ -481,78 +482,74 @@ private Mono> getWithResponseAsy /** * Gets a Recovery Point using recoveryPointId for a Datasource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param recoveryPointId The recoveryPointId parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Recovery Point using recoveryPointId for a Datasource. + * @return a Recovery Point using recoveryPointId for a Datasource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( - String vaultName, String resourceGroupName, String backupInstanceName, String recoveryPointId) { - return getWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, recoveryPointId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + String resourceGroupName, String vaultName, String backupInstanceName, String recoveryPointId) { + return getWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, recoveryPointId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a Recovery Point using recoveryPointId for a Datasource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param recoveryPointId The recoveryPointId 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 a Recovery Point using recoveryPointId for a Datasource. + * @return a Recovery Point using recoveryPointId for a Datasource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AzureBackupRecoveryPointResourceInner get( - String vaultName, String resourceGroupName, String backupInstanceName, String recoveryPointId) { - return getAsync(vaultName, resourceGroupName, backupInstanceName, recoveryPointId).block(); + public Response getWithResponse( + String resourceGroupName, + String vaultName, + String backupInstanceName, + String recoveryPointId, + Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, recoveryPointId, context).block(); } /** * Gets a Recovery Point using recoveryPointId for a Datasource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param recoveryPointId The recoveryPointId 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 a Recovery Point using recoveryPointId for a Datasource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String vaultName, - String resourceGroupName, - String backupInstanceName, - String recoveryPointId, - Context context) { - return getWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, recoveryPointId, context).block(); + public AzureBackupRecoveryPointResourceInner get( + String resourceGroupName, String vaultName, String backupInstanceName, String recoveryPointId) { + return getWithResponse(resourceGroupName, vaultName, backupInstanceName, recoveryPointId, Context.NONE) + .getValue(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 azureBackupRecoveryPointResourceList. + * @return azureBackupRecoveryPointResourceList along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -575,7 +572,7 @@ private Mono> listNextSingl res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -583,12 +580,14 @@ private Mono> listNextSingl /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 azureBackupRecoveryPointResourceList. + * @return azureBackupRecoveryPointResourceList along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync( @@ -613,7 +612,7 @@ private Mono> listNextSingl res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RecoveryPointsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RecoveryPointsImpl.java index e3e2c0d2ae76..aec72343936e 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RecoveryPointsImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RecoveryPointsImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupRecoveryPointResourceInner; import com.azure.resourcemanager.dataprotection.models.AzureBackupRecoveryPointResource; import com.azure.resourcemanager.dataprotection.models.RecoveryPoints; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class RecoveryPointsImpl implements RecoveryPoints { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPointsImpl.class); private final RecoveryPointsClient innerClient; @@ -30,45 +29,34 @@ public RecoveryPointsImpl( } public PagedIterable list( - String vaultName, String resourceGroupName, String backupInstanceName) { + String resourceGroupName, String vaultName, String backupInstanceName) { PagedIterable inner = - this.serviceClient().list(vaultName, resourceGroupName, backupInstanceName); + this.serviceClient().list(resourceGroupName, vaultName, backupInstanceName); return Utils.mapPage(inner, inner1 -> new AzureBackupRecoveryPointResourceImpl(inner1, this.manager())); } public PagedIterable list( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, String filter, String skipToken, Context context) { PagedIterable inner = - this.serviceClient().list(vaultName, resourceGroupName, backupInstanceName, filter, skipToken, context); + this.serviceClient().list(resourceGroupName, vaultName, backupInstanceName, filter, skipToken, context); return Utils.mapPage(inner, inner1 -> new AzureBackupRecoveryPointResourceImpl(inner1, this.manager())); } - public AzureBackupRecoveryPointResource get( - String vaultName, String resourceGroupName, String backupInstanceName, String recoveryPointId) { - AzureBackupRecoveryPointResourceInner inner = - this.serviceClient().get(vaultName, resourceGroupName, backupInstanceName, recoveryPointId); - if (inner != null) { - return new AzureBackupRecoveryPointResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, String recoveryPointId, Context context) { Response inner = this .serviceClient() - .getWithResponse(vaultName, resourceGroupName, backupInstanceName, recoveryPointId, context); + .getWithResponse(resourceGroupName, vaultName, backupInstanceName, recoveryPointId, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -80,6 +68,17 @@ public Response getWithResponse( } } + public AzureBackupRecoveryPointResource get( + String resourceGroupName, String vaultName, String backupInstanceName, String recoveryPointId) { + AzureBackupRecoveryPointResourceInner inner = + this.serviceClient().get(resourceGroupName, vaultName, backupInstanceName, recoveryPointId); + if (inner != null) { + return new AzureBackupRecoveryPointResourceImpl(inner, this.manager()); + } else { + return null; + } + } + private RecoveryPointsClient serviceClient() { return this.innerClient; } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardProxyBaseResourceImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardProxyBaseResourceImpl.java new file mode 100644 index 000000000000..9135abfcc9b6 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardProxyBaseResourceImpl.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dataprotection.fluent.models.ResourceGuardProxyBaseResourceInner; +import com.azure.resourcemanager.dataprotection.models.ResourceGuardProxyBase; +import com.azure.resourcemanager.dataprotection.models.ResourceGuardProxyBaseResource; +import com.azure.resourcemanager.dataprotection.models.UnlockDeleteRequest; +import com.azure.resourcemanager.dataprotection.models.UnlockDeleteResponse; + +public final class ResourceGuardProxyBaseResourceImpl + implements ResourceGuardProxyBaseResource, + ResourceGuardProxyBaseResource.Definition, + ResourceGuardProxyBaseResource.Update { + private ResourceGuardProxyBaseResourceInner innerObject; + + private final com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ResourceGuardProxyBase properties() { + return this.innerModel().properties(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ResourceGuardProxyBaseResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dataprotection.DataProtectionManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vaultName; + + private String resourceGuardProxyName; + + public ResourceGuardProxyBaseResourceImpl withExistingBackupVault(String resourceGroupName, String vaultName) { + this.resourceGroupName = resourceGroupName; + this.vaultName = vaultName; + return this; + } + + public ResourceGuardProxyBaseResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getDppResourceGuardProxies() + .putWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ResourceGuardProxyBaseResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDppResourceGuardProxies() + .putWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, this.innerModel(), context) + .getValue(); + return this; + } + + ResourceGuardProxyBaseResourceImpl( + String name, com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager) { + this.innerObject = new ResourceGuardProxyBaseResourceInner(); + this.serviceManager = serviceManager; + this.resourceGuardProxyName = name; + } + + public ResourceGuardProxyBaseResourceImpl update() { + return this; + } + + public ResourceGuardProxyBaseResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDppResourceGuardProxies() + .putWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ResourceGuardProxyBaseResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDppResourceGuardProxies() + .putWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, this.innerModel(), context) + .getValue(); + return this; + } + + ResourceGuardProxyBaseResourceImpl( + ResourceGuardProxyBaseResourceInner innerObject, + com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "backupVaults"); + this.resourceGuardProxyName = Utils.getValueFromIdByName(innerObject.id(), "backupResourceGuardProxies"); + } + + public ResourceGuardProxyBaseResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDppResourceGuardProxies() + .getWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, Context.NONE) + .getValue(); + return this; + } + + public ResourceGuardProxyBaseResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDppResourceGuardProxies() + .getWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, context) + .getValue(); + return this; + } + + public Response unlockDeleteWithResponse(UnlockDeleteRequest parameters, Context context) { + return serviceManager + .dppResourceGuardProxies() + .unlockDeleteWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, parameters, context); + } + + public UnlockDeleteResponse unlockDelete(UnlockDeleteRequest parameters) { + return serviceManager + .dppResourceGuardProxies() + .unlockDelete(resourceGroupName, vaultName, resourceGuardProxyName, parameters); + } + + public ResourceGuardProxyBaseResourceImpl withProperties(ResourceGuardProxyBase properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardResourceImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardResourceImpl.java index 62c49469b782..c009d16b5309 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardResourceImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardResourceImpl.java @@ -9,6 +9,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.dataprotection.fluent.models.ResourceGuardResourceInner; import com.azure.resourcemanager.dataprotection.models.DppIdentityDetails; +import com.azure.resourcemanager.dataprotection.models.PatchBackupVaultInput; import com.azure.resourcemanager.dataprotection.models.PatchResourceRequestInput; import com.azure.resourcemanager.dataprotection.models.ResourceGuard; import com.azure.resourcemanager.dataprotection.models.ResourceGuardResource; @@ -70,6 +71,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public ResourceGuardResourceInner innerModel() { return this.innerObject; } @@ -210,6 +215,11 @@ public ResourceGuardResourceImpl withProperties(ResourceGuard properties) { return this; } + public ResourceGuardResourceImpl withProperties(PatchBackupVaultInput properties) { + this.updateParameters.withProperties(properties); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardsClientImpl.java index 7a4a0342f8fa..350e90d69b56 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardsClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardsClientImpl.java @@ -29,7 +29,6 @@ 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.dataprotection.fluent.ResourceGuardsClient; import com.azure.resourcemanager.dataprotection.fluent.models.DppBaseResourceInner; import com.azure.resourcemanager.dataprotection.fluent.models.ResourceGuardResourceInner; @@ -40,8 +39,6 @@ /** An instance of this class provides access to all the operations defined in ResourceGuardsClient. */ public final class ResourceGuardsClientImpl implements ResourceGuardsClient { - private final ClientLogger logger = new ClientLogger(ResourceGuardsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ResourceGuardsService service; @@ -65,7 +62,7 @@ public final class ResourceGuardsClientImpl implements ResourceGuardsClient { */ @Host("{$host}") @ServiceInterface(name = "DataProtectionClient") - private interface ResourceGuardsService { + public interface ResourceGuardsService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/resourceGuards") @ExpectedResponses({200}) @@ -425,7 +422,8 @@ Mono> getUpdateProtectedItemRequestsObjectsNext( * * @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 ResourceGuard resources. + * @return list of ResourceGuard resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -459,7 +457,7 @@ private Mono> listSinglePageAsync() { res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -471,7 +469,8 @@ private Mono> listSinglePageAsync() { * @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 ResourceGuard resources. + * @return list of ResourceGuard resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -503,7 +502,7 @@ private Mono> listSinglePageAsync(Cont res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } @@ -512,7 +511,7 @@ private Mono> listSinglePageAsync(Cont * * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -527,7 +526,7 @@ private PagedFlux listAsync() { * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -541,7 +540,7 @@ private PagedFlux listAsync(Context context) { * * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -555,7 +554,7 @@ 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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -569,7 +568,8 @@ public PagedIterable list(Context context) { * @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 ResourceGuard resources. + * @return list of ResourceGuard resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -609,7 +609,7 @@ private Mono> listByResourceGroupSingl res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -622,7 +622,8 @@ private Mono> listByResourceGroupSingl * @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 ResourceGuard resources. + * @return list of ResourceGuard resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -660,7 +661,7 @@ private Mono> listByResourceGroupSingl res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } @@ -671,7 +672,7 @@ private Mono> listByResourceGroupSingl * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -688,7 +689,7 @@ private PagedFlux listByResourceGroupAsync(String re * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -704,7 +705,7 @@ private PagedFlux listByResourceGroupAsync(String re * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -719,7 +720,7 @@ public PagedIterable listByResourceGroup(String reso * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -735,7 +736,7 @@ public PagedIterable listByResourceGroup(String reso * @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 the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> putWithResponseAsync( @@ -792,7 +793,7 @@ private Mono> putWithResponseAsync( * @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 the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> putWithResponseAsync( @@ -845,20 +846,13 @@ private Mono> putWithResponseAsync( * @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 the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono putAsync( String resourceGroupName, String resourceGuardsName, ResourceGuardResourceInner parameters) { return putWithResponseAsync(resourceGroupName, resourceGuardsName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -867,15 +861,16 @@ private Mono putAsync( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. * @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 the response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceGuardResourceInner put( - String resourceGroupName, String resourceGuardsName, ResourceGuardResourceInner parameters) { - return putAsync(resourceGroupName, resourceGuardsName, parameters).block(); + public Response putWithResponse( + String resourceGroupName, String resourceGuardsName, ResourceGuardResourceInner parameters, Context context) { + return putWithResponseAsync(resourceGroupName, resourceGuardsName, parameters, context).block(); } /** @@ -884,16 +879,15 @@ public ResourceGuardResourceInner put( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. * @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 the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response putWithResponse( - String resourceGroupName, String resourceGuardsName, ResourceGuardResourceInner parameters, Context context) { - return putWithResponseAsync(resourceGroupName, resourceGuardsName, parameters, context).block(); + public ResourceGuardResourceInner put( + String resourceGroupName, String resourceGuardsName, ResourceGuardResourceInner parameters) { + return putWithResponse(resourceGroupName, resourceGuardsName, parameters, Context.NONE).getValue(); } /** @@ -904,7 +898,7 @@ public Response putWithResponse( * @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 the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -954,7 +948,7 @@ private Mono> getByResourceGroupWithRespons * @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 the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -1000,20 +994,13 @@ private Mono> getByResourceGroupWithRespons * @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 the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync( String resourceGroupName, String resourceGuardsName) { return getByResourceGroupWithResponseAsync(resourceGroupName, resourceGuardsName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1021,14 +1008,16 @@ private Mono getByResourceGroupAsync( * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. + * @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 the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceGuardResourceInner getByResourceGroup(String resourceGroupName, String resourceGuardsName) { - return getByResourceGroupAsync(resourceGroupName, resourceGuardsName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceGuardsName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceGuardsName, context).block(); } /** @@ -1036,16 +1025,14 @@ public ResourceGuardResourceInner getByResourceGroup(String resourceGroupName, S * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. - * @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 getByResourceGroupWithResponse( - String resourceGroupName, String resourceGuardsName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, resourceGuardsName, context).block(); + public ResourceGuardResourceInner getByResourceGroup(String resourceGroupName, String resourceGuardsName) { + return getByResourceGroupWithResponse(resourceGroupName, resourceGuardsName, Context.NONE).getValue(); } /** @@ -1056,7 +1043,7 @@ public Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceGuardsName) { @@ -1105,7 +1092,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -1151,12 +1138,11 @@ private Mono> deleteWithResponseAsync( * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String resourceGuardsName) { - return deleteWithResponseAsync(resourceGroupName, resourceGuardsName) - .flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, resourceGuardsName).flatMap(ignored -> Mono.empty()); } /** @@ -1164,13 +1150,15 @@ private Mono deleteAsync(String resourceGroupName, String resourceGuardsNa * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceGuardsName) { - deleteAsync(resourceGroupName, resourceGuardsName).block(); + public Response deleteWithResponse(String resourceGroupName, String resourceGuardsName, Context context) { + return deleteWithResponseAsync(resourceGroupName, resourceGuardsName, context).block(); } /** @@ -1178,15 +1166,13 @@ public void delete(String resourceGroupName, String resourceGuardsName) { * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. - * @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 resourceGroupName, String resourceGuardsName, Context context) { - return deleteWithResponseAsync(resourceGroupName, resourceGuardsName, context).block(); + public void delete(String resourceGroupName, String resourceGuardsName) { + deleteWithResponse(resourceGroupName, resourceGuardsName, Context.NONE); } /** @@ -1198,7 +1184,7 @@ public Response deleteWithResponse(String resourceGroupName, String resour * @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 the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> patchWithResponseAsync( @@ -1255,7 +1241,7 @@ private Mono> patchWithResponseAsync( * @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 the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> patchWithResponseAsync( @@ -1308,20 +1294,13 @@ private Mono> patchWithResponseAsync( * @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 the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono patchAsync( String resourceGroupName, String resourceGuardsName, PatchResourceRequestInput parameters) { return patchWithResponseAsync(resourceGroupName, resourceGuardsName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1330,15 +1309,16 @@ private Mono patchAsync( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. * @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 the response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceGuardResourceInner patch( - String resourceGroupName, String resourceGuardsName, PatchResourceRequestInput parameters) { - return patchAsync(resourceGroupName, resourceGuardsName, parameters).block(); + public Response patchWithResponse( + String resourceGroupName, String resourceGuardsName, PatchResourceRequestInput parameters, Context context) { + return patchWithResponseAsync(resourceGroupName, resourceGuardsName, parameters, context).block(); } /** @@ -1347,16 +1327,15 @@ public ResourceGuardResourceInner patch( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. * @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 the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response patchWithResponse( - String resourceGroupName, String resourceGuardsName, PatchResourceRequestInput parameters, Context context) { - return patchWithResponseAsync(resourceGroupName, resourceGuardsName, parameters, context).block(); + public ResourceGuardResourceInner patch( + String resourceGroupName, String resourceGuardsName, PatchResourceRequestInput parameters) { + return patchWithResponse(resourceGroupName, resourceGuardsName, parameters, Context.NONE).getValue(); } /** @@ -1368,7 +1347,8 @@ public Response patchWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDisableSoftDeleteRequestsObjectsSinglePageAsync( @@ -1428,7 +1408,8 @@ private Mono> getDisableSoftDeleteRequestsOb * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDisableSoftDeleteRequestsObjectsSinglePageAsync( @@ -1484,7 +1465,7 @@ private Mono> getDisableSoftDeleteRequestsOb * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getDisableSoftDeleteRequestsObjectsAsync( @@ -1504,7 +1485,7 @@ private PagedFlux getDisableSoftDeleteRequestsObjectsAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getDisableSoftDeleteRequestsObjectsAsync( @@ -1523,7 +1504,7 @@ private PagedFlux getDisableSoftDeleteRequestsObjectsAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getDisableSoftDeleteRequestsObjects( @@ -1541,7 +1522,7 @@ public PagedIterable getDisableSoftDeleteRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getDisableSoftDeleteRequestsObjects( @@ -1559,7 +1540,8 @@ public PagedIterable getDisableSoftDeleteRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDeleteResourceGuardProxyRequestsObjectsSinglePageAsync( @@ -1619,7 +1601,8 @@ private Mono> getDeleteResourceGuardProxyReq * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDeleteResourceGuardProxyRequestsObjectsSinglePageAsync( @@ -1675,7 +1658,7 @@ private Mono> getDeleteResourceGuardProxyReq * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getDeleteResourceGuardProxyRequestsObjectsAsync( @@ -1695,7 +1678,7 @@ private PagedFlux getDeleteResourceGuardProxyRequestsObjec * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getDeleteResourceGuardProxyRequestsObjectsAsync( @@ -1716,7 +1699,7 @@ private PagedFlux getDeleteResourceGuardProxyRequestsObjec * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getDeleteResourceGuardProxyRequestsObjects( @@ -1735,7 +1718,7 @@ public PagedIterable getDeleteResourceGuardProxyRequestsOb * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getDeleteResourceGuardProxyRequestsObjects( @@ -1753,7 +1736,8 @@ public PagedIterable getDeleteResourceGuardProxyRequestsOb * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getBackupSecurityPinRequestsObjectsSinglePageAsync( @@ -1813,7 +1797,8 @@ private Mono> getBackupSecurityPinRequestsOb * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getBackupSecurityPinRequestsObjectsSinglePageAsync( @@ -1869,7 +1854,7 @@ private Mono> getBackupSecurityPinRequestsOb * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getBackupSecurityPinRequestsObjectsAsync( @@ -1889,7 +1874,7 @@ private PagedFlux getBackupSecurityPinRequestsObjectsAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getBackupSecurityPinRequestsObjectsAsync( @@ -1908,7 +1893,7 @@ private PagedFlux getBackupSecurityPinRequestsObjectsAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getBackupSecurityPinRequestsObjects( @@ -1926,7 +1911,7 @@ public PagedIterable getBackupSecurityPinRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getBackupSecurityPinRequestsObjects( @@ -1944,7 +1929,8 @@ public PagedIterable getBackupSecurityPinRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDeleteProtectedItemRequestsObjectsSinglePageAsync( @@ -2004,7 +1990,8 @@ private Mono> getDeleteProtectedItemRequests * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDeleteProtectedItemRequestsObjectsSinglePageAsync( @@ -2060,7 +2047,7 @@ private Mono> getDeleteProtectedItemRequests * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getDeleteProtectedItemRequestsObjectsAsync( @@ -2080,7 +2067,7 @@ private PagedFlux getDeleteProtectedItemRequestsObjectsAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getDeleteProtectedItemRequestsObjectsAsync( @@ -2099,7 +2086,7 @@ private PagedFlux getDeleteProtectedItemRequestsObjectsAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getDeleteProtectedItemRequestsObjects( @@ -2117,7 +2104,7 @@ public PagedIterable getDeleteProtectedItemRequestsObjects * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getDeleteProtectedItemRequestsObjects( @@ -2135,7 +2122,8 @@ public PagedIterable getDeleteProtectedItemRequestsObjects * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getUpdateProtectionPolicyRequestsObjectsSinglePageAsync( @@ -2195,7 +2183,8 @@ private Mono> getUpdateProtectionPolicyReque * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getUpdateProtectionPolicyRequestsObjectsSinglePageAsync( @@ -2251,7 +2240,7 @@ private Mono> getUpdateProtectionPolicyReque * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getUpdateProtectionPolicyRequestsObjectsAsync( @@ -2271,7 +2260,7 @@ private PagedFlux getUpdateProtectionPolicyRequestsObjects * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getUpdateProtectionPolicyRequestsObjectsAsync( @@ -2291,7 +2280,7 @@ private PagedFlux getUpdateProtectionPolicyRequestsObjects * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getUpdateProtectionPolicyRequestsObjects( @@ -2310,7 +2299,7 @@ public PagedIterable getUpdateProtectionPolicyRequestsObje * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getUpdateProtectionPolicyRequestsObjects( @@ -2328,7 +2317,8 @@ public PagedIterable getUpdateProtectionPolicyRequestsObje * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getUpdateProtectedItemRequestsObjectsSinglePageAsync( @@ -2388,7 +2378,8 @@ private Mono> getUpdateProtectedItemRequests * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getUpdateProtectedItemRequestsObjectsSinglePageAsync( @@ -2444,7 +2435,7 @@ private Mono> getUpdateProtectedItemRequests * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getUpdateProtectedItemRequestsObjectsAsync( @@ -2464,7 +2455,7 @@ private PagedFlux getUpdateProtectedItemRequestsObjectsAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getUpdateProtectedItemRequestsObjectsAsync( @@ -2483,7 +2474,7 @@ private PagedFlux getUpdateProtectedItemRequestsObjectsAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getUpdateProtectedItemRequestsObjects( @@ -2501,7 +2492,7 @@ public PagedIterable getUpdateProtectedItemRequestsObjects * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getUpdateProtectedItemRequestsObjects( @@ -2520,7 +2511,8 @@ public PagedIterable getUpdateProtectedItemRequestsObjects * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDefaultDisableSoftDeleteRequestsObjectWithResponseAsync( @@ -2576,7 +2568,8 @@ private Mono> getDefaultDisableSoftDeleteRequests * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDefaultDisableSoftDeleteRequestsObjectWithResponseAsync( @@ -2628,21 +2621,14 @@ private Mono> getDefaultDisableSoftDeleteRequests * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getDefaultDisableSoftDeleteRequestsObjectAsync( String resourceGroupName, String resourceGuardsName, String requestName) { return getDefaultDisableSoftDeleteRequestsObjectWithResponseAsync( resourceGroupName, resourceGuardsName, requestName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2652,15 +2638,17 @@ private Mono getDefaultDisableSoftDeleteRequestsObjectAsyn * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The resourceGuardsName parameter. * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DppBaseResourceInner getDefaultDisableSoftDeleteRequestsObject( - String resourceGroupName, String resourceGuardsName, String requestName) { - return getDefaultDisableSoftDeleteRequestsObjectAsync(resourceGroupName, resourceGuardsName, requestName) + public Response getDefaultDisableSoftDeleteRequestsObjectWithResponse( + String resourceGroupName, String resourceGuardsName, String requestName, Context context) { + return getDefaultDisableSoftDeleteRequestsObjectWithResponseAsync( + resourceGroupName, resourceGuardsName, requestName, context) .block(); } @@ -2671,18 +2659,17 @@ public DppBaseResourceInner getDefaultDisableSoftDeleteRequestsObject( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The resourceGuardsName parameter. * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDefaultDisableSoftDeleteRequestsObjectWithResponse( - String resourceGroupName, String resourceGuardsName, String requestName, Context context) { - return getDefaultDisableSoftDeleteRequestsObjectWithResponseAsync( - resourceGroupName, resourceGuardsName, requestName, context) - .block(); + public DppBaseResourceInner getDefaultDisableSoftDeleteRequestsObject( + String resourceGroupName, String resourceGuardsName, String requestName) { + return getDefaultDisableSoftDeleteRequestsObjectWithResponse( + resourceGroupName, resourceGuardsName, requestName, Context.NONE) + .getValue(); } /** @@ -2695,7 +2682,8 @@ public Response getDefaultDisableSoftDeleteRequestsObjectW * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDefaultDeleteResourceGuardProxyRequestsObjectWithResponseAsync( @@ -2751,7 +2739,8 @@ private Mono> getDefaultDeleteResourceGuardProxyR * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDefaultDeleteResourceGuardProxyRequestsObjectWithResponseAsync( @@ -2803,21 +2792,14 @@ private Mono> getDefaultDeleteResourceGuardProxyR * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getDefaultDeleteResourceGuardProxyRequestsObjectAsync( String resourceGroupName, String resourceGuardsName, String requestName) { return getDefaultDeleteResourceGuardProxyRequestsObjectWithResponseAsync( resourceGroupName, resourceGuardsName, requestName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2827,15 +2809,17 @@ private Mono getDefaultDeleteResourceGuardProxyRequestsObj * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The resourceGuardsName parameter. * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DppBaseResourceInner getDefaultDeleteResourceGuardProxyRequestsObject( - String resourceGroupName, String resourceGuardsName, String requestName) { - return getDefaultDeleteResourceGuardProxyRequestsObjectAsync(resourceGroupName, resourceGuardsName, requestName) + public Response getDefaultDeleteResourceGuardProxyRequestsObjectWithResponse( + String resourceGroupName, String resourceGuardsName, String requestName, Context context) { + return getDefaultDeleteResourceGuardProxyRequestsObjectWithResponseAsync( + resourceGroupName, resourceGuardsName, requestName, context) .block(); } @@ -2846,18 +2830,17 @@ public DppBaseResourceInner getDefaultDeleteResourceGuardProxyRequestsObject( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The resourceGuardsName parameter. * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDefaultDeleteResourceGuardProxyRequestsObjectWithResponse( - String resourceGroupName, String resourceGuardsName, String requestName, Context context) { - return getDefaultDeleteResourceGuardProxyRequestsObjectWithResponseAsync( - resourceGroupName, resourceGuardsName, requestName, context) - .block(); + public DppBaseResourceInner getDefaultDeleteResourceGuardProxyRequestsObject( + String resourceGroupName, String resourceGuardsName, String requestName) { + return getDefaultDeleteResourceGuardProxyRequestsObjectWithResponse( + resourceGroupName, resourceGuardsName, requestName, Context.NONE) + .getValue(); } /** @@ -2870,7 +2853,8 @@ public Response getDefaultDeleteResourceGuardProxyRequests * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDefaultBackupSecurityPinRequestsObjectWithResponseAsync( @@ -2926,7 +2910,8 @@ private Mono> getDefaultBackupSecurityPinRequests * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDefaultBackupSecurityPinRequestsObjectWithResponseAsync( @@ -2978,21 +2963,14 @@ private Mono> getDefaultBackupSecurityPinRequests * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getDefaultBackupSecurityPinRequestsObjectAsync( String resourceGroupName, String resourceGuardsName, String requestName) { return getDefaultBackupSecurityPinRequestsObjectWithResponseAsync( resourceGroupName, resourceGuardsName, requestName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -3002,15 +2980,17 @@ private Mono getDefaultBackupSecurityPinRequestsObjectAsyn * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The resourceGuardsName parameter. * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DppBaseResourceInner getDefaultBackupSecurityPinRequestsObject( - String resourceGroupName, String resourceGuardsName, String requestName) { - return getDefaultBackupSecurityPinRequestsObjectAsync(resourceGroupName, resourceGuardsName, requestName) + public Response getDefaultBackupSecurityPinRequestsObjectWithResponse( + String resourceGroupName, String resourceGuardsName, String requestName, Context context) { + return getDefaultBackupSecurityPinRequestsObjectWithResponseAsync( + resourceGroupName, resourceGuardsName, requestName, context) .block(); } @@ -3021,18 +3001,17 @@ public DppBaseResourceInner getDefaultBackupSecurityPinRequestsObject( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The resourceGuardsName parameter. * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDefaultBackupSecurityPinRequestsObjectWithResponse( - String resourceGroupName, String resourceGuardsName, String requestName, Context context) { - return getDefaultBackupSecurityPinRequestsObjectWithResponseAsync( - resourceGroupName, resourceGuardsName, requestName, context) - .block(); + public DppBaseResourceInner getDefaultBackupSecurityPinRequestsObject( + String resourceGroupName, String resourceGuardsName, String requestName) { + return getDefaultBackupSecurityPinRequestsObjectWithResponse( + resourceGroupName, resourceGuardsName, requestName, Context.NONE) + .getValue(); } /** @@ -3045,7 +3024,8 @@ public Response getDefaultBackupSecurityPinRequestsObjectW * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDefaultDeleteProtectedItemRequestsObjectWithResponseAsync( @@ -3101,7 +3081,8 @@ private Mono> getDefaultDeleteProtectedItemReques * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDefaultDeleteProtectedItemRequestsObjectWithResponseAsync( @@ -3153,21 +3134,14 @@ private Mono> getDefaultDeleteProtectedItemReques * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getDefaultDeleteProtectedItemRequestsObjectAsync( String resourceGroupName, String resourceGuardsName, String requestName) { return getDefaultDeleteProtectedItemRequestsObjectWithResponseAsync( resourceGroupName, resourceGuardsName, requestName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -3177,15 +3151,17 @@ private Mono getDefaultDeleteProtectedItemRequestsObjectAs * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The resourceGuardsName parameter. * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DppBaseResourceInner getDefaultDeleteProtectedItemRequestsObject( - String resourceGroupName, String resourceGuardsName, String requestName) { - return getDefaultDeleteProtectedItemRequestsObjectAsync(resourceGroupName, resourceGuardsName, requestName) + public Response getDefaultDeleteProtectedItemRequestsObjectWithResponse( + String resourceGroupName, String resourceGuardsName, String requestName, Context context) { + return getDefaultDeleteProtectedItemRequestsObjectWithResponseAsync( + resourceGroupName, resourceGuardsName, requestName, context) .block(); } @@ -3196,18 +3172,17 @@ public DppBaseResourceInner getDefaultDeleteProtectedItemRequestsObject( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The resourceGuardsName parameter. * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDefaultDeleteProtectedItemRequestsObjectWithResponse( - String resourceGroupName, String resourceGuardsName, String requestName, Context context) { - return getDefaultDeleteProtectedItemRequestsObjectWithResponseAsync( - resourceGroupName, resourceGuardsName, requestName, context) - .block(); + public DppBaseResourceInner getDefaultDeleteProtectedItemRequestsObject( + String resourceGroupName, String resourceGuardsName, String requestName) { + return getDefaultDeleteProtectedItemRequestsObjectWithResponse( + resourceGroupName, resourceGuardsName, requestName, Context.NONE) + .getValue(); } /** @@ -3220,7 +3195,8 @@ public Response getDefaultDeleteProtectedItemRequestsObjec * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDefaultUpdateProtectionPolicyRequestsObjectWithResponseAsync( @@ -3276,7 +3252,8 @@ private Mono> getDefaultUpdateProtectionPolicyReq * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDefaultUpdateProtectionPolicyRequestsObjectWithResponseAsync( @@ -3328,21 +3305,14 @@ private Mono> getDefaultUpdateProtectionPolicyReq * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getDefaultUpdateProtectionPolicyRequestsObjectAsync( String resourceGroupName, String resourceGuardsName, String requestName) { return getDefaultUpdateProtectionPolicyRequestsObjectWithResponseAsync( resourceGroupName, resourceGuardsName, requestName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -3352,15 +3322,17 @@ private Mono getDefaultUpdateProtectionPolicyRequestsObjec * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The resourceGuardsName parameter. * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DppBaseResourceInner getDefaultUpdateProtectionPolicyRequestsObject( - String resourceGroupName, String resourceGuardsName, String requestName) { - return getDefaultUpdateProtectionPolicyRequestsObjectAsync(resourceGroupName, resourceGuardsName, requestName) + public Response getDefaultUpdateProtectionPolicyRequestsObjectWithResponse( + String resourceGroupName, String resourceGuardsName, String requestName, Context context) { + return getDefaultUpdateProtectionPolicyRequestsObjectWithResponseAsync( + resourceGroupName, resourceGuardsName, requestName, context) .block(); } @@ -3371,18 +3343,17 @@ public DppBaseResourceInner getDefaultUpdateProtectionPolicyRequestsObject( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The resourceGuardsName parameter. * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDefaultUpdateProtectionPolicyRequestsObjectWithResponse( - String resourceGroupName, String resourceGuardsName, String requestName, Context context) { - return getDefaultUpdateProtectionPolicyRequestsObjectWithResponseAsync( - resourceGroupName, resourceGuardsName, requestName, context) - .block(); + public DppBaseResourceInner getDefaultUpdateProtectionPolicyRequestsObject( + String resourceGroupName, String resourceGuardsName, String requestName) { + return getDefaultUpdateProtectionPolicyRequestsObjectWithResponse( + resourceGroupName, resourceGuardsName, requestName, Context.NONE) + .getValue(); } /** @@ -3395,7 +3366,8 @@ public Response getDefaultUpdateProtectionPolicyRequestsOb * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDefaultUpdateProtectedItemRequestsObjectWithResponseAsync( @@ -3451,7 +3423,8 @@ private Mono> getDefaultUpdateProtectedItemReques * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDefaultUpdateProtectedItemRequestsObjectWithResponseAsync( @@ -3503,21 +3476,14 @@ private Mono> getDefaultUpdateProtectedItemReques * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getDefaultUpdateProtectedItemRequestsObjectAsync( String resourceGroupName, String resourceGuardsName, String requestName) { return getDefaultUpdateProtectedItemRequestsObjectWithResponseAsync( resourceGroupName, resourceGuardsName, requestName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -3527,15 +3493,17 @@ private Mono getDefaultUpdateProtectedItemRequestsObjectAs * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The resourceGuardsName parameter. * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DppBaseResourceInner getDefaultUpdateProtectedItemRequestsObject( - String resourceGroupName, String resourceGuardsName, String requestName) { - return getDefaultUpdateProtectedItemRequestsObjectAsync(resourceGroupName, resourceGuardsName, requestName) + public Response getDefaultUpdateProtectedItemRequestsObjectWithResponse( + String resourceGroupName, String resourceGuardsName, String requestName, Context context) { + return getDefaultUpdateProtectedItemRequestsObjectWithResponseAsync( + resourceGroupName, resourceGuardsName, requestName, context) .block(); } @@ -3546,28 +3514,29 @@ public DppBaseResourceInner getDefaultUpdateProtectedItemRequestsObject( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The resourceGuardsName parameter. * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDefaultUpdateProtectedItemRequestsObjectWithResponse( - String resourceGroupName, String resourceGuardsName, String requestName, Context context) { - return getDefaultUpdateProtectedItemRequestsObjectWithResponseAsync( - resourceGroupName, resourceGuardsName, requestName, context) - .block(); + public DppBaseResourceInner getDefaultUpdateProtectedItemRequestsObject( + String resourceGroupName, String resourceGuardsName, String requestName) { + return getDefaultUpdateProtectedItemRequestsObjectWithResponse( + resourceGroupName, resourceGuardsName, requestName, Context.NONE) + .getValue(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 ResourceGuard resources. + * @return list of ResourceGuard resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getResourcesInSubscriptionNextSinglePageAsync( @@ -3592,7 +3561,7 @@ private Mono> getResourcesInSubscripti res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3600,12 +3569,14 @@ private Mono> getResourcesInSubscripti /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 ResourceGuard resources. + * @return list of ResourceGuard resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getResourcesInSubscriptionNextSinglePageAsync( @@ -3630,18 +3601,20 @@ private Mono> getResourcesInSubscripti res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 ResourceGuard resources. + * @return list of ResourceGuard resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getResourcesInResourceGroupNextSinglePageAsync( @@ -3667,7 +3640,7 @@ private Mono> getResourcesInResourceGr res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3675,12 +3648,14 @@ private Mono> getResourcesInResourceGr /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 ResourceGuard resources. + * @return list of ResourceGuard resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getResourcesInResourceGroupNextSinglePageAsync( @@ -3705,18 +3680,20 @@ private Mono> getResourcesInResourceGr res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), + res.getValue().nextLink().toString(), null)); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDisableSoftDeleteRequestsObjectsNextSinglePageAsync( @@ -3751,12 +3728,14 @@ private Mono> getDisableSoftDeleteRequestsOb /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDisableSoftDeleteRequestsObjectsNextSinglePageAsync( @@ -3788,11 +3767,13 @@ private Mono> getDisableSoftDeleteRequestsOb /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDeleteResourceGuardProxyRequestsObjectsNextSinglePageAsync( @@ -3828,12 +3809,14 @@ private Mono> getDeleteResourceGuardProxyReq /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDeleteResourceGuardProxyRequestsObjectsNextSinglePageAsync( @@ -3865,11 +3848,13 @@ private Mono> getDeleteResourceGuardProxyReq /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getBackupSecurityPinRequestsObjectsNextSinglePageAsync( @@ -3904,12 +3889,14 @@ private Mono> getBackupSecurityPinRequestsOb /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getBackupSecurityPinRequestsObjectsNextSinglePageAsync( @@ -3941,11 +3928,13 @@ private Mono> getBackupSecurityPinRequestsOb /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDeleteProtectedItemRequestsObjectsNextSinglePageAsync( @@ -3981,12 +3970,14 @@ private Mono> getDeleteProtectedItemRequests /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDeleteProtectedItemRequestsObjectsNextSinglePageAsync( @@ -4018,11 +4009,13 @@ private Mono> getDeleteProtectedItemRequests /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getUpdateProtectionPolicyRequestsObjectsNextSinglePageAsync( @@ -4058,12 +4051,14 @@ private Mono> getUpdateProtectionPolicyReque /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getUpdateProtectionPolicyRequestsObjectsNextSinglePageAsync( @@ -4095,11 +4090,13 @@ private Mono> getUpdateProtectionPolicyReque /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getUpdateProtectedItemRequestsObjectsNextSinglePageAsync( @@ -4135,12 +4132,14 @@ private Mono> getUpdateProtectedItemRequests /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 base for all lists of V2 resources. + * @return base for all lists of V2 resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getUpdateProtectedItemRequestsObjectsNextSinglePageAsync( diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardsImpl.java index e26cf4ef189e..5d096d9e4f0b 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardsImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardsImpl.java @@ -15,10 +15,9 @@ import com.azure.resourcemanager.dataprotection.models.DppBaseResource; import com.azure.resourcemanager.dataprotection.models.ResourceGuardResource; import com.azure.resourcemanager.dataprotection.models.ResourceGuards; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ResourceGuardsImpl implements ResourceGuards { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGuardsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ResourceGuardsImpl.class); private final ResourceGuardsClient innerClient; @@ -52,16 +51,6 @@ public PagedIterable listByResourceGroup(String resourceG return Utils.mapPage(inner, inner1 -> new ResourceGuardResourceImpl(inner1, this.manager())); } - public ResourceGuardResource getByResourceGroup(String resourceGroupName, String resourceGuardsName) { - ResourceGuardResourceInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, resourceGuardsName); - if (inner != null) { - return new ResourceGuardResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String resourceGuardsName, Context context) { Response inner = @@ -77,14 +66,25 @@ public Response getByResourceGroupWithResponse( } } - public void deleteByResourceGroup(String resourceGroupName, String resourceGuardsName) { - this.serviceClient().delete(resourceGroupName, resourceGuardsName); + public ResourceGuardResource getByResourceGroup(String resourceGroupName, String resourceGuardsName) { + ResourceGuardResourceInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, resourceGuardsName); + if (inner != null) { + return new ResourceGuardResourceImpl(inner, this.manager()); + } else { + return null; + } } - public Response deleteWithResponse(String resourceGroupName, String resourceGuardsName, Context context) { + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String resourceGuardsName, Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, resourceGuardsName, context); } + public void deleteByResourceGroup(String resourceGroupName, String resourceGuardsName) { + this.serviceClient().delete(resourceGroupName, resourceGuardsName); + } + public PagedIterable getDisableSoftDeleteRequestsObjects( String resourceGroupName, String resourceGuardsName) { PagedIterable inner = @@ -173,19 +173,6 @@ public PagedIterable getUpdateProtectedItemRequestsObjects( return Utils.mapPage(inner, inner1 -> new DppBaseResourceImpl(inner1, this.manager())); } - public DppBaseResource getDefaultDisableSoftDeleteRequestsObject( - String resourceGroupName, String resourceGuardsName, String requestName) { - DppBaseResourceInner inner = - this - .serviceClient() - .getDefaultDisableSoftDeleteRequestsObject(resourceGroupName, resourceGuardsName, requestName); - if (inner != null) { - return new DppBaseResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getDefaultDisableSoftDeleteRequestsObjectWithResponse( String resourceGroupName, String resourceGuardsName, String requestName, Context context) { Response inner = @@ -204,12 +191,12 @@ public Response getDefaultDisableSoftDeleteRequestsObjectWithRe } } - public DppBaseResource getDefaultDeleteResourceGuardProxyRequestsObject( + public DppBaseResource getDefaultDisableSoftDeleteRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName) { DppBaseResourceInner inner = this .serviceClient() - .getDefaultDeleteResourceGuardProxyRequestsObject(resourceGroupName, resourceGuardsName, requestName); + .getDefaultDisableSoftDeleteRequestsObject(resourceGroupName, resourceGuardsName, requestName); if (inner != null) { return new DppBaseResourceImpl(inner, this.manager()); } else { @@ -235,12 +222,12 @@ public Response getDefaultDeleteResourceGuardProxyRequestsObjec } } - public DppBaseResource getDefaultBackupSecurityPinRequestsObject( + public DppBaseResource getDefaultDeleteResourceGuardProxyRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName) { DppBaseResourceInner inner = this .serviceClient() - .getDefaultBackupSecurityPinRequestsObject(resourceGroupName, resourceGuardsName, requestName); + .getDefaultDeleteResourceGuardProxyRequestsObject(resourceGroupName, resourceGuardsName, requestName); if (inner != null) { return new DppBaseResourceImpl(inner, this.manager()); } else { @@ -266,12 +253,12 @@ public Response getDefaultBackupSecurityPinRequestsObjectWithRe } } - public DppBaseResource getDefaultDeleteProtectedItemRequestsObject( + public DppBaseResource getDefaultBackupSecurityPinRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName) { DppBaseResourceInner inner = this .serviceClient() - .getDefaultDeleteProtectedItemRequestsObject(resourceGroupName, resourceGuardsName, requestName); + .getDefaultBackupSecurityPinRequestsObject(resourceGroupName, resourceGuardsName, requestName); if (inner != null) { return new DppBaseResourceImpl(inner, this.manager()); } else { @@ -297,12 +284,12 @@ public Response getDefaultDeleteProtectedItemRequestsObjectWith } } - public DppBaseResource getDefaultUpdateProtectionPolicyRequestsObject( + public DppBaseResource getDefaultDeleteProtectedItemRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName) { DppBaseResourceInner inner = this .serviceClient() - .getDefaultUpdateProtectionPolicyRequestsObject(resourceGroupName, resourceGuardsName, requestName); + .getDefaultDeleteProtectedItemRequestsObject(resourceGroupName, resourceGuardsName, requestName); if (inner != null) { return new DppBaseResourceImpl(inner, this.manager()); } else { @@ -328,12 +315,12 @@ public Response getDefaultUpdateProtectionPolicyRequestsObjectW } } - public DppBaseResource getDefaultUpdateProtectedItemRequestsObject( + public DppBaseResource getDefaultUpdateProtectionPolicyRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName) { DppBaseResourceInner inner = this .serviceClient() - .getDefaultUpdateProtectedItemRequestsObject(resourceGroupName, resourceGuardsName, requestName); + .getDefaultUpdateProtectionPolicyRequestsObject(resourceGroupName, resourceGuardsName, requestName); if (inner != null) { return new DppBaseResourceImpl(inner, this.manager()); } else { @@ -359,10 +346,23 @@ public Response getDefaultUpdateProtectedItemRequestsObjectWith } } + public DppBaseResource getDefaultUpdateProtectedItemRequestsObject( + String resourceGroupName, String resourceGuardsName, String requestName) { + DppBaseResourceInner inner = + this + .serviceClient() + .getDefaultUpdateProtectedItemRequestsObject(resourceGroupName, resourceGuardsName, requestName); + if (inner != null) { + return new DppBaseResourceImpl(inner, this.manager()); + } else { + return null; + } + } + public ResourceGuardResource getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -370,7 +370,7 @@ public ResourceGuardResource getById(String id) { } String resourceGuardsName = Utils.getValueFromIdByName(id, "resourceGuards"); if (resourceGuardsName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -382,7 +382,7 @@ public ResourceGuardResource getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -390,7 +390,7 @@ public Response getByIdWithResponse(String id, Context co } String resourceGuardsName = Utils.getValueFromIdByName(id, "resourceGuards"); if (resourceGuardsName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -402,7 +402,7 @@ public Response getByIdWithResponse(String id, Context co public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -410,19 +410,19 @@ public void deleteById(String id) { } String resourceGuardsName = Utils.getValueFromIdByName(id, "resourceGuards"); if (resourceGuardsName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGuards'.", id))); } - this.deleteWithResponse(resourceGroupName, resourceGuardsName, Context.NONE); + this.deleteByResourceGroupWithResponse(resourceGroupName, resourceGuardsName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -430,13 +430,13 @@ public Response deleteByIdWithResponse(String id, Context context) { } String resourceGuardsName = Utils.getValueFromIdByName(id, "resourceGuards"); if (resourceGuardsName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGuards'.", id))); } - return this.deleteWithResponse(resourceGroupName, resourceGuardsName, context); + return this.deleteByResourceGroupWithResponse(resourceGroupName, resourceGuardsName, context); } private ResourceGuardsClient serviceClient() { diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RestorableTimeRangesClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RestorableTimeRangesClientImpl.java index c020605b8440..7a93cdb30ab2 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RestorableTimeRangesClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RestorableTimeRangesClientImpl.java @@ -22,7 +22,6 @@ 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.dataprotection.fluent.RestorableTimeRangesClient; import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupFindRestorableTimeRangesResponseResourceInner; import com.azure.resourcemanager.dataprotection.models.AzureBackupFindRestorableTimeRangesRequest; @@ -30,8 +29,6 @@ /** An instance of this class provides access to all the operations defined in RestorableTimeRangesClient. */ public final class RestorableTimeRangesClientImpl implements RestorableTimeRangesClient { - private final ClientLogger logger = new ClientLogger(RestorableTimeRangesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final RestorableTimeRangesService service; @@ -56,7 +53,7 @@ public final class RestorableTimeRangesClientImpl implements RestorableTimeRange */ @Host("{$host}") @ServiceInterface(name = "DataProtectionClient") - private interface RestorableTimeRangesService { + public interface RestorableTimeRangesService { @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" @@ -66,9 +63,9 @@ private interface RestorableTimeRangesService { Mono> find( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @BodyParam("application/json") AzureBackupFindRestorableTimeRangesRequest parameters, @HeaderParam("Accept") String accept, @@ -76,19 +73,21 @@ Mono> find( } /** - * @param vaultName The name of the backup vault. + * The find operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 list Restore Ranges Response. + * @return list Restore Ranges Response along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> findWithResponseAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, AzureBackupFindRestorableTimeRangesRequest parameters) { if (this.client.getEndpoint() == null) { @@ -97,19 +96,19 @@ private Mono> 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -127,9 +126,9 @@ private Mono> .find( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, parameters, accept, @@ -138,20 +137,22 @@ private Mono> } /** - * @param vaultName The name of the backup vault. + * The find operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 list Restore Ranges Response. + * @return list Restore Ranges Response along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> findWithResponseAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, AzureBackupFindRestorableTimeRangesRequest parameters, Context context) { @@ -161,19 +162,19 @@ private Mono> 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } if (backupInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null.")); @@ -189,9 +190,9 @@ private Mono> .find( this.client.getEndpoint(), this.client.getApiVersion(), - vaultName, - resourceGroupName, this.client.getSubscriptionId(), + resourceGroupName, + vaultName, backupInstanceName, parameters, accept, @@ -199,69 +200,68 @@ private Mono> } /** - * @param vaultName The name of the backup vault. + * The find operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 list Restore Ranges Response. + * @return list Restore Ranges Response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono findAsync( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, AzureBackupFindRestorableTimeRangesRequest parameters) { - return findWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return findWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * @param vaultName The name of the backup vault. + * The find operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 list Restore Ranges Response. + * @return list Restore Ranges Response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AzureBackupFindRestorableTimeRangesResponseResourceInner find( - String vaultName, + public Response findWithResponse( String resourceGroupName, + String vaultName, String backupInstanceName, - AzureBackupFindRestorableTimeRangesRequest parameters) { - return findAsync(vaultName, resourceGroupName, backupInstanceName, parameters).block(); + AzureBackupFindRestorableTimeRangesRequest parameters, + Context context) { + return findWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context).block(); } /** - * @param vaultName The name of the backup vault. + * The find operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 list Restore Ranges Response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response findWithResponse( - String vaultName, + public AzureBackupFindRestorableTimeRangesResponseResourceInner find( String resourceGroupName, + String vaultName, String backupInstanceName, - AzureBackupFindRestorableTimeRangesRequest parameters, - Context context) { - return findWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context).block(); + AzureBackupFindRestorableTimeRangesRequest parameters) { + return findWithResponse(resourceGroupName, vaultName, backupInstanceName, parameters, Context.NONE).getValue(); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RestorableTimeRangesImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RestorableTimeRangesImpl.java index 9bba70072f7d..df3b1c09ef5a 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RestorableTimeRangesImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/RestorableTimeRangesImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.dataprotection.models.AzureBackupFindRestorableTimeRangesRequest; import com.azure.resourcemanager.dataprotection.models.AzureBackupFindRestorableTimeRangesResponseResource; import com.azure.resourcemanager.dataprotection.models.RestorableTimeRanges; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class RestorableTimeRangesImpl implements RestorableTimeRanges { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorableTimeRangesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(RestorableTimeRangesImpl.class); private final RestorableTimeRangesClient innerClient; @@ -29,30 +28,16 @@ public RestorableTimeRangesImpl( this.serviceManager = serviceManager; } - public AzureBackupFindRestorableTimeRangesResponseResource find( - String vaultName, - String resourceGroupName, - String backupInstanceName, - AzureBackupFindRestorableTimeRangesRequest parameters) { - AzureBackupFindRestorableTimeRangesResponseResourceInner inner = - this.serviceClient().find(vaultName, resourceGroupName, backupInstanceName, parameters); - if (inner != null) { - return new AzureBackupFindRestorableTimeRangesResponseResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response findWithResponse( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, AzureBackupFindRestorableTimeRangesRequest parameters, Context context) { Response inner = this .serviceClient() - .findWithResponse(vaultName, resourceGroupName, backupInstanceName, parameters, context); + .findWithResponse(resourceGroupName, vaultName, backupInstanceName, parameters, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -64,6 +49,20 @@ public Response findWithRes } } + public AzureBackupFindRestorableTimeRangesResponseResource find( + String resourceGroupName, + String vaultName, + String backupInstanceName, + AzureBackupFindRestorableTimeRangesRequest parameters) { + AzureBackupFindRestorableTimeRangesResponseResourceInner inner = + this.serviceClient().find(resourceGroupName, vaultName, backupInstanceName, parameters); + if (inner != null) { + return new AzureBackupFindRestorableTimeRangesResponseResourceImpl(inner, this.manager()); + } else { + return null; + } + } + private RestorableTimeRangesClient serviceClient() { return this.innerClient; } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/UnlockDeleteResponseImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/UnlockDeleteResponseImpl.java new file mode 100644 index 000000000000..d7e88380d248 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/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.dataprotection.implementation; + +import com.azure.resourcemanager.dataprotection.fluent.models.UnlockDeleteResponseInner; +import com.azure.resourcemanager.dataprotection.models.UnlockDeleteResponse; + +public final class UnlockDeleteResponseImpl implements UnlockDeleteResponse { + private UnlockDeleteResponseInner innerObject; + + private final com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager; + + UnlockDeleteResponseImpl( + UnlockDeleteResponseInner innerObject, + com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String unlockDeleteExpiryTime() { + return this.innerModel().unlockDeleteExpiryTime(); + } + + public UnlockDeleteResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dataprotection.DataProtectionManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AbsoluteDeleteOption.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AbsoluteDeleteOption.java index 40c06dcc2009..c4ab83aedd73 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AbsoluteDeleteOption.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AbsoluteDeleteOption.java @@ -5,17 +5,21 @@ package com.azure.resourcemanager.dataprotection.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.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** AbsoluteDeleteOption Delete option with duration. */ +/** + * AbsoluteDeleteOption + * + *

Delete option with duration. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("AbsoluteDeleteOption") @Fluent public final class AbsoluteDeleteOption extends DeleteOption { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AbsoluteDeleteOption.class); + /** Creates an instance of AbsoluteDeleteOption class. */ + public AbsoluteDeleteOption() { + } /** {@inheritDoc} */ @Override diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AbsoluteMarker.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AbsoluteMarker.java index 57c1ff536962..273f20120cf8 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AbsoluteMarker.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AbsoluteMarker.java @@ -36,7 +36,11 @@ public static AbsoluteMarker fromString(String name) { return fromString(name, AbsoluteMarker.class); } - /** @return known AbsoluteMarker values. */ + /** + * Gets known AbsoluteMarker values. + * + * @return known AbsoluteMarker values. + */ public static Collection values() { return values(AbsoluteMarker.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdHocBackupRuleOptions.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdHocBackupRuleOptions.java index 7f5b684ce252..dbbfb711f2ee 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdHocBackupRuleOptions.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdHocBackupRuleOptions.java @@ -6,14 +6,15 @@ 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; -/** AdHocBackupRuleOptions Adhoc backup rules. */ +/** + * AdHocBackupRuleOptions + * + *

Adhoc backup rules. + */ @Fluent public final class AdHocBackupRuleOptions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AdHocBackupRuleOptions.class); - /* * The ruleName property. */ @@ -21,11 +22,17 @@ public final class AdHocBackupRuleOptions { private String ruleName; /* - * AdhocBackupTriggerOption Adhoc backup trigger option + * AdhocBackupTriggerOption + * + * Adhoc backup trigger option */ @JsonProperty(value = "triggerOption", required = true) private AdhocBackupTriggerOption triggerOption; + /** Creates an instance of AdHocBackupRuleOptions class. */ + public AdHocBackupRuleOptions() { + } + /** * Get the ruleName property: The ruleName property. * @@ -47,7 +54,9 @@ public AdHocBackupRuleOptions withRuleName(String ruleName) { } /** - * Get the triggerOption property: AdhocBackupTriggerOption Adhoc backup trigger option. + * Get the triggerOption property: AdhocBackupTriggerOption + * + *

Adhoc backup trigger option. * * @return the triggerOption value. */ @@ -56,7 +65,9 @@ public AdhocBackupTriggerOption triggerOption() { } /** - * Set the triggerOption property: AdhocBackupTriggerOption Adhoc backup trigger option. + * Set the triggerOption property: AdhocBackupTriggerOption + * + *

Adhoc backup trigger option. * * @param triggerOption the triggerOption value to set. * @return the AdHocBackupRuleOptions object itself. @@ -73,12 +84,12 @@ public AdHocBackupRuleOptions withTriggerOption(AdhocBackupTriggerOption trigger */ public void validate() { if (ruleName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property ruleName in model AdHocBackupRuleOptions")); } if (triggerOption() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property triggerOption in model AdHocBackupRuleOptions")); @@ -86,4 +97,6 @@ public void validate() { triggerOption().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(AdHocBackupRuleOptions.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdhocBackupTriggerOption.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdhocBackupTriggerOption.java index 711b8b4c5b12..f90b4aa57a94 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdhocBackupTriggerOption.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdhocBackupTriggerOption.java @@ -5,21 +5,25 @@ package com.azure.resourcemanager.dataprotection.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; -/** AdhocBackupTriggerOption Adhoc backup trigger option. */ +/** + * AdhocBackupTriggerOption + * + *

Adhoc backup trigger option. + */ @Fluent public final class AdhocBackupTriggerOption { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AdhocBackupTriggerOption.class); - /* * The retentionTagOverride property. */ @JsonProperty(value = "retentionTagOverride") private String retentionTagOverride; + /** Creates an instance of AdhocBackupTriggerOption class. */ + public AdhocBackupTriggerOption() { + } + /** * Get the retentionTagOverride property: The retentionTagOverride property. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdhocBasedTaggingCriteria.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdhocBasedTaggingCriteria.java index 9b1cb6c1c8ea..0c0266bac532 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdhocBasedTaggingCriteria.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdhocBasedTaggingCriteria.java @@ -5,23 +5,31 @@ package com.azure.resourcemanager.dataprotection.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; -/** AdhocBasedTaggingCriteria Adhoc backup tagging criteria. */ +/** + * AdhocBasedTaggingCriteria + * + *

Adhoc backup tagging criteria. + */ @Fluent public final class AdhocBasedTaggingCriteria { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AdhocBasedTaggingCriteria.class); - /* - * RetentionTag Retention tag information + * RetentionTag + * + * Retention tag information */ @JsonProperty(value = "tagInfo") private RetentionTag tagInfo; + /** Creates an instance of AdhocBasedTaggingCriteria class. */ + public AdhocBasedTaggingCriteria() { + } + /** - * Get the tagInfo property: RetentionTag Retention tag information. + * Get the tagInfo property: RetentionTag + * + *

Retention tag information. * * @return the tagInfo value. */ @@ -30,7 +38,9 @@ public RetentionTag tagInfo() { } /** - * Set the tagInfo property: RetentionTag Retention tag information. + * Set the tagInfo property: RetentionTag + * + *

Retention tag information. * * @param tagInfo the tagInfo value to set. * @return the AdhocBasedTaggingCriteria object itself. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdhocBasedTriggerContext.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdhocBasedTriggerContext.java index d070b54c6dfa..e622d787ffc7 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdhocBasedTriggerContext.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AdhocBasedTriggerContext.java @@ -6,28 +6,35 @@ 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; -/** AdhocBasedTriggerContext Adhoc trigger context. */ +/** + * AdhocBasedTriggerContext + * + *

Adhoc trigger context. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("AdhocBasedTriggerContext") @Fluent public final class AdhocBasedTriggerContext extends TriggerContext { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AdhocBasedTriggerContext.class); - /* - * AdhocBasedTaggingCriteria Tagging Criteria containing retention tag for - * adhoc backup. + * AdhocBasedTaggingCriteria + * + * Tagging Criteria containing retention tag for adhoc backup. */ @JsonProperty(value = "taggingCriteria", required = true) private AdhocBasedTaggingCriteria taggingCriteria; + /** Creates an instance of AdhocBasedTriggerContext class. */ + public AdhocBasedTriggerContext() { + } + /** - * Get the taggingCriteria property: AdhocBasedTaggingCriteria Tagging Criteria containing retention tag for adhoc - * backup. + * Get the taggingCriteria property: AdhocBasedTaggingCriteria + * + *

Tagging Criteria containing retention tag for adhoc backup. * * @return the taggingCriteria value. */ @@ -36,8 +43,9 @@ public AdhocBasedTaggingCriteria taggingCriteria() { } /** - * Set the taggingCriteria property: AdhocBasedTaggingCriteria Tagging Criteria containing retention tag for adhoc - * backup. + * Set the taggingCriteria property: AdhocBasedTaggingCriteria + * + *

Tagging Criteria containing retention tag for adhoc backup. * * @param taggingCriteria the taggingCriteria value to set. * @return the AdhocBasedTriggerContext object itself. @@ -56,7 +64,7 @@ public AdhocBasedTriggerContext withTaggingCriteria(AdhocBasedTaggingCriteria ta public void validate() { super.validate(); if (taggingCriteria() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property taggingCriteria in model AdhocBasedTriggerContext")); @@ -64,4 +72,6 @@ public void validate() { taggingCriteria().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(AdhocBasedTriggerContext.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AlertsState.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AlertsState.java new file mode 100644 index 000000000000..49768c1df95c --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AlertsState.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.dataprotection.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AlertsState. */ +public final class AlertsState extends ExpandableStringEnum { + /** Static value Enabled for AlertsState. */ + public static final AlertsState ENABLED = fromString("Enabled"); + + /** Static value Disabled for AlertsState. */ + public static final AlertsState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a AlertsState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AlertsState. + */ + @JsonCreator + public static AlertsState fromString(String name) { + return fromString(name, AlertsState.class); + } + + /** + * Gets known AlertsState values. + * + * @return known AlertsState values. + */ + public static Collection values() { + return values(AlertsState.class); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AuthCredentials.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AuthCredentials.java index a2cd8f6bef48..548a2d554780 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AuthCredentials.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AuthCredentials.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.dataprotection.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; @@ -23,7 +21,9 @@ }) @Immutable public class AuthCredentials { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthCredentials.class); + /** Creates an instance of AuthCredentials class. */ + public AuthCredentials() { + } /** * Validates the instance. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupDiscreteRecoveryPoint.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupDiscreteRecoveryPoint.java index 2565d2a1d245..578bad4fb851 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupDiscreteRecoveryPoint.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupDiscreteRecoveryPoint.java @@ -6,20 +6,21 @@ 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; -/** AzureBackupDiscreteRecoveryPoint Azure backup discrete RecoveryPoint. */ +/** + * AzureBackupDiscreteRecoveryPoint + * + *

Azure backup discrete RecoveryPoint. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("AzureBackupDiscreteRecoveryPoint") @Fluent public final class AzureBackupDiscreteRecoveryPoint extends AzureBackupRecoveryPoint { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupDiscreteRecoveryPoint.class); - /* * The friendlyName property. */ @@ -74,6 +75,10 @@ public final class AzureBackupDiscreteRecoveryPoint extends AzureBackupRecoveryP @JsonProperty(value = "retentionTagVersion") private String retentionTagVersion; + /** Creates an instance of AzureBackupDiscreteRecoveryPoint class. */ + public AzureBackupDiscreteRecoveryPoint() { + } + /** * Get the friendlyName property: The friendlyName property. * @@ -267,10 +272,12 @@ public void validate() { recoveryPointDataStoresDetails().forEach(e -> e.validate()); } if (recoveryPointTime() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property recoveryPointTime in model AzureBackupDiscreteRecoveryPoint")); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBackupDiscreteRecoveryPoint.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupFindRestorableTimeRangesRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupFindRestorableTimeRangesRequest.java index 2d2a4f238f07..7022070ef891 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupFindRestorableTimeRangesRequest.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupFindRestorableTimeRangesRequest.java @@ -6,14 +6,11 @@ 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; /** List Restore Ranges Request. */ @Fluent public final class AzureBackupFindRestorableTimeRangesRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupFindRestorableTimeRangesRequest.class); - /* * Gets or sets the type of the source data store. */ @@ -32,6 +29,10 @@ public final class AzureBackupFindRestorableTimeRangesRequest { @JsonProperty(value = "endTime") private String endTime; + /** Creates an instance of AzureBackupFindRestorableTimeRangesRequest class. */ + public AzureBackupFindRestorableTimeRangesRequest() { + } + /** * Get the sourceDataStoreType property: Gets or sets the type of the source data store. * @@ -100,11 +101,13 @@ public AzureBackupFindRestorableTimeRangesRequest withEndTime(String endTime) { */ public void validate() { if (sourceDataStoreType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceDataStoreType in model" + " AzureBackupFindRestorableTimeRangesRequest")); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBackupFindRestorableTimeRangesRequest.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupFindRestorableTimeRangesRequestResource.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupFindRestorableTimeRangesRequestResource.java index 143f9a904f52..43e299ebea4e 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupFindRestorableTimeRangesRequestResource.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupFindRestorableTimeRangesRequestResource.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.dataprotection.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; import java.util.Map; @@ -14,15 +12,16 @@ /** List Restore Ranges Request. */ @Fluent public final class AzureBackupFindRestorableTimeRangesRequestResource extends DppWorkerRequest { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(AzureBackupFindRestorableTimeRangesRequestResource.class); - /* * AzureBackupFindRestorableTimeRangesRequestResource content */ @JsonProperty(value = "content") private AzureBackupFindRestorableTimeRangesRequest content; + /** Creates an instance of AzureBackupFindRestorableTimeRangesRequestResource class. */ + public AzureBackupFindRestorableTimeRangesRequestResource() { + } + /** * Get the content property: AzureBackupFindRestorableTimeRangesRequestResource content. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupFindRestorableTimeRangesResponse.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupFindRestorableTimeRangesResponse.java index 44b70e9bb782..eb9390895420 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupFindRestorableTimeRangesResponse.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupFindRestorableTimeRangesResponse.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.dataprotection.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; /** List Restore Ranges Response. */ @Fluent public final class AzureBackupFindRestorableTimeRangesResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupFindRestorableTimeRangesResponse.class); - /* * Returns the Restore Ranges available on the Backup Instance. */ @@ -27,6 +23,10 @@ public final class AzureBackupFindRestorableTimeRangesResponse { @JsonProperty(value = "objectType") private String objectType; + /** Creates an instance of AzureBackupFindRestorableTimeRangesResponse class. */ + public AzureBackupFindRestorableTimeRangesResponse() { + } + /** * Get the restorableTimeRanges property: Returns the Restore Ranges available on the Backup Instance. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupJob.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupJob.java index 1851cce68605..a1c0b46544c6 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupJob.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupJob.java @@ -6,7 +6,6 @@ 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.time.OffsetDateTime; import java.util.List; @@ -14,8 +13,6 @@ /** AzureBackup Job Class. */ @Fluent public final class AzureBackupJob { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupJob.class); - /* * Job Activity Id */ @@ -95,8 +92,8 @@ public final class AzureBackupJob { private boolean isUserTriggered; /* - * It indicates the type of Job i.e. Backup:full/log/diff ;Restore:ALR/OLR; - * Tiering:Backup/Archive ; Management:ConfigureProtection/UnConfigure + * It indicates the type of Job i.e. Backup:full/log/diff ;Restore:ALR/OLR; Tiering:Backup/Archive ; + * Management:ConfigureProtection/UnConfigure */ @JsonProperty(value = "operation", required = true) private String operation; @@ -132,8 +129,7 @@ public final class AzureBackupJob { private String progressUrl; /* - * It indicates the sub type of operation i.e. in case of Restore it can be - * ALR/OLR + * It indicates the sub type of operation i.e. in case of Restore it can be ALR/OLR */ @JsonProperty(value = "restoreType", access = JsonProperty.Access.WRITE_ONLY) private String restoreType; @@ -157,8 +153,7 @@ public final class AzureBackupJob { private OffsetDateTime startTime; /* - * Status of the job like - * InProgress/Success/Failed/Cancelled/SuccessWithWarning + * Status of the job like InProgress/Success/Failed/Cancelled/SuccessWithWarning */ @JsonProperty(value = "status", required = true) private String status; @@ -199,6 +194,10 @@ public final class AzureBackupJob { @JsonProperty(value = "destinationDataStoreName") private String destinationDataStoreName; + /** Creates an instance of AzureBackupJob class. */ + public AzureBackupJob() { + } + /** * Get the activityId property: Job Activity Id. * @@ -720,34 +719,34 @@ public AzureBackupJob withDestinationDataStoreName(String destinationDataStoreNa */ public void validate() { if (activityId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property activityId in model AzureBackupJob")); } if (backupInstanceFriendlyName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property backupInstanceFriendlyName in model AzureBackupJob")); } if (dataSourceId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property dataSourceId in model AzureBackupJob")); } if (dataSourceLocation() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property dataSourceLocation in model AzureBackupJob")); } if (dataSourceName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property dataSourceName in model AzureBackupJob")); } if (dataSourceType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property dataSourceType in model AzureBackupJob")); } @@ -758,52 +757,54 @@ public void validate() { extendedInfo().validate(); } if (operation() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property operation in model AzureBackupJob")); } if (operationCategory() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property operationCategory in model AzureBackupJob")); } if (sourceResourceGroup() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceResourceGroup in model AzureBackupJob")); } if (sourceSubscriptionId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceSubscriptionId in model AzureBackupJob")); } if (startTime() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property startTime in model AzureBackupJob")); } if (status() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property status in model AzureBackupJob")); } if (subscriptionId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property subscriptionId in model AzureBackupJob")); } if (supportedActions() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property supportedActions in model AzureBackupJob")); } if (vaultName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property vaultName in model AzureBackupJob")); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBackupJob.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupJobResourceList.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupJobResourceList.java index 5e07952c798f..21c049979559 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupJobResourceList.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupJobResourceList.java @@ -5,23 +5,23 @@ package com.azure.resourcemanager.dataprotection.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupJobResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** List of AzureBackup Job resources. */ @Fluent public final class AzureBackupJobResourceList extends DppResourceList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupJobResourceList.class); - /* * List of resources. */ @JsonProperty(value = "value") private List value; + /** Creates an instance of AzureBackupJobResourceList class. */ + public AzureBackupJobResourceList() { + } + /** * Get the value property: List of resources. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupParams.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupParams.java index 02bfa0b4fd1f..b8bf244138db 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupParams.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupParams.java @@ -6,24 +6,29 @@ 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; -/** AzureBackupParams Azure backup parameters. */ +/** + * AzureBackupParams + * + *

Azure backup parameters. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("AzureBackupParams") @Fluent public final class AzureBackupParams extends BackupParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupParams.class); - /* * BackupType ; Full/Incremental etc */ @JsonProperty(value = "backupType", required = true) private String backupType; + /** Creates an instance of AzureBackupParams class. */ + public AzureBackupParams() { + } + /** * Get the backupType property: BackupType ; Full/Incremental etc. * @@ -53,9 +58,11 @@ public AzureBackupParams withBackupType(String backupType) { public void validate() { super.validate(); if (backupType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property backupType in model AzureBackupParams")); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBackupParams.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPoint.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPoint.java index 91d964de7f85..b49f4a08d2ca 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPoint.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPoint.java @@ -5,13 +5,15 @@ package com.azure.resourcemanager.dataprotection.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; -/** AzureBackupRecoveryPoint Azure backup recoveryPoint. */ +/** + * AzureBackupRecoveryPoint + * + *

Azure backup recoveryPoint. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -23,7 +25,9 @@ }) @Immutable public class AzureBackupRecoveryPoint { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupRecoveryPoint.class); + /** Creates an instance of AzureBackupRecoveryPoint class. */ + public AzureBackupRecoveryPoint() { + } /** * Validates the instance. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPointBasedRestoreRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPointBasedRestoreRequest.java index f38bb4427d13..94ea6bc8dc45 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPointBasedRestoreRequest.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPointBasedRestoreRequest.java @@ -6,13 +6,16 @@ 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; -/** AzureBackupRecoveryPointBasedRestoreRequest Azure backup recoveryPoint based restore request. */ +/** + * AzureBackupRecoveryPointBasedRestoreRequest + * + *

Azure backup recoveryPoint based restore request. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -26,14 +29,16 @@ }) @Fluent public class AzureBackupRecoveryPointBasedRestoreRequest extends AzureBackupRestoreRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupRecoveryPointBasedRestoreRequest.class); - /* * The recoveryPointId property. */ @JsonProperty(value = "recoveryPointId", required = true) private String recoveryPointId; + /** Creates an instance of AzureBackupRecoveryPointBasedRestoreRequest class. */ + public AzureBackupRecoveryPointBasedRestoreRequest() { + } + /** * Get the recoveryPointId property: The recoveryPointId property. * @@ -69,6 +74,13 @@ public AzureBackupRecoveryPointBasedRestoreRequest withSourceDataStoreType( return this; } + /** {@inheritDoc} */ + @Override + public AzureBackupRecoveryPointBasedRestoreRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + /** * Validates the instance. * @@ -78,11 +90,13 @@ public AzureBackupRecoveryPointBasedRestoreRequest withSourceDataStoreType( public void validate() { super.validate(); if (recoveryPointId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property recoveryPointId in model" + " AzureBackupRecoveryPointBasedRestoreRequest")); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBackupRecoveryPointBasedRestoreRequest.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPointResource.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPointResource.java index 847adb60b9af..87c221652a32 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPointResource.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPointResource.java @@ -38,7 +38,9 @@ public interface AzureBackupRecoveryPointResource { SystemData systemData(); /** - * Gets the properties property: AzureBackupRecoveryPoint AzureBackupRecoveryPointResource properties. + * Gets the properties property: AzureBackupRecoveryPoint + * + *

AzureBackupRecoveryPointResource properties. * * @return the properties value. */ diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPointResourceList.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPointResourceList.java index 7d874a2d7895..6ade06dda218 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPointResourceList.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPointResourceList.java @@ -5,23 +5,27 @@ package com.azure.resourcemanager.dataprotection.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupRecoveryPointResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** AzureBackupRecoveryPointResourceList Azure backup recoveryPoint resource list. */ +/** + * AzureBackupRecoveryPointResourceList + * + *

Azure backup recoveryPoint resource list. + */ @Fluent public final class AzureBackupRecoveryPointResourceList extends DppResourceList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupRecoveryPointResourceList.class); - /* * List of resources. */ @JsonProperty(value = "value") private List value; + /** Creates an instance of AzureBackupRecoveryPointResourceList class. */ + public AzureBackupRecoveryPointResourceList() { + } + /** * Get the value property: List of resources. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryTimeBasedRestoreRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryTimeBasedRestoreRequest.java index 5915906c00d8..09bf9f30d004 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryTimeBasedRestoreRequest.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryTimeBasedRestoreRequest.java @@ -6,25 +6,29 @@ 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; -/** AzureBackupRecoveryTimeBasedRestoreRequest AzureBackup RecoveryPointTime Based Restore Request. */ +/** + * AzureBackupRecoveryTimeBasedRestoreRequest + * + *

AzureBackup RecoveryPointTime Based Restore Request. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("AzureBackupRecoveryTimeBasedRestoreRequest") @Fluent public final class AzureBackupRecoveryTimeBasedRestoreRequest extends AzureBackupRestoreRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupRecoveryTimeBasedRestoreRequest.class); - /* - * The recovery time in ISO 8601 format example - - * 2020-08-14T17:30:00.0000000Z. + * The recovery time in ISO 8601 format example - 2020-08-14T17:30:00.0000000Z. */ @JsonProperty(value = "recoveryPointTime", required = true) private String recoveryPointTime; + /** Creates an instance of AzureBackupRecoveryTimeBasedRestoreRequest class. */ + public AzureBackupRecoveryTimeBasedRestoreRequest() { + } + /** * Get the recoveryPointTime property: The recovery time in ISO 8601 format example - 2020-08-14T17:30:00.0000000Z. * @@ -59,6 +63,13 @@ public AzureBackupRecoveryTimeBasedRestoreRequest withSourceDataStoreType(Source return this; } + /** {@inheritDoc} */ + @Override + public AzureBackupRecoveryTimeBasedRestoreRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + /** * Validates the instance. * @@ -68,11 +79,13 @@ public AzureBackupRecoveryTimeBasedRestoreRequest withSourceDataStoreType(Source public void validate() { super.validate(); if (recoveryPointTime() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property recoveryPointTime in model" + " AzureBackupRecoveryTimeBasedRestoreRequest")); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBackupRecoveryTimeBasedRestoreRequest.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRehydrationRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRehydrationRequest.java index e1a00d7d27d0..d54b17413c15 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRehydrationRequest.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRehydrationRequest.java @@ -6,14 +6,15 @@ 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; -/** AzureBackupRehydrationRequest Azure Backup Rehydrate Request. */ +/** + * AzureBackupRehydrationRequest + * + *

Azure Backup Rehydrate Request. + */ @Fluent public final class AzureBackupRehydrationRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupRehydrationRequest.class); - /* * Id of the recovery point to be recovered */ @@ -32,6 +33,10 @@ public final class AzureBackupRehydrationRequest { @JsonProperty(value = "rehydrationRetentionDuration", required = true) private String rehydrationRetentionDuration; + /** Creates an instance of AzureBackupRehydrationRequest class. */ + public AzureBackupRehydrationRequest() { + } + /** * Get the recoveryPointId property: Id of the recovery point to be recovered. * @@ -99,17 +104,19 @@ public AzureBackupRehydrationRequest withRehydrationRetentionDuration(String reh */ public void validate() { if (recoveryPointId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property recoveryPointId in model AzureBackupRehydrationRequest")); } if (rehydrationRetentionDuration() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property rehydrationRetentionDuration in model" + " AzureBackupRehydrationRequest")); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBackupRehydrationRequest.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRestoreRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRestoreRequest.java index a12b864492d5..608bedde5ecc 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRestoreRequest.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRestoreRequest.java @@ -6,13 +6,16 @@ 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; -/** AzureBackupRestoreRequest Azure backup restore request. */ +/** + * AzureBackupRestoreRequest + * + *

Azure backup restore request. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -29,8 +32,6 @@ }) @Fluent public class AzureBackupRestoreRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupRestoreRequest.class); - /* * Gets or sets the restore target information. */ @@ -43,6 +44,16 @@ public class AzureBackupRestoreRequest { @JsonProperty(value = "sourceDataStoreType", required = true) private SourceDataStoreType sourceDataStoreType; + /* + * Fully qualified Azure Resource Manager ID of the datasource which is being recovered. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /** Creates an instance of AzureBackupRestoreRequest class. */ + public AzureBackupRestoreRequest() { + } + /** * Get the restoreTargetInfo property: Gets or sets the restore target information. * @@ -83,6 +94,28 @@ public AzureBackupRestoreRequest withSourceDataStoreType(SourceDataStoreType sou return this; } + /** + * Get the sourceResourceId property: Fully qualified Azure Resource Manager ID of the datasource which is being + * recovered. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: Fully qualified Azure Resource Manager ID of the datasource which is being + * recovered. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the AzureBackupRestoreRequest object itself. + */ + public AzureBackupRestoreRequest withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + /** * Validates the instance. * @@ -90,7 +123,7 @@ public AzureBackupRestoreRequest withSourceDataStoreType(SourceDataStoreType sou */ public void validate() { if (restoreTargetInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property restoreTargetInfo in model AzureBackupRestoreRequest")); @@ -98,10 +131,12 @@ public void validate() { restoreTargetInfo().validate(); } if (sourceDataStoreType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceDataStoreType in model AzureBackupRestoreRequest")); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBackupRestoreRequest.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRestoreWithRehydrationRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRestoreWithRehydrationRequest.java index d38a9d00c451..20bb5c5eea08 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRestoreWithRehydrationRequest.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRestoreWithRehydrationRequest.java @@ -6,18 +6,19 @@ 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; -/** AzureBackupRestoreWithRehydrationRequest AzureBackup Restore with Rehydration Request. */ +/** + * AzureBackupRestoreWithRehydrationRequest + * + *

AzureBackup Restore with Rehydration Request. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("AzureBackupRestoreWithRehydrationRequest") @Fluent public final class AzureBackupRestoreWithRehydrationRequest extends AzureBackupRecoveryPointBasedRestoreRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupRestoreWithRehydrationRequest.class); - /* * Priority to be used for rehydration. Values High or Standard */ @@ -30,6 +31,10 @@ public final class AzureBackupRestoreWithRehydrationRequest extends AzureBackupR @JsonProperty(value = "rehydrationRetentionDuration", required = true) private String rehydrationRetentionDuration; + /** Creates an instance of AzureBackupRestoreWithRehydrationRequest class. */ + public AzureBackupRestoreWithRehydrationRequest() { + } + /** * Get the rehydrationPriority property: Priority to be used for rehydration. Values High or Standard. * @@ -92,6 +97,13 @@ public AzureBackupRestoreWithRehydrationRequest withSourceDataStoreType(SourceDa return this; } + /** {@inheritDoc} */ + @Override + public AzureBackupRestoreWithRehydrationRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + /** * Validates the instance. * @@ -101,18 +113,20 @@ public AzureBackupRestoreWithRehydrationRequest withSourceDataStoreType(SourceDa public void validate() { super.validate(); if (rehydrationPriority() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property rehydrationPriority in model" + " AzureBackupRestoreWithRehydrationRequest")); } if (rehydrationRetentionDuration() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property rehydrationRetentionDuration in model" + " AzureBackupRestoreWithRehydrationRequest")); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBackupRestoreWithRehydrationRequest.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRule.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRule.java index 0e6d2b189fea..4fdef45092f6 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRule.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRule.java @@ -6,38 +6,51 @@ 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; -/** AzureBackupRule Azure backup rule. */ +/** + * AzureBackupRule + * + *

Azure backup rule. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("AzureBackupRule") @Fluent public final class AzureBackupRule extends BasePolicyRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupRule.class); - /* - * BackupParameters BackupParameters base + * BackupParameters + * + * BackupParameters base */ @JsonProperty(value = "backupParameters") private BackupParameters backupParameters; /* - * DataStoreInfoBase DataStoreInfo base + * DataStoreInfoBase + * + * DataStoreInfo base */ @JsonProperty(value = "dataStore", required = true) private DataStoreInfoBase dataStore; /* - * TriggerContext Trigger context + * TriggerContext + * + * Trigger context */ @JsonProperty(value = "trigger", required = true) private TriggerContext trigger; + /** Creates an instance of AzureBackupRule class. */ + public AzureBackupRule() { + } + /** - * Get the backupParameters property: BackupParameters BackupParameters base. + * Get the backupParameters property: BackupParameters + * + *

BackupParameters base. * * @return the backupParameters value. */ @@ -46,7 +59,9 @@ public BackupParameters backupParameters() { } /** - * Set the backupParameters property: BackupParameters BackupParameters base. + * Set the backupParameters property: BackupParameters + * + *

BackupParameters base. * * @param backupParameters the backupParameters value to set. * @return the AzureBackupRule object itself. @@ -57,7 +72,9 @@ public AzureBackupRule withBackupParameters(BackupParameters backupParameters) { } /** - * Get the dataStore property: DataStoreInfoBase DataStoreInfo base. + * Get the dataStore property: DataStoreInfoBase + * + *

DataStoreInfo base. * * @return the dataStore value. */ @@ -66,7 +83,9 @@ public DataStoreInfoBase dataStore() { } /** - * Set the dataStore property: DataStoreInfoBase DataStoreInfo base. + * Set the dataStore property: DataStoreInfoBase + * + *

DataStoreInfo base. * * @param dataStore the dataStore value to set. * @return the AzureBackupRule object itself. @@ -77,7 +96,9 @@ public AzureBackupRule withDataStore(DataStoreInfoBase dataStore) { } /** - * Get the trigger property: TriggerContext Trigger context. + * Get the trigger property: TriggerContext + * + *

Trigger context. * * @return the trigger value. */ @@ -86,7 +107,9 @@ public TriggerContext trigger() { } /** - * Set the trigger property: TriggerContext Trigger context. + * Set the trigger property: TriggerContext + * + *

Trigger context. * * @param trigger the trigger value to set. * @return the AzureBackupRule object itself. @@ -115,18 +138,20 @@ public void validate() { backupParameters().validate(); } if (dataStore() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property dataStore in model AzureBackupRule")); } else { dataStore().validate(); } if (trigger() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property trigger in model AzureBackupRule")); } else { trigger().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBackupRule.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureMonitorAlertSettings.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureMonitorAlertSettings.java new file mode 100644 index 000000000000..a3d7ff6a2a9b --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureMonitorAlertSettings.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.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings for Azure Monitor based alerts. */ +@Fluent +public final class AzureMonitorAlertSettings { + /* + * The alertsForAllJobFailures property. + */ + @JsonProperty(value = "alertsForAllJobFailures") + private AlertsState alertsForAllJobFailures; + + /** Creates an instance of AzureMonitorAlertSettings class. */ + public AzureMonitorAlertSettings() { + } + + /** + * Get the alertsForAllJobFailures property: The alertsForAllJobFailures property. + * + * @return the alertsForAllJobFailures value. + */ + public AlertsState alertsForAllJobFailures() { + return this.alertsForAllJobFailures; + } + + /** + * Set the alertsForAllJobFailures property: The alertsForAllJobFailures property. + * + * @param alertsForAllJobFailures the alertsForAllJobFailures value to set. + * @return the AzureMonitorAlertSettings object itself. + */ + public AzureMonitorAlertSettings withAlertsForAllJobFailures(AlertsState alertsForAllJobFailures) { + this.alertsForAllJobFailures = alertsForAllJobFailures; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureOperationalStoreParameters.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureOperationalStoreParameters.java index 1e613e1a8360..cdd8edc20dca 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureOperationalStoreParameters.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureOperationalStoreParameters.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.dataprotection.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; @@ -16,14 +14,16 @@ @JsonTypeName("AzureOperationalStoreParameters") @Fluent public final class AzureOperationalStoreParameters extends DataStoreParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureOperationalStoreParameters.class); - /* * Gets or sets the Snapshot Resource Group Uri. */ @JsonProperty(value = "resourceGroupId") private String resourceGroupId; + /** Creates an instance of AzureOperationalStoreParameters class. */ + public AzureOperationalStoreParameters() { + } + /** * Get the resourceGroupId property: Gets or sets the Snapshot Resource Group Uri. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureRetentionRule.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureRetentionRule.java index 46df3e5779be..dc4c5e56e076 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureRetentionRule.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureRetentionRule.java @@ -6,19 +6,20 @@ 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; -/** AzureRetentionRule Azure retention rule. */ +/** + * AzureRetentionRule + * + *

Azure retention rule. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("AzureRetentionRule") @Fluent public final class AzureRetentionRule extends BasePolicyRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureRetentionRule.class); - /* * The isDefault property. */ @@ -31,6 +32,10 @@ public final class AzureRetentionRule extends BasePolicyRule { @JsonProperty(value = "lifecycles", required = true) private List lifecycles; + /** Creates an instance of AzureRetentionRule class. */ + public AzureRetentionRule() { + } + /** * Get the isDefault property: The isDefault property. * @@ -87,11 +92,13 @@ public AzureRetentionRule withName(String name) { public void validate() { super.validate(); if (lifecycles() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property lifecycles in model AzureRetentionRule")); } else { lifecycles().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureRetentionRule.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupCriteria.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupCriteria.java index c99b3ee5bcde..deda8b686927 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupCriteria.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupCriteria.java @@ -5,13 +5,15 @@ package com.azure.resourcemanager.dataprotection.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; -/** BackupCriteria BackupCriteria base class. */ +/** + * BackupCriteria + * + *

BackupCriteria base class. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -21,7 +23,9 @@ @JsonSubTypes({@JsonSubTypes.Type(name = "ScheduleBasedBackupCriteria", value = ScheduleBasedBackupCriteria.class)}) @Immutable public class BackupCriteria { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupCriteria.class); + /** Creates an instance of BackupCriteria class. */ + public BackupCriteria() { + } /** * Validates the instance. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupDatasourceParameters.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupDatasourceParameters.java new file mode 100644 index 000000000000..b2121e337112 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupDatasourceParameters.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.dataprotection.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Parameters for Backup Datasource. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = BackupDatasourceParameters.class) +@JsonTypeName("BackupDatasourceParameters") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "KubernetesClusterBackupDatasourceParameters", + value = KubernetesClusterBackupDatasourceParameters.class), + @JsonSubTypes.Type(name = "BlobBackupDatasourceParameters", value = BlobBackupDatasourceParameters.class) +}) +@Immutable +public class BackupDatasourceParameters { + /** Creates an instance of BackupDatasourceParameters class. */ + public BackupDatasourceParameters() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstance.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstance.java index c1a012b9867e..073a774fb984 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstance.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstance.java @@ -6,14 +6,11 @@ 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; /** Backup Instance. */ @Fluent -public final class BackupInstance { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupInstance.class); - +public class BackupInstance { /* * Gets or sets the Backup Instance friendly name. */ @@ -21,25 +18,33 @@ public final class BackupInstance { private String friendlyName; /* - * Datasource Gets or sets the data source information. + * Datasource + * + * Gets or sets the data source information. */ @JsonProperty(value = "dataSourceInfo", required = true) private Datasource dataSourceInfo; /* - * DatasourceSet Gets or sets the data source set information. + * DatasourceSet + * + * Gets or sets the data source set information. */ @JsonProperty(value = "dataSourceSetInfo") private DatasourceSet dataSourceSetInfo; /* - * PolicyInfo Gets or sets the policy information. + * PolicyInfo + * + * Gets or sets the policy information. */ @JsonProperty(value = "policyInfo", required = true) private PolicyInfo policyInfo; /* - * ProtectionStatusDetails Specifies the protection status of the resource + * ProtectionStatusDetails + * + * Specifies the protection status of the resource */ @JsonProperty(value = "protectionStatus", access = JsonProperty.Access.WRITE_ONLY) private ProtectionStatusDetails protectionStatus; @@ -57,8 +62,7 @@ public final class BackupInstance { private UserFacingError protectionErrorDetails; /* - * Specifies the provisioning state of the resource i.e. - * provisioning/updating/Succeeded/Failed + * Specifies the provisioning state of the resource i.e. provisioning/updating/Succeeded/Failed */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private String provisioningState; @@ -69,12 +73,23 @@ public final class BackupInstance { @JsonProperty(value = "datasourceAuthCredentials") private AuthCredentials datasourceAuthCredentials; + /* + * Specifies the type of validation. In case of DeepValidation, all validations from /validateForBackup API will + * run again. + */ + @JsonProperty(value = "validationType") + private ValidationType validationType; + /* * The objectType property. */ @JsonProperty(value = "objectType", required = true) private String objectType; + /** Creates an instance of BackupInstance class. */ + public BackupInstance() { + } + /** * Get the friendlyName property: Gets or sets the Backup Instance friendly name. * @@ -96,7 +111,9 @@ public BackupInstance withFriendlyName(String friendlyName) { } /** - * Get the dataSourceInfo property: Datasource Gets or sets the data source information. + * Get the dataSourceInfo property: Datasource + * + *

Gets or sets the data source information. * * @return the dataSourceInfo value. */ @@ -105,7 +122,9 @@ public Datasource dataSourceInfo() { } /** - * Set the dataSourceInfo property: Datasource Gets or sets the data source information. + * Set the dataSourceInfo property: Datasource + * + *

Gets or sets the data source information. * * @param dataSourceInfo the dataSourceInfo value to set. * @return the BackupInstance object itself. @@ -116,7 +135,9 @@ public BackupInstance withDataSourceInfo(Datasource dataSourceInfo) { } /** - * Get the dataSourceSetInfo property: DatasourceSet Gets or sets the data source set information. + * Get the dataSourceSetInfo property: DatasourceSet + * + *

Gets or sets the data source set information. * * @return the dataSourceSetInfo value. */ @@ -125,7 +146,9 @@ public DatasourceSet dataSourceSetInfo() { } /** - * Set the dataSourceSetInfo property: DatasourceSet Gets or sets the data source set information. + * Set the dataSourceSetInfo property: DatasourceSet + * + *

Gets or sets the data source set information. * * @param dataSourceSetInfo the dataSourceSetInfo value to set. * @return the BackupInstance object itself. @@ -136,7 +159,9 @@ public BackupInstance withDataSourceSetInfo(DatasourceSet dataSourceSetInfo) { } /** - * Get the policyInfo property: PolicyInfo Gets or sets the policy information. + * Get the policyInfo property: PolicyInfo + * + *

Gets or sets the policy information. * * @return the policyInfo value. */ @@ -145,7 +170,9 @@ public PolicyInfo policyInfo() { } /** - * Set the policyInfo property: PolicyInfo Gets or sets the policy information. + * Set the policyInfo property: PolicyInfo + * + *

Gets or sets the policy information. * * @param policyInfo the policyInfo value to set. * @return the BackupInstance object itself. @@ -156,7 +183,9 @@ public BackupInstance withPolicyInfo(PolicyInfo policyInfo) { } /** - * Get the protectionStatus property: ProtectionStatusDetails Specifies the protection status of the resource. + * Get the protectionStatus property: ProtectionStatusDetails + * + *

Specifies the protection status of the resource. * * @return the protectionStatus value. */ @@ -212,6 +241,28 @@ public BackupInstance withDatasourceAuthCredentials(AuthCredentials datasourceAu return this; } + /** + * Get the validationType property: Specifies the type of validation. In case of DeepValidation, all validations + * from /validateForBackup API will run again. + * + * @return the validationType value. + */ + public ValidationType validationType() { + return this.validationType; + } + + /** + * Set the validationType property: Specifies the type of validation. In case of DeepValidation, all validations + * from /validateForBackup API will run again. + * + * @param validationType the validationType value to set. + * @return the BackupInstance object itself. + */ + public BackupInstance withValidationType(ValidationType validationType) { + this.validationType = validationType; + return this; + } + /** * Get the objectType property: The objectType property. * @@ -239,7 +290,7 @@ public BackupInstance withObjectType(String objectType) { */ public void validate() { if (dataSourceInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property dataSourceInfo in model BackupInstance")); } else { @@ -249,7 +300,7 @@ public void validate() { dataSourceSetInfo().validate(); } if (policyInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property policyInfo in model BackupInstance")); } else { @@ -265,9 +316,11 @@ public void validate() { datasourceAuthCredentials().validate(); } if (objectType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property objectType in model BackupInstance")); } } + + private static final ClientLogger LOGGER = new ClientLogger(BackupInstance.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstanceResource.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstanceResource.java index fad249e635e8..f035f52f72aa 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstanceResource.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstanceResource.java @@ -7,6 +7,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.dataprotection.fluent.models.BackupInstanceResourceInner; +import java.util.Map; /** An immutable client-side representation of BackupInstanceResource. */ public interface BackupInstanceResource { @@ -31,6 +32,13 @@ public interface BackupInstanceResource { */ String type(); + /** + * Gets the tags property: Proxy Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * @@ -45,6 +53,13 @@ public interface BackupInstanceResource { */ BackupInstance properties(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.dataprotection.fluent.models.BackupInstanceResourceInner object. * @@ -64,19 +79,19 @@ interface Blank extends WithParentResource { /** The stage of the BackupInstanceResource definition allowing to specify parent resource. */ interface WithParentResource { /** - * Specifies vaultName, resourceGroupName. + * Specifies resourceGroupName, vaultName. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @return the next definition stage. */ - WithCreate withExistingBackupVault(String vaultName, String resourceGroupName); + WithCreate withExistingBackupVault(String resourceGroupName, String vaultName); } /** * The stage of the BackupInstanceResource definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithProperties { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. * @@ -92,6 +107,16 @@ interface WithCreate extends DefinitionStages.WithProperties { */ BackupInstanceResource create(Context context); } + /** The stage of the BackupInstanceResource definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Proxy Resource tags.. + * + * @param tags Proxy Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } /** The stage of the BackupInstanceResource definition allowing to specify properties. */ interface WithProperties { /** @@ -111,7 +136,7 @@ interface WithProperties { BackupInstanceResource.Update update(); /** The template for BackupInstanceResource update. */ - interface Update extends UpdateStages.WithProperties { + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { /** * Executes the update request. * @@ -129,6 +154,16 @@ interface Update extends UpdateStages.WithProperties { } /** The BackupInstanceResource update stages. */ interface UpdateStages { + /** The stage of the BackupInstanceResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Proxy Resource tags.. + * + * @param tags Proxy Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } /** The stage of the BackupInstanceResource update allowing to specify properties. */ interface WithProperties { /** @@ -222,6 +257,103 @@ interface WithProperties { */ OperationJobExtendedInfo triggerRestore(AzureBackupRestoreRequest parameters, Context context); + /** + * This operation will resume backups for backup instance. + * + * @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 resumeBackups(); + + /** + * This operation will resume backups for backup instance. + * + * @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 resumeBackups(Context context); + + /** + * This operation will resume protection for a stopped backup instance. + * + * @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 resumeProtection(); + + /** + * This operation will resume protection for a stopped backup instance. + * + * @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 resumeProtection(Context context); + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @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 stopProtection(); + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @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 stopProtection(Context context); + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @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 suspendBackups(); + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @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 suspendBackups(Context context); + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @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. + */ + void syncBackupInstance(SyncBackupInstanceRequest parameters); + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @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. + */ + void syncBackupInstance(SyncBackupInstanceRequest parameters, Context context); + /** * Validates if Restore can be triggered for a DataSource. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstanceResourceList.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstanceResourceList.java index 37255c532eb8..892156f5a7a5 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstanceResourceList.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstanceResourceList.java @@ -5,23 +5,27 @@ package com.azure.resourcemanager.dataprotection.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.fluent.models.BackupInstanceResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** BackupInstanceResourceList BackupInstance Resource list response. */ +/** + * BackupInstanceResourceList + * + *

BackupInstance Resource list response. + */ @Fluent public final class BackupInstanceResourceList extends DppResourceList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupInstanceResourceList.class); - /* * List of resources. */ @JsonProperty(value = "value") private List value; + /** Creates an instance of BackupInstanceResourceList class. */ + public BackupInstanceResourceList() { + } + /** * Get the value property: List of resources. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstances.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstances.java index eafd4ea6ad66..3b3c6843fe54 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstances.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstances.java @@ -13,86 +13,86 @@ public interface BackupInstances { /** * Gets a backup instances belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup instances belonging to a backup vault. + * @return a backup instances belonging to a backup vault as paginated response with {@link PagedIterable}. */ - PagedIterable list(String vaultName, String resourceGroupName); + PagedIterable list(String resourceGroupName, String vaultName); /** * Gets a backup instances belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup instances belonging to a backup vault. + * @return a backup instances belonging to a backup vault as paginated response with {@link PagedIterable}. */ - PagedIterable list(String vaultName, String resourceGroupName, Context context); + PagedIterable list(String resourceGroupName, String vaultName, Context context); /** * Gets a backup instance with name in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. + * @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 a backup instance with name in a backup vault. + * @return a backup instance with name in a backup vault along with {@link Response}. */ - BackupInstanceResource get(String vaultName, String resourceGroupName, String backupInstanceName); + Response getWithResponse( + String resourceGroupName, String vaultName, String backupInstanceName, Context context); /** * Gets a backup instance with name in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. - * @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 a backup instance with name in a backup vault. */ - Response getWithResponse( - String vaultName, String resourceGroupName, String backupInstanceName, Context context); + BackupInstanceResource get(String resourceGroupName, String vaultName, String backupInstanceName); /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 backupInstanceName); + void delete(String resourceGroupName, String vaultName, String backupInstanceName); /** * Delete a backup instance in a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 delete(String vaultName, String resourceGroupName, String backupInstanceName, Context context); + void delete(String resourceGroupName, String vaultName, String backupInstanceName, Context context); /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -101,13 +101,13 @@ Response getWithResponse( * @return operationJobExtendedInfo. */ OperationJobExtendedInfo adhocBackup( - String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters); + String resourceGroupName, String vaultName, String backupInstanceName, TriggerBackupRequest parameters); /** * Trigger adhoc backup. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @param context The context to associate with this operation. @@ -117,8 +117,8 @@ OperationJobExtendedInfo adhocBackup( * @return operationJobExtendedInfo. */ OperationJobExtendedInfo adhocBackup( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, TriggerBackupRequest parameters, Context context); @@ -126,8 +126,8 @@ OperationJobExtendedInfo adhocBackup( /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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. @@ -135,13 +135,13 @@ OperationJobExtendedInfo adhocBackup( * @return operationJobExtendedInfo. */ OperationJobExtendedInfo validateForBackup( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters); + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters); /** * Validate whether adhoc backup will be successful or not. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param parameters Request body for operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -150,7 +150,38 @@ OperationJobExtendedInfo validateForBackup( * @return operationJobExtendedInfo. */ OperationJobExtendedInfo validateForBackup( - String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context); + String resourceGroupName, String vaultName, ValidateForBackupRequest parameters, Context context); + + /** + * Get result of backup instance creation operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @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 result of backup instance creation operation along with {@link Response}. + */ + Response getBackupInstanceOperationResultWithResponse( + String resourceGroupName, String vaultName, String backupInstanceName, String operationId, Context context); + + /** + * Get result of backup instance creation operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName parameter. + * @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 result of backup instance creation operation. + */ + BackupInstanceResource getBackupInstanceOperationResult( + String resourceGroupName, String vaultName, String backupInstanceName, String operationId); /** * rehydrate recovery point for restore for a BackupInstance. @@ -191,8 +222,8 @@ void triggerRehydrate( /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -201,13 +232,13 @@ void triggerRehydrate( * @return operationJobExtendedInfo. */ OperationJobExtendedInfo triggerRestore( - String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters); + String resourceGroupName, String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters); /** * Triggers restore for a BackupInstance. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @param context The context to associate with this operation. @@ -217,17 +248,154 @@ OperationJobExtendedInfo triggerRestore( * @return operationJobExtendedInfo. */ OperationJobExtendedInfo triggerRestore( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, AzureBackupRestoreRequest parameters, Context context); /** - * Validates if Restore can be triggered for a DataSource. + * This operation will resume backups for backup instance. * + * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 resumeBackups(String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * This operation will resume backups for backup instance. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + void resumeBackups(String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 resumeProtection(String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * This operation will resume protection for a stopped backup instance. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + void resumeProtection(String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 stopProtection(String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * This operation will stop protection of a backup instance and data will be held forever. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + void stopProtection(String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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 suspendBackups(String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * This operation will stop backup for a backup instance and retains the backup data as per the policy (except + * latest Recovery point, which will be retained forever). + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + void suspendBackups(String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + void syncBackupInstance( + String resourceGroupName, String vaultName, String backupInstanceName, SyncBackupInstanceRequest parameters); + + /** + * Sync backup instance again in case of failure This action will retry last failed operation and will bring backup + * instance to valid state. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The backupInstanceName 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. + */ + void syncBackupInstance( + String resourceGroupName, + String vaultName, + String backupInstanceName, + SyncBackupInstanceRequest parameters, + Context context); + + /** + * Validates if Restore can be triggered for a DataSource. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -236,13 +404,13 @@ OperationJobExtendedInfo triggerRestore( * @return operationJobExtendedInfo. */ OperationJobExtendedInfo validateForRestore( - String vaultName, String resourceGroupName, String backupInstanceName, ValidateRestoreRequestObject parameters); + String resourceGroupName, String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters); /** * Validates if Restore can be triggered for a DataSource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param parameters Request body for operation. * @param context The context to associate with this operation. @@ -252,8 +420,8 @@ OperationJobExtendedInfo validateForRestore( * @return operationJobExtendedInfo. */ OperationJobExtendedInfo validateForRestore( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, ValidateRestoreRequestObject parameters, Context context); @@ -265,7 +433,7 @@ OperationJobExtendedInfo validateForRestore( * @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 a backup instance with name in a backup vault. + * @return a backup instance with name in a backup vault along with {@link Response}. */ BackupInstanceResource getById(String id); @@ -277,7 +445,7 @@ OperationJobExtendedInfo validateForRestore( * @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 a backup instance with name in a backup vault. + * @return a backup instance with name in a backup vault along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesAdhocBackupHeaders.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesAdhocBackupHeaders.java deleted file mode 100644 index 55959dd528e3..000000000000 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesAdhocBackupHeaders.java +++ /dev/null @@ -1,102 +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.dataprotection.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 BackupInstancesAdhocBackupHeaders model. */ -@Fluent -public final class BackupInstancesAdhocBackupHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupInstancesAdhocBackupHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private Integer retryAfter; - - /* - * The Azure-AsyncOperation property. - */ - @JsonProperty(value = "Azure-AsyncOperation") - private String azureAsyncOperation; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public Integer retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the BackupInstancesAdhocBackupHeaders object itself. - */ - public BackupInstancesAdhocBackupHeaders withRetryAfter(Integer retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @return the azureAsyncOperation value. - */ - public String azureAsyncOperation() { - return this.azureAsyncOperation; - } - - /** - * Set the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @param azureAsyncOperation the azureAsyncOperation value to set. - * @return the BackupInstancesAdhocBackupHeaders object itself. - */ - public BackupInstancesAdhocBackupHeaders withAzureAsyncOperation(String azureAsyncOperation) { - this.azureAsyncOperation = azureAsyncOperation; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the BackupInstancesAdhocBackupHeaders object itself. - */ - public BackupInstancesAdhocBackupHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesAdhocBackupResponse.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesAdhocBackupResponse.java deleted file mode 100644 index e00769994a0b..000000000000 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesAdhocBackupResponse.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.dataprotection.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.dataprotection.fluent.models.OperationJobExtendedInfoInner; - -/** Contains all response data for the adhocBackup operation. */ -public final class BackupInstancesAdhocBackupResponse - extends ResponseBase { - /** - * Creates an instance of BackupInstancesAdhocBackupResponse. - * - * @param request the request which resulted in this BackupInstancesAdhocBackupResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public BackupInstancesAdhocBackupResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - OperationJobExtendedInfoInner value, - BackupInstancesAdhocBackupHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public OperationJobExtendedInfoInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesDeleteHeaders.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesDeleteHeaders.java deleted file mode 100644 index 79dd0fce3d25..000000000000 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesDeleteHeaders.java +++ /dev/null @@ -1,102 +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.dataprotection.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 BackupInstancesDeleteHeaders model. */ -@Fluent -public final class BackupInstancesDeleteHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupInstancesDeleteHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private Integer retryAfter; - - /* - * The Azure-AsyncOperation property. - */ - @JsonProperty(value = "Azure-AsyncOperation") - private String azureAsyncOperation; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public Integer retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the BackupInstancesDeleteHeaders object itself. - */ - public BackupInstancesDeleteHeaders withRetryAfter(Integer retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @return the azureAsyncOperation value. - */ - public String azureAsyncOperation() { - return this.azureAsyncOperation; - } - - /** - * Set the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @param azureAsyncOperation the azureAsyncOperation value to set. - * @return the BackupInstancesDeleteHeaders object itself. - */ - public BackupInstancesDeleteHeaders withAzureAsyncOperation(String azureAsyncOperation) { - this.azureAsyncOperation = azureAsyncOperation; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the BackupInstancesDeleteHeaders object itself. - */ - public BackupInstancesDeleteHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesDeleteResponse.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesDeleteResponse.java deleted file mode 100644 index 6b1472197160..000000000000 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesDeleteResponse.java +++ /dev/null @@ -1,26 +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.dataprotection.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; - -/** Contains all response data for the delete operation. */ -public final class BackupInstancesDeleteResponse extends ResponseBase { - /** - * Creates an instance of BackupInstancesDeleteResponse. - * - * @param request the request which resulted in this BackupInstancesDeleteResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public BackupInstancesDeleteResponse( - HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, BackupInstancesDeleteHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } -} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesExtensionRoutings.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesExtensionRoutings.java new file mode 100644 index 000000000000..289b5e5b8f8e --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesExtensionRoutings.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.dataprotection.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of BackupInstancesExtensionRoutings. */ +public interface BackupInstancesExtensionRoutings { + /** + * Gets a list backup instances associated with a tracked resource. + * + * @param resourceId ARM path of the resource to be protected using Microsoft.DataProtection. + * @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 a list backup instances associated with a tracked resource as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceId); + + /** + * Gets a list backup instances associated with a tracked resource. + * + * @param resourceId ARM path of the resource to be protected using Microsoft.DataProtection. + * @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 a list backup instances associated with a tracked resource as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceId, Context context); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRehydrateHeaders.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRehydrateHeaders.java deleted file mode 100644 index c77f61d552e5..000000000000 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRehydrateHeaders.java +++ /dev/null @@ -1,102 +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.dataprotection.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 BackupInstancesTriggerRehydrateHeaders model. */ -@Fluent -public final class BackupInstancesTriggerRehydrateHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupInstancesTriggerRehydrateHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private Integer retryAfter; - - /* - * The Azure-AsyncOperation property. - */ - @JsonProperty(value = "Azure-AsyncOperation") - private String azureAsyncOperation; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public Integer retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the BackupInstancesTriggerRehydrateHeaders object itself. - */ - public BackupInstancesTriggerRehydrateHeaders withRetryAfter(Integer retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @return the azureAsyncOperation value. - */ - public String azureAsyncOperation() { - return this.azureAsyncOperation; - } - - /** - * Set the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @param azureAsyncOperation the azureAsyncOperation value to set. - * @return the BackupInstancesTriggerRehydrateHeaders object itself. - */ - public BackupInstancesTriggerRehydrateHeaders withAzureAsyncOperation(String azureAsyncOperation) { - this.azureAsyncOperation = azureAsyncOperation; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the BackupInstancesTriggerRehydrateHeaders object itself. - */ - public BackupInstancesTriggerRehydrateHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRehydrateResponse.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRehydrateResponse.java deleted file mode 100644 index 27be63eea233..000000000000 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRehydrateResponse.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.dataprotection.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; - -/** Contains all response data for the triggerRehydrate operation. */ -public final class BackupInstancesTriggerRehydrateResponse - extends ResponseBase { - /** - * Creates an instance of BackupInstancesTriggerRehydrateResponse. - * - * @param request the request which resulted in this BackupInstancesTriggerRehydrateResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public BackupInstancesTriggerRehydrateResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - Void value, - BackupInstancesTriggerRehydrateHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } -} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRestoreHeaders.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRestoreHeaders.java deleted file mode 100644 index 385c730a2b3e..000000000000 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRestoreHeaders.java +++ /dev/null @@ -1,102 +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.dataprotection.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 BackupInstancesTriggerRestoreHeaders model. */ -@Fluent -public final class BackupInstancesTriggerRestoreHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupInstancesTriggerRestoreHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private Integer retryAfter; - - /* - * The Azure-AsyncOperation property. - */ - @JsonProperty(value = "Azure-AsyncOperation") - private String azureAsyncOperation; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public Integer retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the BackupInstancesTriggerRestoreHeaders object itself. - */ - public BackupInstancesTriggerRestoreHeaders withRetryAfter(Integer retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @return the azureAsyncOperation value. - */ - public String azureAsyncOperation() { - return this.azureAsyncOperation; - } - - /** - * Set the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @param azureAsyncOperation the azureAsyncOperation value to set. - * @return the BackupInstancesTriggerRestoreHeaders object itself. - */ - public BackupInstancesTriggerRestoreHeaders withAzureAsyncOperation(String azureAsyncOperation) { - this.azureAsyncOperation = azureAsyncOperation; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the BackupInstancesTriggerRestoreHeaders object itself. - */ - public BackupInstancesTriggerRestoreHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRestoreResponse.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRestoreResponse.java deleted file mode 100644 index 8c404a68f12e..000000000000 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesTriggerRestoreResponse.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.dataprotection.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.dataprotection.fluent.models.OperationJobExtendedInfoInner; - -/** Contains all response data for the triggerRestore operation. */ -public final class BackupInstancesTriggerRestoreResponse - extends ResponseBase { - /** - * Creates an instance of BackupInstancesTriggerRestoreResponse. - * - * @param request the request which resulted in this BackupInstancesTriggerRestoreResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public BackupInstancesTriggerRestoreResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - OperationJobExtendedInfoInner value, - BackupInstancesTriggerRestoreHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public OperationJobExtendedInfoInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForBackupHeaders.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForBackupHeaders.java deleted file mode 100644 index 8a1cca7cbba1..000000000000 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForBackupHeaders.java +++ /dev/null @@ -1,102 +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.dataprotection.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 BackupInstancesValidateForBackupHeaders model. */ -@Fluent -public final class BackupInstancesValidateForBackupHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupInstancesValidateForBackupHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private Integer retryAfter; - - /* - * The Azure-AsyncOperation property. - */ - @JsonProperty(value = "Azure-AsyncOperation") - private String azureAsyncOperation; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public Integer retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the BackupInstancesValidateForBackupHeaders object itself. - */ - public BackupInstancesValidateForBackupHeaders withRetryAfter(Integer retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @return the azureAsyncOperation value. - */ - public String azureAsyncOperation() { - return this.azureAsyncOperation; - } - - /** - * Set the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @param azureAsyncOperation the azureAsyncOperation value to set. - * @return the BackupInstancesValidateForBackupHeaders object itself. - */ - public BackupInstancesValidateForBackupHeaders withAzureAsyncOperation(String azureAsyncOperation) { - this.azureAsyncOperation = azureAsyncOperation; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the BackupInstancesValidateForBackupHeaders object itself. - */ - public BackupInstancesValidateForBackupHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForBackupResponse.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForBackupResponse.java deleted file mode 100644 index 263301e815f2..000000000000 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForBackupResponse.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.dataprotection.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.dataprotection.fluent.models.OperationJobExtendedInfoInner; - -/** Contains all response data for the validateForBackup operation. */ -public final class BackupInstancesValidateForBackupResponse - extends ResponseBase { - /** - * Creates an instance of BackupInstancesValidateForBackupResponse. - * - * @param request the request which resulted in this BackupInstancesValidateForBackupResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public BackupInstancesValidateForBackupResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - OperationJobExtendedInfoInner value, - BackupInstancesValidateForBackupHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public OperationJobExtendedInfoInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForRestoreHeaders.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForRestoreHeaders.java deleted file mode 100644 index 9ac72c233aa3..000000000000 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForRestoreHeaders.java +++ /dev/null @@ -1,102 +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.dataprotection.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 BackupInstancesValidateForRestoreHeaders model. */ -@Fluent -public final class BackupInstancesValidateForRestoreHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupInstancesValidateForRestoreHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private Integer retryAfter; - - /* - * The Azure-AsyncOperation property. - */ - @JsonProperty(value = "Azure-AsyncOperation") - private String azureAsyncOperation; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public Integer retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the BackupInstancesValidateForRestoreHeaders object itself. - */ - public BackupInstancesValidateForRestoreHeaders withRetryAfter(Integer retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @return the azureAsyncOperation value. - */ - public String azureAsyncOperation() { - return this.azureAsyncOperation; - } - - /** - * Set the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @param azureAsyncOperation the azureAsyncOperation value to set. - * @return the BackupInstancesValidateForRestoreHeaders object itself. - */ - public BackupInstancesValidateForRestoreHeaders withAzureAsyncOperation(String azureAsyncOperation) { - this.azureAsyncOperation = azureAsyncOperation; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the BackupInstancesValidateForRestoreHeaders object itself. - */ - public BackupInstancesValidateForRestoreHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForRestoreResponse.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForRestoreResponse.java deleted file mode 100644 index 42ce27c64305..000000000000 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupInstancesValidateForRestoreResponse.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.dataprotection.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.dataprotection.fluent.models.OperationJobExtendedInfoInner; - -/** Contains all response data for the validateForRestore operation. */ -public final class BackupInstancesValidateForRestoreResponse - extends ResponseBase { - /** - * Creates an instance of BackupInstancesValidateForRestoreResponse. - * - * @param request the request which resulted in this BackupInstancesValidateForRestoreResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public BackupInstancesValidateForRestoreResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - OperationJobExtendedInfoInner value, - BackupInstancesValidateForRestoreHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public OperationJobExtendedInfoInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupParameters.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupParameters.java index 831221414be2..42d2cf4f0dfa 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupParameters.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupParameters.java @@ -5,13 +5,15 @@ package com.azure.resourcemanager.dataprotection.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; -/** BackupParameters BackupParameters base. */ +/** + * BackupParameters + * + *

BackupParameters base. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -21,7 +23,9 @@ @JsonSubTypes({@JsonSubTypes.Type(name = "AzureBackupParams", value = AzureBackupParams.class)}) @Immutable public class BackupParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupParameters.class); + /** Creates an instance of BackupParameters class. */ + public BackupParameters() { + } /** * Validates the instance. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupPolicies.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupPolicies.java index 49d48e980d44..f65937453060 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupPolicies.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupPolicies.java @@ -13,82 +13,82 @@ public interface BackupPolicies { /** * Returns list of backup policies belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return baseBackupPolicyResourceList. + * @return baseBackupPolicyResourceList as paginated response with {@link PagedIterable}. */ - PagedIterable list(String vaultName, String resourceGroupName); + PagedIterable list(String resourceGroupName, String vaultName); /** * Returns list of backup policies belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return baseBackupPolicyResourceList. + * @return baseBackupPolicyResourceList as paginated response with {@link PagedIterable}. */ - PagedIterable list(String vaultName, String resourceGroupName, Context context); + PagedIterable list(String resourceGroupName, String vaultName, Context context); /** * Gets a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName 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 a backup policy belonging to a backup vault. + * @return a backup policy belonging to a backup vault along with {@link Response}. */ - BaseBackupPolicyResource get(String vaultName, String resourceGroupName, String backupPolicyName); + Response getWithResponse( + String resourceGroupName, String vaultName, String backupPolicyName, Context context); /** * Gets a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName 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 a backup policy belonging to a backup vault. */ - Response getWithResponse( - String vaultName, String resourceGroupName, String backupPolicyName, Context context); + BaseBackupPolicyResource get(String resourceGroupName, String vaultName, String backupPolicyName); /** * Deletes a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String vaultName, String resourceGroupName, String backupPolicyName); + Response deleteWithResponse( + String resourceGroupName, String vaultName, String backupPolicyName, Context context); /** * Deletes a backup policy belonging to a backup vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupPolicyName The backupPolicyName 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 backupPolicyName, Context context); + void delete(String resourceGroupName, String vaultName, String backupPolicyName); /** * Gets a backup policy belonging to a backup vault. @@ -97,7 +97,7 @@ Response deleteWithResponse( * @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 a backup policy belonging to a backup vault. + * @return a backup policy belonging to a backup vault along with {@link Response}. */ BaseBackupPolicyResource getById(String id); @@ -109,7 +109,7 @@ Response deleteWithResponse( * @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 a backup policy belonging to a backup vault. + * @return a backup policy belonging to a backup vault along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -131,7 +131,7 @@ Response deleteWithResponse( * @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 the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupPolicy.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupPolicy.java index 8296c77c33ca..80b2ce16996c 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupPolicy.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupPolicy.java @@ -6,26 +6,30 @@ 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; -/** BackupPolicy Rule based backup policy. */ +/** + * BackupPolicy + * + *

Rule based backup policy. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("BackupPolicy") @Fluent public final class BackupPolicy extends BaseBackupPolicy { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupPolicy.class); - /* - * Policy rule dictionary that contains rules for each backuptype i.e - * Full/Incremental/Logs etc + * Policy rule dictionary that contains rules for each backuptype i.e Full/Incremental/Logs etc */ @JsonProperty(value = "policyRules", required = true) private List policyRules; + /** Creates an instance of BackupPolicy class. */ + public BackupPolicy() { + } + /** * Get the policyRules property: Policy rule dictionary that contains rules for each backuptype i.e * Full/Incremental/Logs etc. @@ -64,11 +68,13 @@ public BackupPolicy withDatasourceTypes(List datasourceTypes) { public void validate() { super.validate(); if (policyRules() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property policyRules in model BackupPolicy")); } else { policyRules().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(BackupPolicy.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupSchedule.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupSchedule.java index fc33605eb670..fc31fe4df23b 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupSchedule.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupSchedule.java @@ -6,15 +6,16 @@ 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; -/** BackupSchedule Schedule for backup. */ +/** + * BackupSchedule + * + *

Schedule for backup. + */ @Fluent public final class BackupSchedule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupSchedule.class); - /* * ISO 8601 repeating time interval format */ @@ -27,6 +28,10 @@ public final class BackupSchedule { @JsonProperty(value = "timeZone") private String timeZone; + /** Creates an instance of BackupSchedule class. */ + public BackupSchedule() { + } + /** * Get the repeatingTimeIntervals property: ISO 8601 repeating time interval format. * @@ -74,10 +79,12 @@ public BackupSchedule withTimeZone(String timeZone) { */ public void validate() { if (repeatingTimeIntervals() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property repeatingTimeIntervals in model BackupSchedule")); } } + + private static final ClientLogger LOGGER = new ClientLogger(BackupSchedule.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVault.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVault.java index 202120ed0d15..ddbdd251008d 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVault.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVault.java @@ -6,14 +6,21 @@ 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; -/** BackupVault Backup Vault. */ +/** + * BackupVault + * + *

Backup Vault. + */ @Fluent public final class BackupVault { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupVault.class); + /* + * Monitoring Settings + */ + @JsonProperty(value = "monitoringSettings") + private MonitoringSettings monitoringSettings; /* * Provisioning state of the BackupVault resource @@ -33,12 +40,48 @@ public final class BackupVault { @JsonProperty(value = "resourceMoveDetails", access = JsonProperty.Access.WRITE_ONLY) private ResourceMoveDetails resourceMoveDetails; + /* + * Security Settings + */ + @JsonProperty(value = "securitySettings") + private SecuritySettings securitySettings; + /* * Storage Settings */ @JsonProperty(value = "storageSettings", required = true) private List storageSettings; + /* + * Is vault protected by resource guard + */ + @JsonProperty(value = "isVaultProtectedByResourceGuard", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isVaultProtectedByResourceGuard; + + /** Creates an instance of BackupVault class. */ + public BackupVault() { + } + + /** + * Get the monitoringSettings property: Monitoring Settings. + * + * @return the monitoringSettings value. + */ + public MonitoringSettings monitoringSettings() { + return this.monitoringSettings; + } + + /** + * Set the monitoringSettings property: Monitoring Settings. + * + * @param monitoringSettings the monitoringSettings value to set. + * @return the BackupVault object itself. + */ + public BackupVault withMonitoringSettings(MonitoringSettings monitoringSettings) { + this.monitoringSettings = monitoringSettings; + return this; + } + /** * Get the provisioningState property: Provisioning state of the BackupVault resource. * @@ -66,6 +109,26 @@ public ResourceMoveDetails resourceMoveDetails() { return this.resourceMoveDetails; } + /** + * Get the securitySettings property: Security Settings. + * + * @return the securitySettings value. + */ + public SecuritySettings securitySettings() { + return this.securitySettings; + } + + /** + * Set the securitySettings property: Security Settings. + * + * @param securitySettings the securitySettings value to set. + * @return the BackupVault object itself. + */ + public BackupVault withSecuritySettings(SecuritySettings securitySettings) { + this.securitySettings = securitySettings; + return this; + } + /** * Get the storageSettings property: Storage Settings. * @@ -86,21 +149,38 @@ public BackupVault withStorageSettings(List storageSettings) { return this; } + /** + * Get the isVaultProtectedByResourceGuard property: Is vault protected by resource guard. + * + * @return the isVaultProtectedByResourceGuard value. + */ + public Boolean isVaultProtectedByResourceGuard() { + return this.isVaultProtectedByResourceGuard; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (monitoringSettings() != null) { + monitoringSettings().validate(); + } if (resourceMoveDetails() != null) { resourceMoveDetails().validate(); } + if (securitySettings() != null) { + securitySettings().validate(); + } if (storageSettings() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property storageSettings in model BackupVault")); } else { storageSettings().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(BackupVault.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultOperationResults.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultOperationResults.java index 52e071c866ab..5189d3aa0a8f 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultOperationResults.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultOperationResults.java @@ -10,26 +10,30 @@ /** Resource collection API of BackupVaultOperationResults. */ public interface BackupVaultOperationResults { /** - * @param vaultName The name of the backup vault. + * The get operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. */ - BackupVaultResource get(String vaultName, String resourceGroupName, String operationId); + Response getWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context); /** - * @param vaultName The name of the backup vault. + * The get operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @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 backupVault Resource. */ - Response getWithResponse( - String vaultName, String resourceGroupName, String operationId, Context context); + BackupVaultResource get(String resourceGroupName, String vaultName, String operationId); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultOperationResultsGetHeaders.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultOperationResultsGetHeaders.java index 1f333641ba51..e8ecd318caf8 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultOperationResultsGetHeaders.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultOperationResultsGetHeaders.java @@ -5,15 +5,13 @@ package com.azure.resourcemanager.dataprotection.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; import com.fasterxml.jackson.annotation.JsonProperty; /** The BackupVaultOperationResultsGetHeaders model. */ @Fluent public final class BackupVaultOperationResultsGetHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupVaultOperationResultsGetHeaders.class); - /* * The Retry-After property. */ @@ -32,6 +30,23 @@ public final class BackupVaultOperationResultsGetHeaders { @JsonProperty(value = "Location") private String location; + private static final HttpHeaderName AZURE_ASYNC_OPERATION = HttpHeaderName.fromString("Azure-AsyncOperation"); + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of BackupVaultOperationResultsGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public BackupVaultOperationResultsGetHeaders(HttpHeaders rawHeaders) { + String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER); + if (retryAfter != null) { + this.retryAfter = Integer.parseInt(retryAfter); + } + this.azureAsyncOperation = rawHeaders.getValue(AZURE_ASYNC_OPERATION); + this.location = rawHeaders.getValue(HttpHeaderName.LOCATION); + } + /** * Get the retryAfter property: The Retry-After property. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultOperationResultsGetResponse.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultOperationResultsGetResponse.java index 6224d370f108..ae8a16ece46d 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultOperationResultsGetResponse.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultOperationResultsGetResponse.java @@ -30,7 +30,11 @@ public BackupVaultOperationResultsGetResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public BackupVaultResourceInner getValue() { return super.getValue(); diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultResource.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultResource.java index 77d6a2001c06..4137c1d587df 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultResource.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultResource.java @@ -55,7 +55,9 @@ public interface BackupVaultResource { String etag(); /** - * Gets the identity property: DppIdentityDetails Input Managed Identity Details. + * Gets the identity property: DppIdentityDetails + * + *

Input Managed Identity Details. * * @return the identity value. */ @@ -69,7 +71,9 @@ public interface BackupVaultResource { SystemData systemData(); /** - * Gets the properties property: BackupVault BackupVaultResource properties. + * Gets the properties property: BackupVault + * + *

BackupVaultResource properties. * * @return the properties value. */ @@ -89,6 +93,13 @@ public interface BackupVaultResource { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.dataprotection.fluent.models.BackupVaultResourceInner object. * @@ -140,9 +151,12 @@ interface WithResourceGroup { /** The stage of the BackupVaultResource definition allowing to specify properties. */ interface WithProperties { /** - * Specifies the properties property: BackupVault BackupVaultResource properties. + * Specifies the properties property: BackupVault * - * @param properties BackupVault BackupVaultResource properties. + *

BackupVaultResource properties. + * + * @param properties BackupVault + *

BackupVaultResource properties. * @return the next definition stage. */ WithCreate withProperties(BackupVault properties); @@ -191,9 +205,12 @@ interface WithEtag { /** The stage of the BackupVaultResource definition allowing to specify identity. */ interface WithIdentity { /** - * Specifies the identity property: DppIdentityDetails Input Managed Identity Details. + * Specifies the identity property: DppIdentityDetails + * + *

Input Managed Identity Details. * - * @param identity DppIdentityDetails Input Managed Identity Details. + * @param identity DppIdentityDetails + *

Input Managed Identity Details. * @return the next definition stage. */ WithCreate withIdentity(DppIdentityDetails identity); @@ -207,7 +224,7 @@ interface WithIdentity { BackupVaultResource.Update update(); /** The template for BackupVaultResource update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { /** * Executes the update request. * @@ -238,13 +255,26 @@ interface WithTags { /** The stage of the BackupVaultResource update allowing to specify identity. */ interface WithIdentity { /** - * Specifies the identity property: DppIdentityDetails Input Managed Identity Details. + * Specifies the identity property: DppIdentityDetails * - * @param identity DppIdentityDetails Input Managed Identity Details. + *

Input Managed Identity Details. + * + * @param identity DppIdentityDetails + *

Input Managed Identity Details. * @return the next definition stage. */ Update withIdentity(DppIdentityDetails identity); } + /** The stage of the BackupVaultResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Resource properties.. + * + * @param properties Resource properties. + * @return the next definition stage. + */ + Update withProperties(PatchBackupVaultInput properties); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultResourceList.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultResourceList.java index 12029c3d07d2..ebc8bac8fbb4 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultResourceList.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaultResourceList.java @@ -5,23 +5,27 @@ package com.azure.resourcemanager.dataprotection.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.fluent.models.BackupVaultResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** BackupVaultResourceList List of BackupVault resources. */ +/** + * BackupVaultResourceList + * + *

List of BackupVault resources. + */ @Fluent public final class BackupVaultResourceList extends DppResourceList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupVaultResourceList.class); - /* * List of resources. */ @JsonProperty(value = "value") private List value; + /** Creates an instance of BackupVaultResourceList class. */ + public BackupVaultResourceList() { + } + /** * Get the value property: List of resources. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaults.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaults.java index dbfbf2e9a270..5f723e15bf43 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaults.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVaults.java @@ -15,7 +15,7 @@ public interface BackupVaults { * * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -26,7 +26,7 @@ public interface BackupVaults { * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -37,7 +37,7 @@ public interface BackupVaults { * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -49,7 +49,7 @@ public interface BackupVaults { * @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 backupVaultResourceList. + * @return backupVaultResourceList as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -58,50 +58,50 @@ public interface BackupVaults { * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backupVault Resource. + * @return backupVault Resource along with {@link Response}. */ - BackupVaultResource getByResourceGroup(String resourceGroupName, String vaultName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String vaultName, Context context); /** * Returns a resource belonging to a resource group. * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return backupVault Resource. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String vaultName, Context context); + BackupVaultResource getByResourceGroup(String resourceGroupName, String vaultName); /** * Deletes a BackupVault resource from the resource group. * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void deleteByResourceGroup(String resourceGroupName, String vaultName); + Response deleteByResourceGroupWithResponse(String resourceGroupName, String vaultName, Context context); /** * Deletes a BackupVault resource from the resource group. * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - Response deleteWithResponse(String resourceGroupName, String vaultName, Context context); + void deleteByResourceGroup(String resourceGroupName, String vaultName); /** * API to check for resource name availability. @@ -109,13 +109,14 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param location The location in which uniqueness will be verified. * @param parameters Check name availability 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 checkNameAvailabilityResult. + * @return checkNameAvailabilityResult along with {@link Response}. */ - CheckNameAvailabilityResult checkNameAvailability( - String resourceGroupName, String location, CheckNameAvailabilityRequest parameters); + Response checkNameAvailabilityWithResponse( + String resourceGroupName, String location, CheckNameAvailabilityRequest parameters, Context context); /** * API to check for resource name availability. @@ -123,14 +124,13 @@ CheckNameAvailabilityResult checkNameAvailability( * @param resourceGroupName The name of the resource group where the backup vault is present. * @param location The location in which uniqueness will be verified. * @param parameters Check name availability 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 checkNameAvailabilityResult. */ - Response checkNameAvailabilityWithResponse( - String resourceGroupName, String location, CheckNameAvailabilityRequest parameters, Context context); + CheckNameAvailabilityResult checkNameAvailability( + String resourceGroupName, String location, CheckNameAvailabilityRequest parameters); /** * Returns a resource belonging to a resource group. @@ -139,7 +139,7 @@ Response checkNameAvailabilityWithResponse( * @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 backupVault Resource. + * @return backupVault Resource along with {@link Response}. */ BackupVaultResource getById(String id); @@ -151,7 +151,7 @@ Response checkNameAvailabilityWithResponse( * @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 backupVault Resource. + * @return backupVault Resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -173,7 +173,7 @@ Response checkNameAvailabilityWithResponse( * @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 the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BaseBackupPolicy.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BaseBackupPolicy.java index 347ba3cd5bb7..802baeeb37f3 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BaseBackupPolicy.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BaseBackupPolicy.java @@ -6,14 +6,17 @@ 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; -/** BaseBackupPolicy BackupPolicy base. */ +/** + * BaseBackupPolicy + * + *

BackupPolicy base. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -23,14 +26,16 @@ @JsonSubTypes({@JsonSubTypes.Type(name = "BackupPolicy", value = BackupPolicy.class)}) @Fluent public class BaseBackupPolicy { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BaseBackupPolicy.class); - /* * Type of datasource for the backup management */ @JsonProperty(value = "datasourceTypes", required = true) private List datasourceTypes; + /** Creates an instance of BaseBackupPolicy class. */ + public BaseBackupPolicy() { + } + /** * Get the datasourceTypes property: Type of datasource for the backup management. * @@ -58,10 +63,12 @@ public BaseBackupPolicy withDatasourceTypes(List datasourceTypes) { */ public void validate() { if (datasourceTypes() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property datasourceTypes in model BaseBackupPolicy")); } } + + private static final ClientLogger LOGGER = new ClientLogger(BaseBackupPolicy.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BaseBackupPolicyResource.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BaseBackupPolicyResource.java index 5ed503e146ac..94042201b50b 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BaseBackupPolicyResource.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BaseBackupPolicyResource.java @@ -39,12 +39,21 @@ public interface BaseBackupPolicyResource { SystemData systemData(); /** - * Gets the properties property: BaseBackupPolicy BaseBackupPolicyResource properties. + * Gets the properties property: BaseBackupPolicy + * + *

BaseBackupPolicyResource properties. * * @return the properties value. */ BaseBackupPolicy properties(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.dataprotection.fluent.models.BaseBackupPolicyResourceInner object. * @@ -64,13 +73,13 @@ interface Blank extends WithParentResource { /** The stage of the BaseBackupPolicyResource definition allowing to specify parent resource. */ interface WithParentResource { /** - * Specifies vaultName, resourceGroupName. + * Specifies resourceGroupName, vaultName. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @return the next definition stage. */ - WithCreate withExistingBackupVault(String vaultName, String resourceGroupName); + WithCreate withExistingBackupVault(String resourceGroupName, String vaultName); } /** * The stage of the BaseBackupPolicyResource definition which contains all the minimum required properties for @@ -95,9 +104,12 @@ interface WithCreate extends DefinitionStages.WithProperties { /** The stage of the BaseBackupPolicyResource definition allowing to specify properties. */ interface WithProperties { /** - * Specifies the properties property: BaseBackupPolicy BaseBackupPolicyResource properties. + * Specifies the properties property: BaseBackupPolicy * - * @param properties BaseBackupPolicy BaseBackupPolicyResource properties. + *

BaseBackupPolicyResource properties. + * + * @param properties BaseBackupPolicy + *

BaseBackupPolicyResource properties. * @return the next definition stage. */ WithCreate withProperties(BaseBackupPolicy properties); @@ -132,9 +144,12 @@ interface UpdateStages { /** The stage of the BaseBackupPolicyResource update allowing to specify properties. */ interface WithProperties { /** - * Specifies the properties property: BaseBackupPolicy BaseBackupPolicyResource properties. + * Specifies the properties property: BaseBackupPolicy + * + *

BaseBackupPolicyResource properties. * - * @param properties BaseBackupPolicy BaseBackupPolicyResource properties. + * @param properties BaseBackupPolicy + *

BaseBackupPolicyResource properties. * @return the next definition stage. */ Update withProperties(BaseBackupPolicy properties); diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BaseBackupPolicyResourceList.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BaseBackupPolicyResourceList.java index ef7a0adbad91..da96c508c26e 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BaseBackupPolicyResourceList.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BaseBackupPolicyResourceList.java @@ -5,23 +5,27 @@ package com.azure.resourcemanager.dataprotection.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.fluent.models.BaseBackupPolicyResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** BaseBackupPolicyResourceList List of BaseBackupPolicy resources. */ +/** + * BaseBackupPolicyResourceList + * + *

List of BaseBackupPolicy resources. + */ @Fluent public final class BaseBackupPolicyResourceList extends DppResourceList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BaseBackupPolicyResourceList.class); - /* * List of resources. */ @JsonProperty(value = "value") private List value; + /** Creates an instance of BaseBackupPolicyResourceList class. */ + public BaseBackupPolicyResourceList() { + } + /** * Get the value property: List of resources. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BasePolicyRule.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BasePolicyRule.java index 0954ec9e7841..5bba54b39789 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BasePolicyRule.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BasePolicyRule.java @@ -6,13 +6,16 @@ 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; -/** BasePolicyRule BasePolicy Rule. */ +/** + * BasePolicyRule + * + *

BasePolicy Rule. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -25,14 +28,16 @@ }) @Fluent public class BasePolicyRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BasePolicyRule.class); - /* * The name property. */ @JsonProperty(value = "name", required = true) private String name; + /** Creates an instance of BasePolicyRule class. */ + public BasePolicyRule() { + } + /** * Get the name property: The name property. * @@ -60,9 +65,11 @@ public BasePolicyRule withName(String name) { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property name in model BasePolicyRule")); } } + + private static final ClientLogger LOGGER = new ClientLogger(BasePolicyRule.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BlobBackupDatasourceParameters.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BlobBackupDatasourceParameters.java new file mode 100644 index 000000000000..8f06f913eb5e --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BlobBackupDatasourceParameters.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Parameters to be used during configuration of backup of blobs. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("BlobBackupDatasourceParameters") +@Fluent +public final class BlobBackupDatasourceParameters extends BackupDatasourceParameters { + /* + * List of containers to be backed up during configuration of backup of blobs + */ + @JsonProperty(value = "containersList", required = true) + private List containersList; + + /** Creates an instance of BlobBackupDatasourceParameters class. */ + public BlobBackupDatasourceParameters() { + } + + /** + * Get the containersList property: List of containers to be backed up during configuration of backup of blobs. + * + * @return the containersList value. + */ + public List containersList() { + return this.containersList; + } + + /** + * Set the containersList property: List of containers to be backed up during configuration of backup of blobs. + * + * @param containersList the containersList value to set. + * @return the BlobBackupDatasourceParameters object itself. + */ + public BlobBackupDatasourceParameters withContainersList(List containersList) { + this.containersList = containersList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (containersList() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property containersList in model BlobBackupDatasourceParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobBackupDatasourceParameters.class); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CheckNameAvailabilityRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CheckNameAvailabilityRequest.java index 5d7e33500eb9..d49b0eb2c524 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CheckNameAvailabilityRequest.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CheckNameAvailabilityRequest.java @@ -5,15 +5,15 @@ package com.azure.resourcemanager.dataprotection.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; -/** CheckNameAvailabilityRequest CheckNameAvailability Request. */ +/** + * CheckNameAvailabilityRequest + * + *

CheckNameAvailability Request. + */ @Fluent public final class CheckNameAvailabilityRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityRequest.class); - /* * Resource name for which availability needs to be checked */ @@ -26,6 +26,10 @@ public final class CheckNameAvailabilityRequest { @JsonProperty(value = "type") private String type; + /** Creates an instance of CheckNameAvailabilityRequest class. */ + public CheckNameAvailabilityRequest() { + } + /** * Get the name property: Resource name for which availability needs to be checked. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryDisplay.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryDisplay.java index 68e0504bca68..61aacb893cf5 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryDisplay.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryDisplay.java @@ -5,15 +5,15 @@ package com.azure.resourcemanager.dataprotection.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; -/** ClientDiscoveryDisplay Localized display information of an operation. */ +/** + * ClientDiscoveryDisplay + * + *

Localized display information of an operation. + */ @Fluent public final class ClientDiscoveryDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryDisplay.class); - /* * Description of the operation having details of what operation is about. */ @@ -38,6 +38,10 @@ public final class ClientDiscoveryDisplay { @JsonProperty(value = "resource") private String resource; + /** Creates an instance of ClientDiscoveryDisplay class. */ + public ClientDiscoveryDisplay() { + } + /** * Get the description property: Description of the operation having details of what operation is about. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryForLogSpecification.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryForLogSpecification.java index 9f4f0645a960..cd3dc901e5f3 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryForLogSpecification.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryForLogSpecification.java @@ -5,15 +5,15 @@ package com.azure.resourcemanager.dataprotection.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; -/** ClientDiscoveryForLogSpecification Class to represent shoebox log specification in json client discovery. */ +/** + * ClientDiscoveryForLogSpecification + * + *

Class to represent shoebox log specification in json client discovery. + */ @Fluent public final class ClientDiscoveryForLogSpecification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryForLogSpecification.class); - /* * blob duration of shoebox log specification */ @@ -32,6 +32,10 @@ public final class ClientDiscoveryForLogSpecification { @JsonProperty(value = "name") private String name; + /** Creates an instance of ClientDiscoveryForLogSpecification class. */ + public ClientDiscoveryForLogSpecification() { + } + /** * Get the blobDuration property: blob duration of shoebox log specification. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryForProperties.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryForProperties.java index f862ba6d75ed..974af49318aa 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryForProperties.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryForProperties.java @@ -5,23 +5,31 @@ package com.azure.resourcemanager.dataprotection.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; -/** ClientDiscoveryForProperties Class to represent shoebox properties in json client discovery. */ +/** + * ClientDiscoveryForProperties + * + *

Class to represent shoebox properties in json client discovery. + */ @Fluent public final class ClientDiscoveryForProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryForProperties.class); - /* - * ClientDiscoveryForServiceSpecification Operation properties. + * ClientDiscoveryForServiceSpecification + * + * Operation properties. */ @JsonProperty(value = "serviceSpecification") private ClientDiscoveryForServiceSpecification serviceSpecification; + /** Creates an instance of ClientDiscoveryForProperties class. */ + public ClientDiscoveryForProperties() { + } + /** - * Get the serviceSpecification property: ClientDiscoveryForServiceSpecification Operation properties. + * Get the serviceSpecification property: ClientDiscoveryForServiceSpecification + * + *

Operation properties. * * @return the serviceSpecification value. */ @@ -30,7 +38,9 @@ public ClientDiscoveryForServiceSpecification serviceSpecification() { } /** - * Set the serviceSpecification property: ClientDiscoveryForServiceSpecification Operation properties. + * Set the serviceSpecification property: ClientDiscoveryForServiceSpecification + * + *

Operation properties. * * @param serviceSpecification the serviceSpecification value to set. * @return the ClientDiscoveryForProperties object itself. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryForServiceSpecification.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryForServiceSpecification.java index 4098ea8dd0f8..08abd7d39b32 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryForServiceSpecification.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryForServiceSpecification.java @@ -5,22 +5,26 @@ package com.azure.resourcemanager.dataprotection.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; -/** ClientDiscoveryForServiceSpecification Class to represent shoebox service specification in json client discovery. */ +/** + * ClientDiscoveryForServiceSpecification + * + *

Class to represent shoebox service specification in json client discovery. + */ @Fluent public final class ClientDiscoveryForServiceSpecification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryForServiceSpecification.class); - /* * List of log specifications of this operation. */ @JsonProperty(value = "logSpecifications") private List logSpecifications; + /** Creates an instance of ClientDiscoveryForServiceSpecification class. */ + public ClientDiscoveryForServiceSpecification() { + } + /** * Get the logSpecifications property: List of log specifications of this operation. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryResponse.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryResponse.java index e6e95986c7f1..828a6eee1950 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryResponse.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryResponse.java @@ -5,17 +5,17 @@ package com.azure.resourcemanager.dataprotection.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.fluent.models.ClientDiscoveryValueForSingleApiInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** ClientDiscoveryResponse Operations List response which contains list of available APIs. */ +/** + * ClientDiscoveryResponse + * + *

Operations List response which contains list of available APIs. + */ @Fluent public final class ClientDiscoveryResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryResponse.class); - /* * Link to the next chunk of Response. */ @@ -28,6 +28,10 @@ public final class ClientDiscoveryResponse { @JsonProperty(value = "value") private List value; + /** Creates an instance of ClientDiscoveryResponse class. */ + public ClientDiscoveryResponse() { + } + /** * Get the nextLink property: Link to the next chunk of Response. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryValueForSingleApi.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryValueForSingleApi.java index 655be1f4028d..9b35bd402e3e 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryValueForSingleApi.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ClientDiscoveryValueForSingleApi.java @@ -9,8 +9,9 @@ /** An immutable client-side representation of ClientDiscoveryValueForSingleApi. */ public interface ClientDiscoveryValueForSingleApi { /** - * Gets the display property: ClientDiscoveryDisplay Contains the localized display information for this particular - * operation. + * Gets the display property: ClientDiscoveryDisplay + * + *

Contains the localized display information for this particular operation. * * @return the display value. */ @@ -39,7 +40,9 @@ public interface ClientDiscoveryValueForSingleApi { String origin(); /** - * Gets the properties property: ClientDiscoveryForProperties Properties for the given operation. + * Gets the properties property: ClientDiscoveryForProperties + * + *

Properties for the given operation. * * @return the properties value. */ diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CopyOnExpiryOption.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CopyOnExpiryOption.java index 317875f741ae..186faf72fd71 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CopyOnExpiryOption.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CopyOnExpiryOption.java @@ -5,17 +5,21 @@ package com.azure.resourcemanager.dataprotection.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; -/** CopyOnExpiryOption Copy on Expiry Option. */ +/** + * CopyOnExpiryOption + * + *

Copy on Expiry Option. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("CopyOnExpiryOption") @Immutable public final class CopyOnExpiryOption extends CopyOption { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CopyOnExpiryOption.class); + /** Creates an instance of CopyOnExpiryOption class. */ + public CopyOnExpiryOption() { + } /** * Validates the instance. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CopyOption.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CopyOption.java index 3f7fc22bad7d..e8d271953036 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CopyOption.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CopyOption.java @@ -5,13 +5,15 @@ package com.azure.resourcemanager.dataprotection.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; -/** CopyOption Options to copy. */ +/** + * CopyOption + * + *

Options to copy. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -25,7 +27,9 @@ }) @Immutable public class CopyOption { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CopyOption.class); + /** Creates an instance of CopyOption class. */ + public CopyOption() { + } /** * Validates the instance. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CurrentProtectionState.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CurrentProtectionState.java index 345cea016f48..6c9dfe490cfb 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CurrentProtectionState.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CurrentProtectionState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CurrentProtectionState. */ +/** Specifies the current protection state of the resource. */ public final class CurrentProtectionState extends ExpandableStringEnum { /** Static value Invalid for CurrentProtectionState. */ public static final CurrentProtectionState INVALID = fromString("Invalid"); @@ -59,7 +59,11 @@ public static CurrentProtectionState fromString(String name) { return fromString(name, CurrentProtectionState.class); } - /** @return known CurrentProtectionState values. */ + /** + * Gets known CurrentProtectionState values. + * + * @return known CurrentProtectionState values. + */ public static Collection values() { return values(CurrentProtectionState.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CustomCopyOption.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CustomCopyOption.java index 15db2dd13a4d..ff6f3eae1384 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CustomCopyOption.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CustomCopyOption.java @@ -5,25 +5,29 @@ package com.azure.resourcemanager.dataprotection.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; -/** CustomCopyOption Duration based custom options to copy. */ +/** + * CustomCopyOption + * + *

Duration based custom options to copy. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("CustomCopyOption") @Fluent public final class CustomCopyOption extends CopyOption { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomCopyOption.class); - /* * Data copied after given timespan */ @JsonProperty(value = "duration") private String duration; + /** Creates an instance of CustomCopyOption class. */ + public CustomCopyOption() { + } + /** * Get the duration property: Data copied after given timespan. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataProtectionOperations.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataProtectionOperations.java index b0259965b326..f124a2467726 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataProtectionOperations.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataProtectionOperations.java @@ -14,7 +14,7 @@ public interface DataProtectionOperations { * * @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 clientDiscoveryResponse. + * @return clientDiscoveryResponse as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface DataProtectionOperations { * @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 clientDiscoveryResponse. + * @return clientDiscoveryResponse as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataProtections.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataProtections.java index 9fd9430121dd..38d256d4d875 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataProtections.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataProtections.java @@ -14,24 +14,24 @@ public interface DataProtections { * * @param location The location parameter. * @param parameters Feature support request object. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for Backup Feature support. + * @return base class for Backup Feature support along with {@link Response}. */ - FeatureValidationResponseBase checkFeatureSupport(String location, FeatureValidationRequestBase parameters); + Response checkFeatureSupportWithResponse( + String location, FeatureValidationRequestBase parameters, Context context); /** * Validates if a feature is supported. * * @param location The location parameter. * @param parameters Feature support request object. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return base class for Backup Feature support. */ - Response checkFeatureSupportWithResponse( - String location, FeatureValidationRequestBase parameters, Context context); + FeatureValidationResponseBase checkFeatureSupport(String location, FeatureValidationRequestBase parameters); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataStoreInfoBase.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataStoreInfoBase.java index 42e35f9d92e1..e2c4f29781c4 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataStoreInfoBase.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataStoreInfoBase.java @@ -6,14 +6,15 @@ 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; -/** DataStoreInfoBase DataStoreInfo base. */ +/** + * DataStoreInfoBase + * + *

DataStoreInfo base. + */ @Fluent public final class DataStoreInfoBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataStoreInfoBase.class); - /* * type of datastore; Operational/Vault/Archive */ @@ -26,6 +27,10 @@ public final class DataStoreInfoBase { @JsonProperty(value = "objectType", required = true) private String objectType; + /** Creates an instance of DataStoreInfoBase class. */ + public DataStoreInfoBase() { + } + /** * Get the dataStoreType property: type of datastore; Operational/Vault/Archive. * @@ -73,14 +78,16 @@ public DataStoreInfoBase withObjectType(String objectType) { */ public void validate() { if (dataStoreType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property dataStoreType in model DataStoreInfoBase")); } if (objectType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property objectType in model DataStoreInfoBase")); } } + + private static final ClientLogger LOGGER = new ClientLogger(DataStoreInfoBase.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataStoreParameters.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataStoreParameters.java index 84ea553cc511..6cd528515a1a 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataStoreParameters.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataStoreParameters.java @@ -6,7 +6,6 @@ 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; @@ -24,14 +23,16 @@ }) @Fluent public class DataStoreParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataStoreParameters.class); - /* * type of datastore; Operational/Vault/Archive */ @JsonProperty(value = "dataStoreType", required = true) private DataStoreTypes dataStoreType; + /** Creates an instance of DataStoreParameters class. */ + public DataStoreParameters() { + } + /** * Get the dataStoreType property: type of datastore; Operational/Vault/Archive. * @@ -59,10 +60,12 @@ public DataStoreParameters withDataStoreType(DataStoreTypes dataStoreType) { */ public void validate() { if (dataStoreType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property dataStoreType in model DataStoreParameters")); } } + + private static final ClientLogger LOGGER = new ClientLogger(DataStoreParameters.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataStoreTypes.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataStoreTypes.java index 6e57b84f201c..e95f89dccf85 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataStoreTypes.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DataStoreTypes.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for DataStoreTypes. */ +/** type of datastore; Operational/Vault/Archive. */ public final class DataStoreTypes extends ExpandableStringEnum { /** Static value OperationalStore for DataStoreTypes. */ public static final DataStoreTypes OPERATIONAL_STORE = fromString("OperationalStore"); @@ -30,7 +30,11 @@ public static DataStoreTypes fromString(String name) { return fromString(name, DataStoreTypes.class); } - /** @return known DataStoreTypes values. */ + /** + * Gets known DataStoreTypes values. + * + * @return known DataStoreTypes values. + */ public static Collection values() { return values(DataStoreTypes.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Datasource.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Datasource.java index 056cf65e5a34..48dbc90f6e0d 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Datasource.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Datasource.java @@ -6,14 +6,15 @@ 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; -/** Datasource Datasource to be backed up. */ +/** + * Datasource + * + *

Datasource to be backed up. + */ @Fluent public final class Datasource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Datasource.class); - /* * DatasourceType of the resource. */ @@ -27,9 +28,8 @@ public final class Datasource { private String objectType; /* - * Full ARM ID of the resource. For azure resources, this is ARM ID. For - * non azure resources, this will be the ID created by backup service via - * Fabric/Vault. + * Full ARM ID of the resource. For azure resources, this is ARM ID. For non azure resources, this will be the ID + * created by backup service via Fabric/Vault. */ @JsonProperty(value = "resourceID", required = true) private String resourceId; @@ -58,6 +58,10 @@ public final class Datasource { @JsonProperty(value = "resourceUri") private String resourceUri; + /** Creates an instance of Datasource class. */ + public Datasource() { + } + /** * Get the datasourceType property: DatasourceType of the resource. * @@ -207,9 +211,11 @@ public Datasource withResourceUri(String resourceUri) { */ public void validate() { if (resourceId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property resourceId in model Datasource")); } } + + private static final ClientLogger LOGGER = new ClientLogger(Datasource.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DatasourceSet.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DatasourceSet.java index 7c641592bee4..1c6f87627cfe 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DatasourceSet.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DatasourceSet.java @@ -6,14 +6,15 @@ 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; -/** DatasourceSet DatasourceSet details of datasource to be backed up. */ +/** + * DatasourceSet + * + *

DatasourceSet details of datasource to be backed up. + */ @Fluent public final class DatasourceSet { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DatasourceSet.class); - /* * DatasourceType of the resource. */ @@ -27,9 +28,8 @@ public final class DatasourceSet { private String objectType; /* - * Full ARM ID of the resource. For azure resources, this is ARM ID. For - * non azure resources, this will be the ID created by backup service via - * Fabric/Vault. + * Full ARM ID of the resource. For azure resources, this is ARM ID. For non azure resources, this will be the ID + * created by backup service via Fabric/Vault. */ @JsonProperty(value = "resourceID", required = true) private String resourceId; @@ -58,6 +58,10 @@ public final class DatasourceSet { @JsonProperty(value = "resourceUri") private String resourceUri; + /** Creates an instance of DatasourceSet class. */ + public DatasourceSet() { + } + /** * Get the datasourceType property: DatasourceType of the resource. * @@ -207,9 +211,11 @@ public DatasourceSet withResourceUri(String resourceUri) { */ public void validate() { if (resourceId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property resourceId in model DatasourceSet")); } } + + private static final ClientLogger LOGGER = new ClientLogger(DatasourceSet.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Day.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Day.java index 66f9b6663ab9..1993d6b2b862 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Day.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Day.java @@ -5,15 +5,15 @@ package com.azure.resourcemanager.dataprotection.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; -/** Day Day of the week. */ +/** + * Day + * + *

Day of the week. + */ @Fluent public final class Day { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Day.class); - /* * Date of the month */ @@ -26,6 +26,10 @@ public final class Day { @JsonProperty(value = "isLast") private Boolean isLast; + /** Creates an instance of Day class. */ + public Day() { + } + /** * Get the date property: Date of the month. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DayOfWeek.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DayOfWeek.java index 0c67c4a59688..14a306dd5dbe 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DayOfWeek.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DayOfWeek.java @@ -42,7 +42,11 @@ public static DayOfWeek fromString(String name) { return fromString(name, DayOfWeek.class); } - /** @return known DayOfWeek values. */ + /** + * Gets known DayOfWeek values. + * + * @return known DayOfWeek values. + */ public static Collection values() { return values(DayOfWeek.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeleteOption.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeleteOption.java index f3259696a62b..72517480bf2d 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeleteOption.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeleteOption.java @@ -6,13 +6,16 @@ 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; -/** DeleteOption Delete Option. */ +/** + * DeleteOption + * + *

Delete Option. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -22,14 +25,16 @@ @JsonSubTypes({@JsonSubTypes.Type(name = "AbsoluteDeleteOption", value = AbsoluteDeleteOption.class)}) @Fluent public class DeleteOption { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeleteOption.class); - /* * Duration of deletion after given timespan */ @JsonProperty(value = "duration", required = true) private String duration; + /** Creates an instance of DeleteOption class. */ + public DeleteOption() { + } + /** * Get the duration property: Duration of deletion after given timespan. * @@ -57,9 +62,11 @@ public DeleteOption withDuration(String duration) { */ public void validate() { if (duration() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property duration in model DeleteOption")); } } + + private static final ClientLogger LOGGER = new ClientLogger(DeleteOption.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstance.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstance.java new file mode 100644 index 000000000000..ad4cb4797f28 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstance.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deleted Backup Instance. */ +@Fluent +public final class DeletedBackupInstance extends BackupInstance { + /* + * Deletion info of Backup Instance + */ + @JsonProperty(value = "deletionInfo", access = JsonProperty.Access.WRITE_ONLY) + private DeletionInfo deletionInfo; + + /** Creates an instance of DeletedBackupInstance class. */ + public DeletedBackupInstance() { + } + + /** + * Get the deletionInfo property: Deletion info of Backup Instance. + * + * @return the deletionInfo value. + */ + public DeletionInfo deletionInfo() { + return this.deletionInfo; + } + + /** {@inheritDoc} */ + @Override + public DeletedBackupInstance withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeletedBackupInstance withDataSourceInfo(Datasource dataSourceInfo) { + super.withDataSourceInfo(dataSourceInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeletedBackupInstance withDataSourceSetInfo(DatasourceSet dataSourceSetInfo) { + super.withDataSourceSetInfo(dataSourceSetInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeletedBackupInstance withPolicyInfo(PolicyInfo policyInfo) { + super.withPolicyInfo(policyInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeletedBackupInstance withDatasourceAuthCredentials(AuthCredentials datasourceAuthCredentials) { + super.withDatasourceAuthCredentials(datasourceAuthCredentials); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeletedBackupInstance withValidationType(ValidationType validationType) { + super.withValidationType(validationType); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeletedBackupInstance withObjectType(String objectType) { + super.withObjectType(objectType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (deletionInfo() != null) { + deletionInfo().validate(); + } + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstanceResource.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstanceResource.java new file mode 100644 index 000000000000..e2fc079d83df --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstanceResource.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.dataprotection.fluent.models.DeletedBackupInstanceResourceInner; + +/** An immutable client-side representation of DeletedBackupInstanceResource. */ +public interface DeletedBackupInstanceResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: DeletedBackupInstanceResource properties. + * + * @return the properties value. + */ + DeletedBackupInstance properties(); + + /** + * Gets the inner com.azure.resourcemanager.dataprotection.fluent.models.DeletedBackupInstanceResourceInner object. + * + * @return the inner object. + */ + DeletedBackupInstanceResourceInner innerModel(); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstanceResourceList.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstanceResourceList.java new file mode 100644 index 000000000000..79cdbfb79b26 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstanceResourceList.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.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dataprotection.fluent.models.DeletedBackupInstanceResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of DeletedBackupInstance resources. */ +@Fluent +public final class DeletedBackupInstanceResourceList extends DppResourceList { + /* + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of DeletedBackupInstanceResourceList class. */ + public DeletedBackupInstanceResourceList() { + } + + /** + * 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 DeletedBackupInstanceResourceList object itself. + */ + public DeletedBackupInstanceResourceList withValue(List value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public DeletedBackupInstanceResourceList 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/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstances.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstances.java new file mode 100644 index 000000000000..dd1c5ea6c7ce --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstances.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.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 DeletedBackupInstances. */ +public interface DeletedBackupInstances { + /** + * Gets deleted backup instances belonging to a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deleted backup instances belonging to a backup vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Gets deleted backup instances belonging to a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deleted backup instances belonging to a backup vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * Gets a deleted backup instance with name in a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @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 a deleted backup instance with name in a backup vault along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String backupInstanceName, Context context); + + /** + * Gets a deleted backup instance with name in a backup vault. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @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 a deleted backup instance with name in a backup vault. + */ + DeletedBackupInstanceResource get(String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @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 undelete(String resourceGroupName, String vaultName, String backupInstanceName); + + /** + * The undelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param backupInstanceName The name of the deleted backup instance. + * @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 undelete(String resourceGroupName, String vaultName, String backupInstanceName, Context context); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletionInfo.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletionInfo.java new file mode 100644 index 000000000000..727c9f31e3a7 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletionInfo.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deletion Info. */ +@Immutable +public final class DeletionInfo { + /* + * Specifies time of deletion + */ + @JsonProperty(value = "deletionTime", access = JsonProperty.Access.WRITE_ONLY) + private String deletionTime; + + /* + * Specifies billing end date + */ + @JsonProperty(value = "billingEndDate", access = JsonProperty.Access.WRITE_ONLY) + private String billingEndDate; + + /* + * Specifies purge time + */ + @JsonProperty(value = "scheduledPurgeTime", access = JsonProperty.Access.WRITE_ONLY) + private String scheduledPurgeTime; + + /* + * Delete activity ID for troubleshooting purpose + */ + @JsonProperty(value = "deleteActivityID", access = JsonProperty.Access.WRITE_ONLY) + private String deleteActivityId; + + /** Creates an instance of DeletionInfo class. */ + public DeletionInfo() { + } + + /** + * Get the deletionTime property: Specifies time of deletion. + * + * @return the deletionTime value. + */ + public String deletionTime() { + return this.deletionTime; + } + + /** + * Get the billingEndDate property: Specifies billing end date. + * + * @return the billingEndDate value. + */ + public String billingEndDate() { + return this.billingEndDate; + } + + /** + * Get the scheduledPurgeTime property: Specifies purge time. + * + * @return the scheduledPurgeTime value. + */ + public String scheduledPurgeTime() { + return this.scheduledPurgeTime; + } + + /** + * Get the deleteActivityId property: Delete activity ID for troubleshooting purpose. + * + * @return the deleteActivityId value. + */ + public String deleteActivityId() { + return this.deleteActivityId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppBaseResourceList.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppBaseResourceList.java index bed05220dca2..bdede7ddba76 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppBaseResourceList.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppBaseResourceList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.dataprotection.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.fluent.models.DppBaseResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Base for all lists of V2 resources. */ @Fluent public final class DppBaseResourceList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DppBaseResourceList.class); - /* * List of Dpp resources. */ @@ -23,12 +19,15 @@ public final class DppBaseResourceList { private List value; /* - * The uri to fetch the next page of resources. Call ListNext() fetches - * next page of resources. + * The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. */ @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of DppBaseResourceList class. */ + public DppBaseResourceList() { + } + /** * Get the value property: List of Dpp resources. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppIdentityDetails.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppIdentityDetails.java index e585b84f4d17..4fb7183a6981 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppIdentityDetails.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppIdentityDetails.java @@ -5,25 +5,24 @@ package com.azure.resourcemanager.dataprotection.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; -/** DppIdentityDetails Identity details. */ +/** + * DppIdentityDetails + * + *

Identity details. + */ @Fluent public final class DppIdentityDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DppIdentityDetails.class); - /* - * The object ID of the service principal object for the managed identity - * that is used to grant role-based access to an Azure resource. + * The object ID of the service principal object for the managed identity that is used to grant role-based access + * to an Azure resource. */ @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private String principalId; /* - * A Globally Unique Identifier (GUID) that represents the Azure AD tenant - * where the resource is now a member. + * A Globally Unique Identifier (GUID) that represents the Azure AD tenant where the resource is now a member. */ @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private String tenantId; @@ -34,6 +33,10 @@ public final class DppIdentityDetails { @JsonProperty(value = "type") private String type; + /** Creates an instance of DppIdentityDetails class. */ + public DppIdentityDetails() { + } + /** * Get the principalId property: The object ID of the service principal object for the managed identity that is used * to grant role-based access to an Azure resource. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppProxyResource.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppProxyResource.java new file mode 100644 index 000000000000..90a3807af04d --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppProxyResource.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The DppProxyResource model. */ +@Fluent +public class DppProxyResource extends ProxyResource { + /* + * Proxy Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of DppProxyResource class. */ + public DppProxyResource() { + } + + /** + * Get the tags property: Proxy Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Proxy Resource tags. + * + * @param tags the tags value to set. + * @return the DppProxyResource object itself. + */ + public DppProxyResource withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppResource.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppResource.java index c001e9d36f4b..e6fadd3ad760 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppResource.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppResource.java @@ -7,21 +7,25 @@ import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** DppResource Resource class. */ +/** + * DppResource + * + *

Resource class. + */ @Immutable public class DppResource extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DppResource.class); - /* * Metadata pertaining to creation and last modification of the resource. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of DppResource class. */ + public DppResource() { + } + /** * Get the systemData property: Metadata pertaining to creation and last modification of the resource. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppResourceGuardProxies.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppResourceGuardProxies.java new file mode 100644 index 000000000000..f6788809eb09 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppResourceGuardProxies.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.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 DppResourceGuardProxies. */ +public interface DppResourceGuardProxies { + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ResourceGuardProxyBase resources as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ResourceGuardProxyBase resources as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 body along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String resourceGuardProxyName, Context context); + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 resourceGroupName, String vaultName, String resourceGuardProxyName); + + /** + * The delete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String vaultName, String resourceGuardProxyName, Context context); + + /** + * The delete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 resourceGroupName, String vaultName, String resourceGuardProxyName); + + /** + * The unlockDelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 along with {@link Response}. + */ + Response unlockDeleteWithResponse( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + UnlockDeleteRequest parameters, + Context context); + + /** + * The unlockDelete operation. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 resourceGroupName, String vaultName, String resourceGuardProxyName, UnlockDeleteRequest parameters); + + /** + * The get operation. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + ResourceGuardProxyBaseResource getById(String id); + + /** + * The get operation. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The delete operation. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * The delete operation. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ResourceGuardProxyBaseResource resource. + * + * @param name resource name. + * @return the first stage of the new ResourceGuardProxyBaseResource definition. + */ + ResourceGuardProxyBaseResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppResourceList.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppResourceList.java index 0d1e769b96ca..9e4e097b9ef7 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppResourceList.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppResourceList.java @@ -5,22 +5,25 @@ package com.azure.resourcemanager.dataprotection.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; -/** List Resource ListResource. */ +/** + * List Resource + * + *

ListResource. + */ @Fluent public class DppResourceList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DppResourceList.class); - /* - * The uri to fetch the next page of resources. Call ListNext() fetches - * next page of resources. + * The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. */ @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of DppResourceList class. */ + public DppResourceList() { + } + /** * Get the nextLink property: The uri to fetch the next page of resources. Call ListNext() fetches next page of * resources. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppTrackedResource.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppTrackedResource.java index 6a2f990adca3..bfe7a84acab4 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppTrackedResource.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppTrackedResource.java @@ -7,16 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The DppTrackedResource model. */ @Fluent public class DppTrackedResource extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DppTrackedResource.class); - /* * Optional ETag. */ @@ -24,7 +20,9 @@ public class DppTrackedResource extends Resource { private String etag; /* - * DppIdentityDetails Input Managed Identity Details + * DppIdentityDetails + * + * Input Managed Identity Details */ @JsonProperty(value = "identity") private DppIdentityDetails identity; @@ -35,6 +33,10 @@ public class DppTrackedResource extends Resource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of DppTrackedResource class. */ + public DppTrackedResource() { + } + /** * Get the etag property: Optional ETag. * @@ -56,7 +58,9 @@ public DppTrackedResource withEtag(String etag) { } /** - * Get the identity property: DppIdentityDetails Input Managed Identity Details. + * Get the identity property: DppIdentityDetails + * + *

Input Managed Identity Details. * * @return the identity value. */ @@ -65,7 +69,9 @@ public DppIdentityDetails identity() { } /** - * Set the identity property: DppIdentityDetails Input Managed Identity Details. + * Set the identity property: DppIdentityDetails + * + *

Input Managed Identity Details. * * @param identity the identity value to set. * @return the DppTrackedResource object itself. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppTrackedResourceList.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppTrackedResourceList.java index 0f8e080c0f57..f75c3fd89915 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppTrackedResourceList.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppTrackedResourceList.java @@ -5,22 +5,21 @@ package com.azure.resourcemanager.dataprotection.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 DppTrackedResourceList model. */ @Fluent public class DppTrackedResourceList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DppTrackedResourceList.class); - /* - * The uri to fetch the next page of resources. Call ListNext() fetches - * next page of resources. + * The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. */ @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of DppTrackedResourceList class. */ + public DppTrackedResourceList() { + } + /** * Get the nextLink property: The uri to fetch the next page of resources. Call ListNext() fetches next page of * resources. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppWorkerRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppWorkerRequest.java index c65813fa3196..17b8e3b48768 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppWorkerRequest.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppWorkerRequest.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.dataprotection.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.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -15,8 +13,6 @@ /** The DppWorkerRequest model. */ @Fluent public class DppWorkerRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DppWorkerRequest.class); - /* * The subscriptionId property. */ @@ -30,8 +26,7 @@ public class DppWorkerRequest { private String uri; /* - * Dictionary of - * + * Dictionary of */ @JsonProperty(value = "headers") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) @@ -62,6 +57,10 @@ public class DppWorkerRequest { @JsonProperty(value = "httpMethod") private String httpMethod; + /** Creates an instance of DppWorkerRequest class. */ + public DppWorkerRequest() { + } + /** * Get the subscriptionId property: The subscriptionId property. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExistingResourcePolicy.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExistingResourcePolicy.java new file mode 100644 index 000000000000..ebcbc2bb6307 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExistingResourcePolicy.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.dataprotection.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the Conflict Policy property. This property sets policy during conflict of resources during restore. */ +public final class ExistingResourcePolicy extends ExpandableStringEnum { + /** Static value Skip for ExistingResourcePolicy. */ + public static final ExistingResourcePolicy SKIP = fromString("Skip"); + + /** Static value Patch for ExistingResourcePolicy. */ + public static final ExistingResourcePolicy PATCH = fromString("Patch"); + + /** + * Creates or finds a ExistingResourcePolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExistingResourcePolicy. + */ + @JsonCreator + public static ExistingResourcePolicy fromString(String name) { + return fromString(name, ExistingResourcePolicy.class); + } + + /** + * Gets known ExistingResourcePolicy values. + * + * @return known ExistingResourcePolicy values. + */ + public static Collection values() { + return values(ExistingResourcePolicy.class); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExportJobsOperationResults.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExportJobsOperationResults.java index 5c011ef84fef..a6bc7c2b542a 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExportJobsOperationResults.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExportJobsOperationResults.java @@ -17,12 +17,14 @@ public interface ExportJobsOperationResults { * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. * @param operationId OperationID which represents the export job. + * @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 operation result of operation triggered by Export Jobs API. + * @return the operation result of operation triggered by Export Jobs API along with {@link Response}. */ - ExportJobsResult get(String resourceGroupName, String vaultName, String operationId); + Response getWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context); /** * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also @@ -32,12 +34,10 @@ public interface ExportJobsOperationResults { * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. * @param operationId OperationID which represents the export job. - * @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 operation result of operation triggered by Export Jobs API. */ - Response getWithResponse( - String resourceGroupName, String vaultName, String operationId, Context context); + ExportJobsResult get(String resourceGroupName, String vaultName, String operationId); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExportJobsTriggerHeaders.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExportJobsTriggerHeaders.java deleted file mode 100644 index 0bf1e8e6d19a..000000000000 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExportJobsTriggerHeaders.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.dataprotection.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 ExportJobsTriggerHeaders model. */ -@Fluent -public final class ExportJobsTriggerHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportJobsTriggerHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private Integer retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public Integer retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the ExportJobsTriggerHeaders object itself. - */ - public ExportJobsTriggerHeaders withRetryAfter(Integer retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the ExportJobsTriggerHeaders object itself. - */ - public ExportJobsTriggerHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExportJobsTriggerResponse.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExportJobsTriggerResponse.java deleted file mode 100644 index 01d12acd48fa..000000000000 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ExportJobsTriggerResponse.java +++ /dev/null @@ -1,26 +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.dataprotection.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; - -/** Contains all response data for the trigger operation. */ -public final class ExportJobsTriggerResponse extends ResponseBase { - /** - * Creates an instance of ExportJobsTriggerResponse. - * - * @param request the request which resulted in this ExportJobsTriggerResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public ExportJobsTriggerResponse( - HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, ExportJobsTriggerHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } -} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureSupportStatus.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureSupportStatus.java index 78a88f1d7971..59b52e4d7a64 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureSupportStatus.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureSupportStatus.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for FeatureSupportStatus. */ +/** feature support status. */ public final class FeatureSupportStatus extends ExpandableStringEnum { /** Static value Invalid for FeatureSupportStatus. */ public static final FeatureSupportStatus INVALID = fromString("Invalid"); @@ -39,7 +39,11 @@ public static FeatureSupportStatus fromString(String name) { return fromString(name, FeatureSupportStatus.class); } - /** @return known FeatureSupportStatus values. */ + /** + * Gets known FeatureSupportStatus values. + * + * @return known FeatureSupportStatus values. + */ public static Collection values() { return values(FeatureSupportStatus.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureType.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureType.java index f79b9b134078..af5cd416c061 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureType.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for FeatureType. */ +/** backup support feature type. */ public final class FeatureType extends ExpandableStringEnum { /** Static value Invalid for FeatureType. */ public static final FeatureType INVALID = fromString("Invalid"); @@ -27,7 +27,11 @@ public static FeatureType fromString(String name) { return fromString(name, FeatureType.class); } - /** @return known FeatureType values. */ + /** + * Gets known FeatureType values. + * + * @return known FeatureType values. + */ public static Collection values() { return values(FeatureType.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureValidationRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureValidationRequest.java index c7a6f237d770..15c706271102 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureValidationRequest.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureValidationRequest.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.dataprotection.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; @@ -16,8 +14,6 @@ @JsonTypeName("FeatureValidationRequest") @Fluent public final class FeatureValidationRequest extends FeatureValidationRequestBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FeatureValidationRequest.class); - /* * backup support feature type. */ @@ -30,6 +26,10 @@ public final class FeatureValidationRequest extends FeatureValidationRequestBase @JsonProperty(value = "featureName") private String featureName; + /** Creates an instance of FeatureValidationRequest class. */ + public FeatureValidationRequest() { + } + /** * Get the featureType property: backup support feature type. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureValidationRequestBase.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureValidationRequestBase.java index d2512c623479..2f83bb3866e4 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureValidationRequestBase.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureValidationRequestBase.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.dataprotection.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; @@ -21,7 +19,9 @@ @JsonSubTypes({@JsonSubTypes.Type(name = "FeatureValidationRequest", value = FeatureValidationRequest.class)}) @Immutable public class FeatureValidationRequestBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FeatureValidationRequestBase.class); + /** Creates an instance of FeatureValidationRequestBase class. */ + public FeatureValidationRequestBase() { + } /** * Validates the instance. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureValidationResponse.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureValidationResponse.java index 4c15bdee2315..173894919d6b 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureValidationResponse.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureValidationResponse.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.dataprotection.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.fluent.models.FeatureValidationResponseBaseInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,8 +16,6 @@ @JsonTypeName("FeatureValidationResponse") @Fluent public final class FeatureValidationResponse extends FeatureValidationResponseBaseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FeatureValidationResponse.class); - /* * backup support feature type. */ @@ -32,6 +28,10 @@ public final class FeatureValidationResponse extends FeatureValidationResponseBa @JsonProperty(value = "features") private List features; + /** Creates an instance of FeatureValidationResponse class. */ + public FeatureValidationResponse() { + } + /** * Get the featureType property: backup support feature type. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ImmediateCopyOption.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ImmediateCopyOption.java index 8885417428fe..6a00574ddf04 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ImmediateCopyOption.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ImmediateCopyOption.java @@ -5,17 +5,21 @@ package com.azure.resourcemanager.dataprotection.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; -/** ImmediateCopyOption Immediate copy Option. */ +/** + * ImmediateCopyOption + * + *

Immediate copy Option. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("ImmediateCopyOption") @Immutable public final class ImmediateCopyOption extends CopyOption { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImmediateCopyOption.class); + /** Creates an instance of ImmediateCopyOption class. */ + public ImmediateCopyOption() { + } /** * Validates the instance. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ImmutabilitySettings.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ImmutabilitySettings.java new file mode 100644 index 000000000000..f6dcaf1aa7bb --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ImmutabilitySettings.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.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Immutability Settings at vault level. */ +@Fluent +public final class ImmutabilitySettings { + /* + * Immutability state + */ + @JsonProperty(value = "state") + private ImmutabilityState state; + + /** Creates an instance of ImmutabilitySettings class. */ + public ImmutabilitySettings() { + } + + /** + * Get the state property: Immutability state. + * + * @return the state value. + */ + public ImmutabilityState state() { + return this.state; + } + + /** + * Set the state property: Immutability state. + * + * @param state the state value to set. + * @return the ImmutabilitySettings object itself. + */ + public ImmutabilitySettings withState(ImmutabilityState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ImmutabilityState.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ImmutabilityState.java new file mode 100644 index 000000000000..c5539e4a6f2f --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ImmutabilityState.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Immutability state. */ +public final class ImmutabilityState extends ExpandableStringEnum { + /** Static value Disabled for ImmutabilityState. */ + public static final ImmutabilityState DISABLED = fromString("Disabled"); + + /** Static value Unlocked for ImmutabilityState. */ + public static final ImmutabilityState UNLOCKED = fromString("Unlocked"); + + /** Static value Locked for ImmutabilityState. */ + public static final ImmutabilityState LOCKED = fromString("Locked"); + + /** + * Creates or finds a ImmutabilityState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImmutabilityState. + */ + @JsonCreator + public static ImmutabilityState fromString(String name) { + return fromString(name, ImmutabilityState.class); + } + + /** + * Gets known ImmutabilityState values. + * + * @return known ImmutabilityState values. + */ + public static Collection values() { + return values(ImmutabilityState.class); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/InnerError.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/InnerError.java index 1acf073b438e..bfbaed0af543 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/InnerError.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/InnerError.java @@ -5,20 +5,19 @@ package com.azure.resourcemanager.dataprotection.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.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** InnerError Inner Error. */ +/** + * InnerError + * + *

Inner Error. + */ @Fluent public final class InnerError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InnerError.class); - /* - * Any Key value pairs that can be provided to the client for additional - * verbose information. + * Any Key value pairs that can be provided to the client for additional verbose information. */ @JsonProperty(value = "additionalInfo") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) @@ -31,11 +30,17 @@ public final class InnerError { private String code; /* - * InnerError Child Inner Error, to allow Nesting. + * InnerError + * + * Child Inner Error, to allow Nesting. */ @JsonProperty(value = "embeddedInnerError") private InnerError embeddedInnerError; + /** Creates an instance of InnerError class. */ + public InnerError() { + } + /** * Get the additionalInfo property: Any Key value pairs that can be provided to the client for additional verbose * information. @@ -79,7 +84,9 @@ public InnerError withCode(String code) { } /** - * Get the embeddedInnerError property: InnerError Child Inner Error, to allow Nesting. + * Get the embeddedInnerError property: InnerError + * + *

Child Inner Error, to allow Nesting. * * @return the embeddedInnerError value. */ @@ -88,7 +95,9 @@ public InnerError embeddedInnerError() { } /** - * Set the embeddedInnerError property: InnerError Child Inner Error, to allow Nesting. + * Set the embeddedInnerError property: InnerError + * + *

Child Inner Error, to allow Nesting. * * @param embeddedInnerError the embeddedInnerError value to set. * @return the InnerError object itself. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ItemLevelRestoreCriteria.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ItemLevelRestoreCriteria.java index 909ee0691e83..309aa5e25b58 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ItemLevelRestoreCriteria.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ItemLevelRestoreCriteria.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.dataprotection.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; @@ -19,11 +17,19 @@ defaultImpl = ItemLevelRestoreCriteria.class) @JsonTypeName("ItemLevelRestoreCriteria") @JsonSubTypes({ - @JsonSubTypes.Type(name = "RangeBasedItemLevelRestoreCriteria", value = RangeBasedItemLevelRestoreCriteria.class) + @JsonSubTypes.Type(name = "ItemPathBasedRestoreCriteria", value = ItemPathBasedRestoreCriteria.class), + @JsonSubTypes.Type(name = "RangeBasedItemLevelRestoreCriteria", value = RangeBasedItemLevelRestoreCriteria.class), + @JsonSubTypes.Type( + name = "KubernetesStorageClassRestoreCriteria", + value = KubernetesStorageClassRestoreCriteria.class), + @JsonSubTypes.Type(name = "KubernetesPVRestoreCriteria", value = KubernetesPVRestoreCriteria.class), + @JsonSubTypes.Type(name = "KubernetesClusterRestoreCriteria", value = KubernetesClusterRestoreCriteria.class) }) @Immutable public class ItemLevelRestoreCriteria { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ItemLevelRestoreCriteria.class); + /** Creates an instance of ItemLevelRestoreCriteria class. */ + public ItemLevelRestoreCriteria() { + } /** * Validates the instance. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ItemLevelRestoreTargetInfo.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ItemLevelRestoreTargetInfo.java index e5fa632e98ec..5d0c619404eb 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ItemLevelRestoreTargetInfo.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ItemLevelRestoreTargetInfo.java @@ -6,7 +6,6 @@ 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; @@ -17,8 +16,6 @@ @JsonTypeName("ItemLevelRestoreTargetInfo") @Fluent public final class ItemLevelRestoreTargetInfo extends RestoreTargetInfoBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ItemLevelRestoreTargetInfo.class); - /* * Restore Criteria */ @@ -26,13 +23,17 @@ public final class ItemLevelRestoreTargetInfo extends RestoreTargetInfoBase { private List restoreCriteria; /* - * Datasource Information of target DS + * Datasource + * + * Information of target DS */ @JsonProperty(value = "datasourceInfo", required = true) private Datasource datasourceInfo; /* - * DatasourceSet Information of target DS Set + * DatasourceSet + * + * Information of target DS Set */ @JsonProperty(value = "datasourceSetInfo") private DatasourceSet datasourceSetInfo; @@ -43,6 +44,10 @@ public final class ItemLevelRestoreTargetInfo extends RestoreTargetInfoBase { @JsonProperty(value = "datasourceAuthCredentials") private AuthCredentials datasourceAuthCredentials; + /** Creates an instance of ItemLevelRestoreTargetInfo class. */ + public ItemLevelRestoreTargetInfo() { + } + /** * Get the restoreCriteria property: Restore Criteria. * @@ -64,7 +69,9 @@ public ItemLevelRestoreTargetInfo withRestoreCriteria(ListInformation of target DS. * * @return the datasourceInfo value. */ @@ -73,7 +80,9 @@ public Datasource datasourceInfo() { } /** - * Set the datasourceInfo property: Datasource Information of target DS. + * Set the datasourceInfo property: Datasource + * + *

Information of target DS. * * @param datasourceInfo the datasourceInfo value to set. * @return the ItemLevelRestoreTargetInfo object itself. @@ -84,7 +93,9 @@ public ItemLevelRestoreTargetInfo withDatasourceInfo(Datasource datasourceInfo) } /** - * Get the datasourceSetInfo property: DatasourceSet Information of target DS Set. + * Get the datasourceSetInfo property: DatasourceSet + * + *

Information of target DS Set. * * @return the datasourceSetInfo value. */ @@ -93,7 +104,9 @@ public DatasourceSet datasourceSetInfo() { } /** - * Set the datasourceSetInfo property: DatasourceSet Information of target DS Set. + * Set the datasourceSetInfo property: DatasourceSet + * + *

Information of target DS Set. * * @param datasourceSetInfo the datasourceSetInfo value to set. * @return the ItemLevelRestoreTargetInfo object itself. @@ -146,7 +159,7 @@ public ItemLevelRestoreTargetInfo withRestoreLocation(String restoreLocation) { public void validate() { super.validate(); if (restoreCriteria() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property restoreCriteria in model ItemLevelRestoreTargetInfo")); @@ -154,7 +167,7 @@ public void validate() { restoreCriteria().forEach(e -> e.validate()); } if (datasourceInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property datasourceInfo in model ItemLevelRestoreTargetInfo")); @@ -168,4 +181,6 @@ public void validate() { datasourceAuthCredentials().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ItemLevelRestoreTargetInfo.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ItemPathBasedRestoreCriteria.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ItemPathBasedRestoreCriteria.java new file mode 100644 index 000000000000..71c1139f7d2d --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ItemPathBasedRestoreCriteria.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Prefix criteria to be used to during restore. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("ItemPathBasedRestoreCriteria") +@Fluent +public final class ItemPathBasedRestoreCriteria extends ItemLevelRestoreCriteria { + /* + * The path of the item to be restored. It could be the full path of the item or the path relative to the backup + * item + */ + @JsonProperty(value = "itemPath", required = true) + private String itemPath; + + /* + * Flag to specify if the path is relative to backup item or full path + */ + @JsonProperty(value = "isPathRelativeToBackupItem", required = true) + private boolean isPathRelativeToBackupItem; + + /* + * The list of prefix strings to be used as filter criteria during restore. These are relative to the item path + * specified. + */ + @JsonProperty(value = "subItemPathPrefix") + private List subItemPathPrefix; + + /** Creates an instance of ItemPathBasedRestoreCriteria class. */ + public ItemPathBasedRestoreCriteria() { + } + + /** + * Get the itemPath property: The path of the item to be restored. It could be the full path of the item or the path + * relative to the backup item. + * + * @return the itemPath value. + */ + public String itemPath() { + return this.itemPath; + } + + /** + * Set the itemPath property: The path of the item to be restored. It could be the full path of the item or the path + * relative to the backup item. + * + * @param itemPath the itemPath value to set. + * @return the ItemPathBasedRestoreCriteria object itself. + */ + public ItemPathBasedRestoreCriteria withItemPath(String itemPath) { + this.itemPath = itemPath; + return this; + } + + /** + * Get the isPathRelativeToBackupItem property: Flag to specify if the path is relative to backup item or full path. + * + * @return the isPathRelativeToBackupItem value. + */ + public boolean isPathRelativeToBackupItem() { + return this.isPathRelativeToBackupItem; + } + + /** + * Set the isPathRelativeToBackupItem property: Flag to specify if the path is relative to backup item or full path. + * + * @param isPathRelativeToBackupItem the isPathRelativeToBackupItem value to set. + * @return the ItemPathBasedRestoreCriteria object itself. + */ + public ItemPathBasedRestoreCriteria withIsPathRelativeToBackupItem(boolean isPathRelativeToBackupItem) { + this.isPathRelativeToBackupItem = isPathRelativeToBackupItem; + return this; + } + + /** + * Get the subItemPathPrefix property: The list of prefix strings to be used as filter criteria during restore. + * These are relative to the item path specified. + * + * @return the subItemPathPrefix value. + */ + public List subItemPathPrefix() { + return this.subItemPathPrefix; + } + + /** + * Set the subItemPathPrefix property: The list of prefix strings to be used as filter criteria during restore. + * These are relative to the item path specified. + * + * @param subItemPathPrefix the subItemPathPrefix value to set. + * @return the ItemPathBasedRestoreCriteria object itself. + */ + public ItemPathBasedRestoreCriteria withSubItemPathPrefix(List subItemPathPrefix) { + this.subItemPathPrefix = subItemPathPrefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (itemPath() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property itemPath in model ItemPathBasedRestoreCriteria")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ItemPathBasedRestoreCriteria.class); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/JobExtendedInfo.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/JobExtendedInfo.java index 6951c58f4f27..e9b4659723c0 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/JobExtendedInfo.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/JobExtendedInfo.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.dataprotection.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.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -15,8 +13,6 @@ /** Extended Information about the job. */ @Fluent public final class JobExtendedInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(JobExtendedInfo.class); - /* * Job's Additional Details */ @@ -60,6 +56,10 @@ public final class JobExtendedInfo { @JsonProperty(value = "targetRecoverPoint", access = JsonProperty.Access.WRITE_ONLY) private RestoreJobRecoveryPointDetails targetRecoverPoint; + /** Creates an instance of JobExtendedInfo class. */ + public JobExtendedInfo() { + } + /** * Get the additionalDetails property: Job's Additional Details. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/JobSubTask.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/JobSubTask.java index 47b2a02310e9..6a8128edd244 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/JobSubTask.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/JobSubTask.java @@ -6,7 +6,6 @@ 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; @@ -14,8 +13,6 @@ /** Details of Job's Sub Task. */ @Fluent public final class JobSubTask { - @JsonIgnore private final ClientLogger logger = new ClientLogger(JobSubTask.class); - /* * Additional details of Sub Tasks */ @@ -47,6 +44,10 @@ public final class JobSubTask { @JsonProperty(value = "taskStatus", required = true) private String taskStatus; + /** Creates an instance of JobSubTask class. */ + public JobSubTask() { + } + /** * Get the additionalDetails property: Additional details of Sub Tasks. * @@ -143,14 +144,16 @@ public JobSubTask withTaskStatus(String taskStatus) { */ public void validate() { if (taskName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property taskName in model JobSubTask")); } if (taskStatus() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property taskStatus in model JobSubTask")); } } + + private static final ClientLogger LOGGER = new ClientLogger(JobSubTask.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Jobs.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Jobs.java index 4930b6a7c128..1aac8b23c906 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Jobs.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Jobs.java @@ -18,7 +18,7 @@ public interface Jobs { * @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 AzureBackup Job resources. + * @return list of AzureBackup Job resources as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String vaultName); @@ -31,7 +31,7 @@ public interface Jobs { * @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 AzureBackup Job resources. + * @return list of AzureBackup Job resources as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String vaultName, Context context); @@ -41,12 +41,14 @@ public interface Jobs { * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. * @param jobId The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + * @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 a job with id in a backup vault. + * @return a job with id in a backup vault along with {@link Response}. */ - AzureBackupJobResource get(String resourceGroupName, String vaultName, String jobId); + Response getWithResponse( + String resourceGroupName, String vaultName, String jobId, Context context); /** * Gets a job with id in a backup vault. @@ -54,12 +56,10 @@ public interface Jobs { * @param resourceGroupName The name of the resource group where the backup vault is present. * @param vaultName The name of the backup vault. * @param jobId The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * @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 a job with id in a backup vault. */ - Response getWithResponse( - String resourceGroupName, String vaultName, String jobId, Context context); + AzureBackupJobResource get(String resourceGroupName, String vaultName, String jobId); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesClusterBackupDatasourceParameters.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesClusterBackupDatasourceParameters.java new file mode 100644 index 000000000000..22e299e8e6cf --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesClusterBackupDatasourceParameters.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Parameters for Kubernetes Cluster Backup Datasource. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("KubernetesClusterBackupDatasourceParameters") +@Fluent +public final class KubernetesClusterBackupDatasourceParameters extends BackupDatasourceParameters { + /* + * Gets or sets the volume snapshot property. This property if enabled will take volume snapshots during restore. + */ + @JsonProperty(value = "snapshotVolumes", required = true) + private boolean snapshotVolumes; + + /* + * Gets or sets the include cluster resources property. This property if enabled will include cluster scope + * resources during restore. + */ + @JsonProperty(value = "includeClusterScopeResources", required = true) + private boolean includeClusterScopeResources; + + /* + * Gets or sets the include namespaces property. This property sets the namespaces to be included during restore. + */ + @JsonProperty(value = "includedNamespaces") + private List includedNamespaces; + + /* + * Gets or sets the exclude namespaces property. This property sets the namespaces to be excluded during restore. + */ + @JsonProperty(value = "excludedNamespaces") + private List excludedNamespaces; + + /* + * Gets or sets the include resource types property. This property sets the resource types to be included during + * restore. + */ + @JsonProperty(value = "includedResourceTypes") + private List includedResourceTypes; + + /* + * Gets or sets the exclude resource types property. This property sets the resource types to be excluded during + * restore. + */ + @JsonProperty(value = "excludedResourceTypes") + private List excludedResourceTypes; + + /* + * Gets or sets the LabelSelectors property. This property sets the resource with such label selectors to be + * included during restore. + */ + @JsonProperty(value = "labelSelectors") + private List labelSelectors; + + /** Creates an instance of KubernetesClusterBackupDatasourceParameters class. */ + public KubernetesClusterBackupDatasourceParameters() { + } + + /** + * Get the snapshotVolumes property: Gets or sets the volume snapshot property. This property if enabled will take + * volume snapshots during restore. + * + * @return the snapshotVolumes value. + */ + public boolean snapshotVolumes() { + return this.snapshotVolumes; + } + + /** + * Set the snapshotVolumes property: Gets or sets the volume snapshot property. This property if enabled will take + * volume snapshots during restore. + * + * @param snapshotVolumes the snapshotVolumes value to set. + * @return the KubernetesClusterBackupDatasourceParameters object itself. + */ + public KubernetesClusterBackupDatasourceParameters withSnapshotVolumes(boolean snapshotVolumes) { + this.snapshotVolumes = snapshotVolumes; + return this; + } + + /** + * Get the includeClusterScopeResources property: Gets or sets the include cluster resources property. This property + * if enabled will include cluster scope resources during restore. + * + * @return the includeClusterScopeResources value. + */ + public boolean includeClusterScopeResources() { + return this.includeClusterScopeResources; + } + + /** + * Set the includeClusterScopeResources property: Gets or sets the include cluster resources property. This property + * if enabled will include cluster scope resources during restore. + * + * @param includeClusterScopeResources the includeClusterScopeResources value to set. + * @return the KubernetesClusterBackupDatasourceParameters object itself. + */ + public KubernetesClusterBackupDatasourceParameters withIncludeClusterScopeResources( + boolean includeClusterScopeResources) { + this.includeClusterScopeResources = includeClusterScopeResources; + return this; + } + + /** + * Get the includedNamespaces property: Gets or sets the include namespaces property. This property sets the + * namespaces to be included during restore. + * + * @return the includedNamespaces value. + */ + public List includedNamespaces() { + return this.includedNamespaces; + } + + /** + * Set the includedNamespaces property: Gets or sets the include namespaces property. This property sets the + * namespaces to be included during restore. + * + * @param includedNamespaces the includedNamespaces value to set. + * @return the KubernetesClusterBackupDatasourceParameters object itself. + */ + public KubernetesClusterBackupDatasourceParameters withIncludedNamespaces(List includedNamespaces) { + this.includedNamespaces = includedNamespaces; + return this; + } + + /** + * Get the excludedNamespaces property: Gets or sets the exclude namespaces property. This property sets the + * namespaces to be excluded during restore. + * + * @return the excludedNamespaces value. + */ + public List excludedNamespaces() { + return this.excludedNamespaces; + } + + /** + * Set the excludedNamespaces property: Gets or sets the exclude namespaces property. This property sets the + * namespaces to be excluded during restore. + * + * @param excludedNamespaces the excludedNamespaces value to set. + * @return the KubernetesClusterBackupDatasourceParameters object itself. + */ + public KubernetesClusterBackupDatasourceParameters withExcludedNamespaces(List excludedNamespaces) { + this.excludedNamespaces = excludedNamespaces; + return this; + } + + /** + * Get the includedResourceTypes property: Gets or sets the include resource types property. This property sets the + * resource types to be included during restore. + * + * @return the includedResourceTypes value. + */ + public List includedResourceTypes() { + return this.includedResourceTypes; + } + + /** + * Set the includedResourceTypes property: Gets or sets the include resource types property. This property sets the + * resource types to be included during restore. + * + * @param includedResourceTypes the includedResourceTypes value to set. + * @return the KubernetesClusterBackupDatasourceParameters object itself. + */ + public KubernetesClusterBackupDatasourceParameters withIncludedResourceTypes(List includedResourceTypes) { + this.includedResourceTypes = includedResourceTypes; + return this; + } + + /** + * Get the excludedResourceTypes property: Gets or sets the exclude resource types property. This property sets the + * resource types to be excluded during restore. + * + * @return the excludedResourceTypes value. + */ + public List excludedResourceTypes() { + return this.excludedResourceTypes; + } + + /** + * Set the excludedResourceTypes property: Gets or sets the exclude resource types property. This property sets the + * resource types to be excluded during restore. + * + * @param excludedResourceTypes the excludedResourceTypes value to set. + * @return the KubernetesClusterBackupDatasourceParameters object itself. + */ + public KubernetesClusterBackupDatasourceParameters withExcludedResourceTypes(List excludedResourceTypes) { + this.excludedResourceTypes = excludedResourceTypes; + return this; + } + + /** + * Get the labelSelectors property: Gets or sets the LabelSelectors property. This property sets the resource with + * such label selectors to be included during restore. + * + * @return the labelSelectors value. + */ + public List labelSelectors() { + return this.labelSelectors; + } + + /** + * Set the labelSelectors property: Gets or sets the LabelSelectors property. This property sets the resource with + * such label selectors to be included during restore. + * + * @param labelSelectors the labelSelectors value to set. + * @return the KubernetesClusterBackupDatasourceParameters object itself. + */ + public KubernetesClusterBackupDatasourceParameters withLabelSelectors(List labelSelectors) { + this.labelSelectors = labelSelectors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesClusterRestoreCriteria.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesClusterRestoreCriteria.java new file mode 100644 index 000000000000..040964b262c9 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesClusterRestoreCriteria.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.annotation.Fluent; +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.util.List; +import java.util.Map; + +/** kubernetes Cluster Backup target info for restore operation. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("KubernetesClusterRestoreCriteria") +@Fluent +public final class KubernetesClusterRestoreCriteria extends ItemLevelRestoreCriteria { + /* + * Gets or sets the include cluster resources property. This property if enabled will include cluster scope + * resources during restore. + */ + @JsonProperty(value = "includeClusterScopeResources", required = true) + private boolean includeClusterScopeResources; + + /* + * Gets or sets the include namespaces property. This property sets the namespaces to be included during restore. + */ + @JsonProperty(value = "includedNamespaces") + private List includedNamespaces; + + /* + * Gets or sets the exclude namespaces property. This property sets the namespaces to be excluded during restore. + */ + @JsonProperty(value = "excludedNamespaces") + private List excludedNamespaces; + + /* + * Gets or sets the include resource types property. This property sets the resource types to be included during + * restore. + */ + @JsonProperty(value = "includedResourceTypes") + private List includedResourceTypes; + + /* + * Gets or sets the exclude resource types property. This property sets the resource types to be excluded during + * restore. + */ + @JsonProperty(value = "excludedResourceTypes") + private List excludedResourceTypes; + + /* + * Gets or sets the LabelSelectors property. This property sets the resource with such label selectors to be + * included during restore. + */ + @JsonProperty(value = "labelSelectors") + private List labelSelectors; + + /* + * Gets or sets the PV Restore Mode property. This property sets whether volumes needs to be restored. + */ + @JsonProperty(value = "persistentVolumeRestoreMode") + private PersistentVolumeRestoreMode persistentVolumeRestoreMode; + + /* + * Gets or sets the Conflict Policy property. This property sets policy during conflict of resources during + * restore. + */ + @JsonProperty(value = "conflictPolicy") + private ExistingResourcePolicy conflictPolicy; + + /* + * Gets or sets the Namespace Mappings property. This property sets if namespace needs to be change during restore. + */ + @JsonProperty(value = "namespaceMappings") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map namespaceMappings; + + /** Creates an instance of KubernetesClusterRestoreCriteria class. */ + public KubernetesClusterRestoreCriteria() { + } + + /** + * Get the includeClusterScopeResources property: Gets or sets the include cluster resources property. This property + * if enabled will include cluster scope resources during restore. + * + * @return the includeClusterScopeResources value. + */ + public boolean includeClusterScopeResources() { + return this.includeClusterScopeResources; + } + + /** + * Set the includeClusterScopeResources property: Gets or sets the include cluster resources property. This property + * if enabled will include cluster scope resources during restore. + * + * @param includeClusterScopeResources the includeClusterScopeResources value to set. + * @return the KubernetesClusterRestoreCriteria object itself. + */ + public KubernetesClusterRestoreCriteria withIncludeClusterScopeResources(boolean includeClusterScopeResources) { + this.includeClusterScopeResources = includeClusterScopeResources; + return this; + } + + /** + * Get the includedNamespaces property: Gets or sets the include namespaces property. This property sets the + * namespaces to be included during restore. + * + * @return the includedNamespaces value. + */ + public List includedNamespaces() { + return this.includedNamespaces; + } + + /** + * Set the includedNamespaces property: Gets or sets the include namespaces property. This property sets the + * namespaces to be included during restore. + * + * @param includedNamespaces the includedNamespaces value to set. + * @return the KubernetesClusterRestoreCriteria object itself. + */ + public KubernetesClusterRestoreCriteria withIncludedNamespaces(List includedNamespaces) { + this.includedNamespaces = includedNamespaces; + return this; + } + + /** + * Get the excludedNamespaces property: Gets or sets the exclude namespaces property. This property sets the + * namespaces to be excluded during restore. + * + * @return the excludedNamespaces value. + */ + public List excludedNamespaces() { + return this.excludedNamespaces; + } + + /** + * Set the excludedNamespaces property: Gets or sets the exclude namespaces property. This property sets the + * namespaces to be excluded during restore. + * + * @param excludedNamespaces the excludedNamespaces value to set. + * @return the KubernetesClusterRestoreCriteria object itself. + */ + public KubernetesClusterRestoreCriteria withExcludedNamespaces(List excludedNamespaces) { + this.excludedNamespaces = excludedNamespaces; + return this; + } + + /** + * Get the includedResourceTypes property: Gets or sets the include resource types property. This property sets the + * resource types to be included during restore. + * + * @return the includedResourceTypes value. + */ + public List includedResourceTypes() { + return this.includedResourceTypes; + } + + /** + * Set the includedResourceTypes property: Gets or sets the include resource types property. This property sets the + * resource types to be included during restore. + * + * @param includedResourceTypes the includedResourceTypes value to set. + * @return the KubernetesClusterRestoreCriteria object itself. + */ + public KubernetesClusterRestoreCriteria withIncludedResourceTypes(List includedResourceTypes) { + this.includedResourceTypes = includedResourceTypes; + return this; + } + + /** + * Get the excludedResourceTypes property: Gets or sets the exclude resource types property. This property sets the + * resource types to be excluded during restore. + * + * @return the excludedResourceTypes value. + */ + public List excludedResourceTypes() { + return this.excludedResourceTypes; + } + + /** + * Set the excludedResourceTypes property: Gets or sets the exclude resource types property. This property sets the + * resource types to be excluded during restore. + * + * @param excludedResourceTypes the excludedResourceTypes value to set. + * @return the KubernetesClusterRestoreCriteria object itself. + */ + public KubernetesClusterRestoreCriteria withExcludedResourceTypes(List excludedResourceTypes) { + this.excludedResourceTypes = excludedResourceTypes; + return this; + } + + /** + * Get the labelSelectors property: Gets or sets the LabelSelectors property. This property sets the resource with + * such label selectors to be included during restore. + * + * @return the labelSelectors value. + */ + public List labelSelectors() { + return this.labelSelectors; + } + + /** + * Set the labelSelectors property: Gets or sets the LabelSelectors property. This property sets the resource with + * such label selectors to be included during restore. + * + * @param labelSelectors the labelSelectors value to set. + * @return the KubernetesClusterRestoreCriteria object itself. + */ + public KubernetesClusterRestoreCriteria withLabelSelectors(List labelSelectors) { + this.labelSelectors = labelSelectors; + return this; + } + + /** + * Get the persistentVolumeRestoreMode property: Gets or sets the PV Restore Mode property. This property sets + * whether volumes needs to be restored. + * + * @return the persistentVolumeRestoreMode value. + */ + public PersistentVolumeRestoreMode persistentVolumeRestoreMode() { + return this.persistentVolumeRestoreMode; + } + + /** + * Set the persistentVolumeRestoreMode property: Gets or sets the PV Restore Mode property. This property sets + * whether volumes needs to be restored. + * + * @param persistentVolumeRestoreMode the persistentVolumeRestoreMode value to set. + * @return the KubernetesClusterRestoreCriteria object itself. + */ + public KubernetesClusterRestoreCriteria withPersistentVolumeRestoreMode( + PersistentVolumeRestoreMode persistentVolumeRestoreMode) { + this.persistentVolumeRestoreMode = persistentVolumeRestoreMode; + return this; + } + + /** + * Get the conflictPolicy property: Gets or sets the Conflict Policy property. This property sets policy during + * conflict of resources during restore. + * + * @return the conflictPolicy value. + */ + public ExistingResourcePolicy conflictPolicy() { + return this.conflictPolicy; + } + + /** + * Set the conflictPolicy property: Gets or sets the Conflict Policy property. This property sets policy during + * conflict of resources during restore. + * + * @param conflictPolicy the conflictPolicy value to set. + * @return the KubernetesClusterRestoreCriteria object itself. + */ + public KubernetesClusterRestoreCriteria withConflictPolicy(ExistingResourcePolicy conflictPolicy) { + this.conflictPolicy = conflictPolicy; + return this; + } + + /** + * Get the namespaceMappings property: Gets or sets the Namespace Mappings property. This property sets if namespace + * needs to be change during restore. + * + * @return the namespaceMappings value. + */ + public Map namespaceMappings() { + return this.namespaceMappings; + } + + /** + * Set the namespaceMappings property: Gets or sets the Namespace Mappings property. This property sets if namespace + * needs to be change during restore. + * + * @param namespaceMappings the namespaceMappings value to set. + * @return the KubernetesClusterRestoreCriteria object itself. + */ + public KubernetesClusterRestoreCriteria withNamespaceMappings(Map namespaceMappings) { + this.namespaceMappings = namespaceMappings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesPVRestoreCriteria.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesPVRestoreCriteria.java new file mode 100644 index 000000000000..954476a6d6b8 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesPVRestoreCriteria.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Item Level kubernetes persistent volume target info for restore operation. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("KubernetesPVRestoreCriteria") +@Fluent +public final class KubernetesPVRestoreCriteria extends ItemLevelRestoreCriteria { + /* + * Selected persistent volume claim name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Selected storage class name for restore operation + */ + @JsonProperty(value = "storageClassName") + private String storageClassName; + + /** Creates an instance of KubernetesPVRestoreCriteria class. */ + public KubernetesPVRestoreCriteria() { + } + + /** + * Get the name property: Selected persistent volume claim name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Selected persistent volume claim name. + * + * @param name the name value to set. + * @return the KubernetesPVRestoreCriteria object itself. + */ + public KubernetesPVRestoreCriteria withName(String name) { + this.name = name; + return this; + } + + /** + * Get the storageClassName property: Selected storage class name for restore operation. + * + * @return the storageClassName value. + */ + public String storageClassName() { + return this.storageClassName; + } + + /** + * Set the storageClassName property: Selected storage class name for restore operation. + * + * @param storageClassName the storageClassName value to set. + * @return the KubernetesPVRestoreCriteria object itself. + */ + public KubernetesPVRestoreCriteria withStorageClassName(String storageClassName) { + this.storageClassName = storageClassName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesStorageClassRestoreCriteria.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesStorageClassRestoreCriteria.java new file mode 100644 index 000000000000..10853595058c --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/KubernetesStorageClassRestoreCriteria.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Item Level kubernetes storage class target info for restore operation. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("KubernetesStorageClassRestoreCriteria") +@Fluent +public final class KubernetesStorageClassRestoreCriteria extends ItemLevelRestoreCriteria { + /* + * Selected storage class name + */ + @JsonProperty(value = "selectedStorageClassName") + private String selectedStorageClassName; + + /* + * Provisioner of the storage class + */ + @JsonProperty(value = "provisioner") + private String provisioner; + + /** Creates an instance of KubernetesStorageClassRestoreCriteria class. */ + public KubernetesStorageClassRestoreCriteria() { + } + + /** + * Get the selectedStorageClassName property: Selected storage class name. + * + * @return the selectedStorageClassName value. + */ + public String selectedStorageClassName() { + return this.selectedStorageClassName; + } + + /** + * Set the selectedStorageClassName property: Selected storage class name. + * + * @param selectedStorageClassName the selectedStorageClassName value to set. + * @return the KubernetesStorageClassRestoreCriteria object itself. + */ + public KubernetesStorageClassRestoreCriteria withSelectedStorageClassName(String selectedStorageClassName) { + this.selectedStorageClassName = selectedStorageClassName; + return this; + } + + /** + * Get the provisioner property: Provisioner of the storage class. + * + * @return the provisioner value. + */ + public String provisioner() { + return this.provisioner; + } + + /** + * Set the provisioner property: Provisioner of the storage class. + * + * @param provisioner the provisioner value to set. + * @return the KubernetesStorageClassRestoreCriteria object itself. + */ + public KubernetesStorageClassRestoreCriteria withProvisioner(String provisioner) { + this.provisioner = provisioner; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/MonitoringSettings.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/MonitoringSettings.java new file mode 100644 index 000000000000..6aadbff1f949 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/MonitoringSettings.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Monitoring Settings. */ +@Fluent +public final class MonitoringSettings { + /* + * Settings for Azure Monitor based alerts + */ + @JsonProperty(value = "azureMonitorAlertSettings") + private AzureMonitorAlertSettings azureMonitorAlertSettings; + + /** Creates an instance of MonitoringSettings class. */ + public MonitoringSettings() { + } + + /** + * Get the azureMonitorAlertSettings property: Settings for Azure Monitor based alerts. + * + * @return the azureMonitorAlertSettings value. + */ + public AzureMonitorAlertSettings azureMonitorAlertSettings() { + return this.azureMonitorAlertSettings; + } + + /** + * Set the azureMonitorAlertSettings property: Settings for Azure Monitor based alerts. + * + * @param azureMonitorAlertSettings the azureMonitorAlertSettings value to set. + * @return the MonitoringSettings object itself. + */ + public MonitoringSettings withAzureMonitorAlertSettings(AzureMonitorAlertSettings azureMonitorAlertSettings) { + this.azureMonitorAlertSettings = azureMonitorAlertSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureMonitorAlertSettings() != null) { + azureMonitorAlertSettings().validate(); + } + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Month.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Month.java index e75f62ad67ce..f776495a583f 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Month.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Month.java @@ -57,7 +57,11 @@ public static Month fromString(String name) { return fromString(name, Month.class); } - /** @return known Month values. */ + /** + * Gets known Month values. + * + * @return known Month values. + */ public static Collection values() { return values(Month.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationExtendedInfo.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationExtendedInfo.java index a12250e14493..79837086e970 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationExtendedInfo.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationExtendedInfo.java @@ -5,14 +5,16 @@ package com.azure.resourcemanager.dataprotection.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.fluent.models.OperationJobExtendedInfoInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** OperationExtendedInfo Operation Extended Info. */ +/** + * OperationExtendedInfo + * + *

Operation Extended Info. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -22,7 +24,9 @@ @JsonSubTypes({@JsonSubTypes.Type(name = "OperationJobExtendedInfo", value = OperationJobExtendedInfoInner.class)}) @Immutable public class OperationExtendedInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationExtendedInfo.class); + /** Creates an instance of OperationExtendedInfo class. */ + public OperationExtendedInfo() { + } /** * Validates the instance. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResource.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResource.java index 33ccfceeb9a8..c85341454b51 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResource.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResource.java @@ -42,7 +42,9 @@ public interface OperationResource { String name(); /** - * Gets the properties property: OperationExtendedInfo End time of the operation. + * Gets the properties property: OperationExtendedInfo + * + *

End time of the operation. * * @return the properties value. */ diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResults.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResults.java index 023983ffb0bb..9a17691f138d 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResults.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResults.java @@ -10,27 +10,31 @@ /** Resource collection API of OperationResults. */ public interface OperationResults { /** - * Gets the operation result for a resource. + * Gets the operation status for a resource. + * + *

Gets the operation result for a resource. * * @param operationId The operationId parameter. * @param location The location 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 operation result for a resource. */ - OperationJobExtendedInfo get(String operationId, String location); + Response getWithResponse(String operationId, String location, Context context); /** - * Gets the operation result for a resource. + * Gets the operation status for a resource. + * + *

Gets the operation result for a resource. * * @param operationId The operationId parameter. * @param location The location 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 operation result for a resource. */ - Response getWithResponse(String operationId, String location, Context context); + OperationJobExtendedInfo get(String operationId, String location); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResultsGetHeaders.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResultsGetHeaders.java index 0aeb9e443e1f..4d5f30fe1499 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResultsGetHeaders.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResultsGetHeaders.java @@ -5,15 +5,13 @@ package com.azure.resourcemanager.dataprotection.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; import com.fasterxml.jackson.annotation.JsonProperty; /** The OperationResultsGetHeaders model. */ @Fluent public final class OperationResultsGetHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResultsGetHeaders.class); - /* * The Retry-After property. */ @@ -32,6 +30,23 @@ public final class OperationResultsGetHeaders { @JsonProperty(value = "Location") private String location; + private static final HttpHeaderName AZURE_ASYNC_OPERATION = HttpHeaderName.fromString("Azure-AsyncOperation"); + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of OperationResultsGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public OperationResultsGetHeaders(HttpHeaders rawHeaders) { + String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER); + if (retryAfter != null) { + this.retryAfter = Integer.parseInt(retryAfter); + } + this.azureAsyncOperation = rawHeaders.getValue(AZURE_ASYNC_OPERATION); + this.location = rawHeaders.getValue(HttpHeaderName.LOCATION); + } + /** * Get the retryAfter property: The Retry-After property. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResultsGetResponse.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResultsGetResponse.java index d09babcf5deb..b07a9699bfdc 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResultsGetResponse.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationResultsGetResponse.java @@ -30,7 +30,11 @@ public OperationResultsGetResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public OperationJobExtendedInfoInner getValue() { return super.getValue(); diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationStatus.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationStatus.java index 27b357f339fb..4c353155a084 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationStatus.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationStatus.java @@ -14,23 +14,23 @@ public interface OperationStatus { * * @param location The location parameter. * @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 operation status for a resource. + * @return the operation status for a resource along with {@link Response}. */ - OperationResource get(String location, String operationId); + Response getWithResponse(String location, String operationId, Context context); /** * Gets the operation status for a resource. * * @param location The location parameter. * @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 operation status for a resource. */ - Response getWithResponse(String location, String operationId, Context context); + OperationResource get(String location, String operationId); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationStatusBackupVaultContexts.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationStatusBackupVaultContexts.java new file mode 100644 index 000000000000..183946a66627 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationStatusBackupVaultContexts.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.dataprotection.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of OperationStatusBackupVaultContexts. */ +public interface OperationStatusBackupVaultContexts { + /** + * Gets the operation status for an operation over a BackupVault's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 operation status for an operation over a BackupVault's context along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context); + + /** + * Gets the operation status for an operation over a BackupVault's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @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 the operation status for an operation over a BackupVault's context. + */ + OperationResource get(String resourceGroupName, String vaultName, String operationId); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationStatusResourceGroupContexts.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationStatusResourceGroupContexts.java new file mode 100644 index 000000000000..d5007c83b626 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/OperationStatusResourceGroupContexts.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.dataprotection.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of OperationStatusResourceGroupContexts. */ +public interface OperationStatusResourceGroupContexts { + /** + * Gets the operation status for an operation over a ResourceGroup's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @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 operation status for an operation over a ResourceGroup's context along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String operationId, Context context); + + /** + * Gets the operation status for an operation over a ResourceGroup's context. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @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 the operation status for an operation over a ResourceGroup's context. + */ + OperationResource getByResourceGroup(String resourceGroupName, String operationId); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PatchBackupVaultInput.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PatchBackupVaultInput.java new file mode 100644 index 000000000000..49637952b6c7 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PatchBackupVaultInput.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Backup Vault Contract for Patch Backup Vault API. */ +@Fluent +public final class PatchBackupVaultInput { + /* + * Monitoring Settings + */ + @JsonProperty(value = "monitoringSettings") + private MonitoringSettings monitoringSettings; + + /* + * Security Settings + */ + @JsonProperty(value = "securitySettings") + private SecuritySettings securitySettings; + + /** Creates an instance of PatchBackupVaultInput class. */ + public PatchBackupVaultInput() { + } + + /** + * Get the monitoringSettings property: Monitoring Settings. + * + * @return the monitoringSettings value. + */ + public MonitoringSettings monitoringSettings() { + return this.monitoringSettings; + } + + /** + * Set the monitoringSettings property: Monitoring Settings. + * + * @param monitoringSettings the monitoringSettings value to set. + * @return the PatchBackupVaultInput object itself. + */ + public PatchBackupVaultInput withMonitoringSettings(MonitoringSettings monitoringSettings) { + this.monitoringSettings = monitoringSettings; + return this; + } + + /** + * Get the securitySettings property: Security Settings. + * + * @return the securitySettings value. + */ + public SecuritySettings securitySettings() { + return this.securitySettings; + } + + /** + * Set the securitySettings property: Security Settings. + * + * @param securitySettings the securitySettings value to set. + * @return the PatchBackupVaultInput object itself. + */ + public PatchBackupVaultInput withSecuritySettings(SecuritySettings securitySettings) { + this.securitySettings = securitySettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (monitoringSettings() != null) { + monitoringSettings().validate(); + } + if (securitySettings() != null) { + securitySettings().validate(); + } + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PatchResourceRequestInput.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PatchResourceRequestInput.java index 99679b28ebc5..b77419e1e08e 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PatchResourceRequestInput.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PatchResourceRequestInput.java @@ -5,23 +5,31 @@ package com.azure.resourcemanager.dataprotection.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.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** PatchResourceRequestInput Patch Request content for Microsoft.DataProtection resources. */ +/** + * PatchResourceRequestInput + * + *

Patch Request content for Microsoft.DataProtection resources. + */ @Fluent public final class PatchResourceRequestInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PatchResourceRequestInput.class); - /* - * DppIdentityDetails Input Managed Identity Details + * DppIdentityDetails + * + * Input Managed Identity Details */ @JsonProperty(value = "identity") private DppIdentityDetails identity; + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PatchBackupVaultInput properties; + /* * Resource tags. */ @@ -29,8 +37,14 @@ public final class PatchResourceRequestInput { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of PatchResourceRequestInput class. */ + public PatchResourceRequestInput() { + } + /** - * Get the identity property: DppIdentityDetails Input Managed Identity Details. + * Get the identity property: DppIdentityDetails + * + *

Input Managed Identity Details. * * @return the identity value. */ @@ -39,7 +53,9 @@ public DppIdentityDetails identity() { } /** - * Set the identity property: DppIdentityDetails Input Managed Identity Details. + * Set the identity property: DppIdentityDetails + * + *

Input Managed Identity Details. * * @param identity the identity value to set. * @return the PatchResourceRequestInput object itself. @@ -49,6 +65,26 @@ public PatchResourceRequestInput withIdentity(DppIdentityDetails identity) { return this; } + /** + * Get the properties property: Resource properties. + * + * @return the properties value. + */ + public PatchBackupVaultInput properties() { + return this.properties; + } + + /** + * Set the properties property: Resource properties. + * + * @param properties the properties value to set. + * @return the PatchResourceRequestInput object itself. + */ + public PatchResourceRequestInput withProperties(PatchBackupVaultInput properties) { + this.properties = properties; + return this; + } + /** * Get the tags property: Resource tags. * @@ -78,5 +114,8 @@ public void validate() { if (identity() != null) { identity().validate(); } + if (properties() != null) { + properties().validate(); + } } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PersistentVolumeRestoreMode.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PersistentVolumeRestoreMode.java new file mode 100644 index 000000000000..7db8dc36182c --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PersistentVolumeRestoreMode.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.dataprotection.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the PV Restore Mode property. This property sets whether volumes needs to be restored. */ +public final class PersistentVolumeRestoreMode extends ExpandableStringEnum { + /** Static value RestoreWithVolumeData for PersistentVolumeRestoreMode. */ + public static final PersistentVolumeRestoreMode RESTORE_WITH_VOLUME_DATA = fromString("RestoreWithVolumeData"); + + /** Static value RestoreWithoutVolumeData for PersistentVolumeRestoreMode. */ + public static final PersistentVolumeRestoreMode RESTORE_WITHOUT_VOLUME_DATA = + fromString("RestoreWithoutVolumeData"); + + /** + * Creates or finds a PersistentVolumeRestoreMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding PersistentVolumeRestoreMode. + */ + @JsonCreator + public static PersistentVolumeRestoreMode fromString(String name) { + return fromString(name, PersistentVolumeRestoreMode.class); + } + + /** + * Gets known PersistentVolumeRestoreMode values. + * + * @return known PersistentVolumeRestoreMode values. + */ + public static Collection values() { + return values(PersistentVolumeRestoreMode.class); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PolicyInfo.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PolicyInfo.java index 92413bd9cdb5..6e0493346665 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PolicyInfo.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PolicyInfo.java @@ -6,14 +6,15 @@ 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; -/** PolicyInfo Policy Info in backupInstance. */ +/** + * PolicyInfo + * + *

Policy Info in backupInstance. + */ @Fluent public final class PolicyInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyInfo.class); - /* * The policyId property. */ @@ -32,6 +33,10 @@ public final class PolicyInfo { @JsonProperty(value = "policyParameters") private PolicyParameters policyParameters; + /** Creates an instance of PolicyInfo class. */ + public PolicyInfo() { + } + /** * Get the policyId property: The policyId property. * @@ -88,7 +93,7 @@ public PolicyInfo withPolicyParameters(PolicyParameters policyParameters) { */ public void validate() { if (policyId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property policyId in model PolicyInfo")); } @@ -96,4 +101,6 @@ public void validate() { policyParameters().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(PolicyInfo.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PolicyParameters.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PolicyParameters.java index 01397badec25..a621f0162ea6 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PolicyParameters.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/PolicyParameters.java @@ -5,22 +5,28 @@ package com.azure.resourcemanager.dataprotection.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; /** Parameters in Policy. */ @Fluent public final class PolicyParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyParameters.class); - /* * Gets or sets the DataStore Parameters */ @JsonProperty(value = "dataStoreParametersList") private List dataStoreParametersList; + /* + * Gets or sets the Backup Data Source Parameters + */ + @JsonProperty(value = "backupDatasourceParametersList") + private List backupDatasourceParametersList; + + /** Creates an instance of PolicyParameters class. */ + public PolicyParameters() { + } + /** * Get the dataStoreParametersList property: Gets or sets the DataStore Parameters. * @@ -41,6 +47,27 @@ public PolicyParameters withDataStoreParametersList(List da return this; } + /** + * Get the backupDatasourceParametersList property: Gets or sets the Backup Data Source Parameters. + * + * @return the backupDatasourceParametersList value. + */ + public List backupDatasourceParametersList() { + return this.backupDatasourceParametersList; + } + + /** + * Set the backupDatasourceParametersList property: Gets or sets the Backup Data Source Parameters. + * + * @param backupDatasourceParametersList the backupDatasourceParametersList value to set. + * @return the PolicyParameters object itself. + */ + public PolicyParameters withBackupDatasourceParametersList( + List backupDatasourceParametersList) { + this.backupDatasourceParametersList = backupDatasourceParametersList; + return this; + } + /** * Validates the instance. * @@ -50,5 +77,8 @@ public void validate() { if (dataStoreParametersList() != null) { dataStoreParametersList().forEach(e -> e.validate()); } + if (backupDatasourceParametersList() != null) { + backupDatasourceParametersList().forEach(e -> e.validate()); + } } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ProtectionStatusDetails.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ProtectionStatusDetails.java index 8c2b9636df6a..91f923810240 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ProtectionStatusDetails.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ProtectionStatusDetails.java @@ -5,15 +5,15 @@ package com.azure.resourcemanager.dataprotection.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; -/** ProtectionStatusDetails Protection status details. */ +/** + * ProtectionStatusDetails + * + *

Protection status details. + */ @Fluent public final class ProtectionStatusDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionStatusDetails.class); - /* * Specifies the protection status error of the resource */ @@ -26,6 +26,10 @@ public final class ProtectionStatusDetails { @JsonProperty(value = "status") private Status status; + /** Creates an instance of ProtectionStatusDetails class. */ + public ProtectionStatusDetails() { + } + /** * Get the errorDetails property: Specifies the protection status error of the resource. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ProvisioningState.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ProvisioningState.java index f8ff78a79110..0ff30c518f54 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ProvisioningState.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ProvisioningState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ProvisioningState. */ +/** Provisioning state of the BackupVault resource. */ public final class ProvisioningState extends ExpandableStringEnum { /** Static value Failed for ProvisioningState. */ public static final ProvisioningState FAILED = fromString("Failed"); @@ -36,7 +36,11 @@ public static ProvisioningState fromString(String name) { return fromString(name, ProvisioningState.class); } - /** @return known ProvisioningState values. */ + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ public static Collection values() { return values(ProvisioningState.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RangeBasedItemLevelRestoreCriteria.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RangeBasedItemLevelRestoreCriteria.java index bee5a2b725c7..20cc4ff6c47d 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RangeBasedItemLevelRestoreCriteria.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RangeBasedItemLevelRestoreCriteria.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.dataprotection.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; @@ -16,8 +14,6 @@ @JsonTypeName("RangeBasedItemLevelRestoreCriteria") @Fluent public final class RangeBasedItemLevelRestoreCriteria extends ItemLevelRestoreCriteria { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RangeBasedItemLevelRestoreCriteria.class); - /* * minimum value for range prefix match */ @@ -30,6 +26,10 @@ public final class RangeBasedItemLevelRestoreCriteria extends ItemLevelRestoreCr @JsonProperty(value = "maxMatchingValue") private String maxMatchingValue; + /** Creates an instance of RangeBasedItemLevelRestoreCriteria class. */ + public RangeBasedItemLevelRestoreCriteria() { + } + /** * Get the minMatchingValue property: minimum value for range prefix match. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RecoveryOption.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RecoveryOption.java index 962afd9bdd39..b39977eae461 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RecoveryOption.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RecoveryOption.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RecoveryOption. */ +/** Recovery Option. */ public final class RecoveryOption extends ExpandableStringEnum { /** Static value FailIfExists for RecoveryOption. */ public static final RecoveryOption FAIL_IF_EXISTS = fromString("FailIfExists"); @@ -24,7 +24,11 @@ public static RecoveryOption fromString(String name) { return fromString(name, RecoveryOption.class); } - /** @return known RecoveryOption values. */ + /** + * Gets known RecoveryOption values. + * + * @return known RecoveryOption values. + */ public static Collection values() { return values(RecoveryOption.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RecoveryPointDataStoreDetails.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RecoveryPointDataStoreDetails.java index 6ea4362d6f70..4501779d907b 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RecoveryPointDataStoreDetails.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RecoveryPointDataStoreDetails.java @@ -5,16 +5,16 @@ package com.azure.resourcemanager.dataprotection.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.time.OffsetDateTime; -/** RecoveryPointDataStoreDetails RecoveryPoint datastore details. */ +/** + * RecoveryPointDataStoreDetails + * + *

RecoveryPoint datastore details. + */ @Fluent public final class RecoveryPointDataStoreDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointDataStoreDetails.class); - /* * The creationTime property. */ @@ -69,6 +69,10 @@ public final class RecoveryPointDataStoreDetails { @JsonProperty(value = "rehydrationStatus", access = JsonProperty.Access.WRITE_ONLY) private RehydrationStatus rehydrationStatus; + /** Creates an instance of RecoveryPointDataStoreDetails class. */ + public RecoveryPointDataStoreDetails() { + } + /** * Get the creationTime property: The creationTime property. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RecoveryPoints.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RecoveryPoints.java index 9c93a4fb18a4..d15a04d7be05 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RecoveryPoints.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RecoveryPoints.java @@ -13,22 +13,22 @@ public interface RecoveryPoints { /** * Returns a list of Recovery Points for a DataSource in a vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 azureBackupRecoveryPointResourceList. + * @return azureBackupRecoveryPointResourceList as paginated response with {@link PagedIterable}. */ PagedIterable list( - String vaultName, String resourceGroupName, String backupInstanceName); + String resourceGroupName, String vaultName, String backupInstanceName); /** * Returns a list of Recovery Points for a DataSource in a vault. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param filter OData filter options. * @param skipToken skipToken Filter. @@ -36,11 +36,11 @@ PagedIterable list( * @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 azureBackupRecoveryPointResourceList. + * @return azureBackupRecoveryPointResourceList as paginated response with {@link PagedIterable}. */ PagedIterable list( - String vaultName, String resourceGroupName, + String vaultName, String backupInstanceName, String filter, String skipToken, @@ -49,31 +49,31 @@ PagedIterable list( /** * Gets a Recovery Point using recoveryPointId for a Datasource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param recoveryPointId The recoveryPointId 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 a Recovery Point using recoveryPointId for a Datasource. + * @return a Recovery Point using recoveryPointId for a Datasource along with {@link Response}. */ - AzureBackupRecoveryPointResource get( - String vaultName, String resourceGroupName, String backupInstanceName, String recoveryPointId); + Response getWithResponse( + String resourceGroupName, String vaultName, String backupInstanceName, String recoveryPointId, Context context); /** * Gets a Recovery Point using recoveryPointId for a Datasource. * - * @param vaultName The name of the backup vault. * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @param recoveryPointId The recoveryPointId 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 a Recovery Point using recoveryPointId for a Datasource. */ - Response getWithResponse( - String vaultName, String resourceGroupName, String backupInstanceName, String recoveryPointId, Context context); + AzureBackupRecoveryPointResource get( + String resourceGroupName, String vaultName, String backupInstanceName, String recoveryPointId); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RehydrationPriority.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RehydrationPriority.java index 633d5d32e529..fa9cf2033d67 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RehydrationPriority.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RehydrationPriority.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RehydrationPriority. */ +/** Priority to be used for rehydration. Values High or Standard. */ public final class RehydrationPriority extends ExpandableStringEnum { /** Static value Invalid for RehydrationPriority. */ public static final RehydrationPriority INVALID = fromString("Invalid"); @@ -30,7 +30,11 @@ public static RehydrationPriority fromString(String name) { return fromString(name, RehydrationPriority.class); } - /** @return known RehydrationPriority values. */ + /** + * Gets known RehydrationPriority values. + * + * @return known RehydrationPriority values. + */ public static Collection values() { return values(RehydrationPriority.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RehydrationStatus.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RehydrationStatus.java index 7091edbaca73..b4f1795fc743 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RehydrationStatus.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RehydrationStatus.java @@ -36,7 +36,11 @@ public static RehydrationStatus fromString(String name) { return fromString(name, RehydrationStatus.class); } - /** @return known RehydrationStatus values. */ + /** + * Gets known RehydrationStatus values. + * + * @return known RehydrationStatus values. + */ public static Collection values() { return values(RehydrationStatus.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuard.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuard.java index ecca368885d5..78f605068d36 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuard.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuard.java @@ -4,22 +4,18 @@ package com.azure.resourcemanager.dataprotection.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The ResourceGuard model. */ -@Immutable +@Fluent public final class ResourceGuard { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGuard.class); - /* * Provisioning state of the BackupVault resource */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; + private ResourceGuardProvisioningState provisioningState; /* * This flag indicates whether auto approval is allowed or not. @@ -28,32 +24,33 @@ public final class ResourceGuard { private Boolean allowAutoApprovals; /* - * {readonly} List of operation details those are protected by the - * ResourceGuard resource + * {readonly} List of operation details those are protected by the ResourceGuard resource */ @JsonProperty(value = "resourceGuardOperations", access = JsonProperty.Access.WRITE_ONLY) private List resourceGuardOperations; /* - * List of critical operations which are not protected by this - * resourceGuard + * List of critical operations which are not protected by this resourceGuard */ - @JsonProperty(value = "vaultCriticalOperationExclusionList", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "vaultCriticalOperationExclusionList") private List vaultCriticalOperationExclusionList; /* - * Description about the pre-req steps to perform all the critical - * operations. + * Description about the pre-req steps to perform all the critical operations. */ @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; + /** Creates an instance of ResourceGuard class. */ + public ResourceGuard() { + } + /** * Get the provisioningState property: Provisioning state of the BackupVault resource. * * @return the provisioningState value. */ - public ProvisioningState provisioningState() { + public ResourceGuardProvisioningState provisioningState() { return this.provisioningState; } @@ -86,6 +83,18 @@ public List vaultCriticalOperationExclusionList() { return this.vaultCriticalOperationExclusionList; } + /** + * Set the vaultCriticalOperationExclusionList property: List of critical operations which are not protected by this + * resourceGuard. + * + * @param vaultCriticalOperationExclusionList the vaultCriticalOperationExclusionList value to set. + * @return the ResourceGuard object itself. + */ + public ResourceGuard withVaultCriticalOperationExclusionList(List vaultCriticalOperationExclusionList) { + this.vaultCriticalOperationExclusionList = vaultCriticalOperationExclusionList; + return this; + } + /** * Get the description property: Description about the pre-req steps to perform all the critical operations. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardOperation.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardOperation.java index 616a884ae1dd..1ebe997b113c 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardOperation.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardOperation.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.dataprotection.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; /** This class contains all the details about a critical operation. */ @Immutable public final class ResourceGuardOperation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGuardOperation.class); - /* * Name of the critical operation. */ @@ -26,6 +22,10 @@ public final class ResourceGuardOperation { @JsonProperty(value = "requestResourceType", access = JsonProperty.Access.WRITE_ONLY) private String requestResourceType; + /** Creates an instance of ResourceGuardOperation class. */ + public ResourceGuardOperation() { + } + /** * Get the vaultCriticalOperation property: Name of the critical operation. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardOperationDetail.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardOperationDetail.java new file mode 100644 index 000000000000..5f35ddf708d3 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/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.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourceGuardOperationDetail model. */ +@Fluent +public final class ResourceGuardOperationDetail { + /* + * The vaultCriticalOperation property. + */ + @JsonProperty(value = "vaultCriticalOperation") + private String vaultCriticalOperation; + + /* + * The defaultResourceRequest property. + */ + @JsonProperty(value = "defaultResourceRequest") + private String defaultResourceRequest; + + /** Creates an instance of ResourceGuardOperationDetail class. */ + public ResourceGuardOperationDetail() { + } + + /** + * 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/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProvisioningState.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProvisioningState.java new file mode 100644 index 000000000000..194477b7caf1 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProvisioningState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the BackupVault resource. */ +public final class ResourceGuardProvisioningState extends ExpandableStringEnum { + /** Static value Failed for ResourceGuardProvisioningState. */ + public static final ResourceGuardProvisioningState FAILED = fromString("Failed"); + + /** Static value Provisioning for ResourceGuardProvisioningState. */ + public static final ResourceGuardProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Succeeded for ResourceGuardProvisioningState. */ + public static final ResourceGuardProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Unknown for ResourceGuardProvisioningState. */ + public static final ResourceGuardProvisioningState UNKNOWN = fromString("Unknown"); + + /** Static value Updating for ResourceGuardProvisioningState. */ + public static final ResourceGuardProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a ResourceGuardProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceGuardProvisioningState. + */ + @JsonCreator + public static ResourceGuardProvisioningState fromString(String name) { + return fromString(name, ResourceGuardProvisioningState.class); + } + + /** + * Gets known ResourceGuardProvisioningState values. + * + * @return known ResourceGuardProvisioningState values. + */ + public static Collection values() { + return values(ResourceGuardProvisioningState.class); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProxyBase.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProxyBase.java new file mode 100644 index 000000000000..5364b92540f8 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/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.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceGuardProxyBase model. */ +@Fluent +public final class ResourceGuardProxyBase { + /* + * 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; + + /** Creates an instance of ResourceGuardProxyBase class. */ + public ResourceGuardProxyBase() { + } + + /** + * 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/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProxyBaseResource.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProxyBaseResource.java new file mode 100644 index 000000000000..ecb2aaec296c --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProxyBaseResource.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dataprotection.fluent.models.ResourceGuardProxyBaseResourceInner; + +/** An immutable client-side representation of ResourceGuardProxyBaseResource. */ +public interface ResourceGuardProxyBaseResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: ResourceGuardProxyBaseResource properties. + * + * @return the properties value. + */ + ResourceGuardProxyBase properties(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.dataprotection.fluent.models.ResourceGuardProxyBaseResourceInner object. + * + * @return the inner object. + */ + ResourceGuardProxyBaseResourceInner innerModel(); + + /** The entirety of the ResourceGuardProxyBaseResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ResourceGuardProxyBaseResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ResourceGuardProxyBaseResource definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ResourceGuardProxyBaseResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vaultName. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. + * @return the next definition stage. + */ + WithCreate withExistingBackupVault(String resourceGroupName, String vaultName); + } + /** + * The stage of the ResourceGuardProxyBaseResource definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ResourceGuardProxyBaseResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ResourceGuardProxyBaseResource create(Context context); + } + /** The stage of the ResourceGuardProxyBaseResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: ResourceGuardProxyBaseResource properties. + * + * @param properties ResourceGuardProxyBaseResource properties. + * @return the next definition stage. + */ + WithCreate withProperties(ResourceGuardProxyBase properties); + } + } + /** + * Begins update for the ResourceGuardProxyBaseResource resource. + * + * @return the stage of resource update. + */ + ResourceGuardProxyBaseResource.Update update(); + + /** The template for ResourceGuardProxyBaseResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ResourceGuardProxyBaseResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ResourceGuardProxyBaseResource apply(Context context); + } + /** The ResourceGuardProxyBaseResource update stages. */ + interface UpdateStages { + /** The stage of the ResourceGuardProxyBaseResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: ResourceGuardProxyBaseResource properties. + * + * @param properties ResourceGuardProxyBaseResource properties. + * @return the next definition stage. + */ + Update withProperties(ResourceGuardProxyBase properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ResourceGuardProxyBaseResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ResourceGuardProxyBaseResource refresh(Context context); + + /** + * The unlockDelete operation. + * + * @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 along with {@link Response}. + */ + Response unlockDeleteWithResponse(UnlockDeleteRequest parameters, Context context); + + /** + * The unlockDelete operation. + * + * @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(UnlockDeleteRequest parameters); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProxyBaseResourceList.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProxyBaseResourceList.java new file mode 100644 index 000000000000..650c360c2488 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/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.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dataprotection.fluent.models.ResourceGuardProxyBaseResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of ResourceGuardProxyBase resources. */ +@Fluent +public final class ResourceGuardProxyBaseResourceList extends DppResourceList { + /* + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of ResourceGuardProxyBaseResourceList class. */ + public ResourceGuardProxyBaseResourceList() { + } + + /** + * 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/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardResource.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardResource.java index 6d17a228493b..2192cbdfb382 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardResource.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardResource.java @@ -55,7 +55,9 @@ public interface ResourceGuardResource { String etag(); /** - * Gets the identity property: DppIdentityDetails Input Managed Identity Details. + * Gets the identity property: DppIdentityDetails + * + *

Input Managed Identity Details. * * @return the identity value. */ @@ -89,6 +91,13 @@ public interface ResourceGuardResource { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.dataprotection.fluent.models.ResourceGuardResourceInner object. * @@ -183,9 +192,12 @@ interface WithEtag { /** The stage of the ResourceGuardResource definition allowing to specify identity. */ interface WithIdentity { /** - * Specifies the identity property: DppIdentityDetails Input Managed Identity Details. + * Specifies the identity property: DppIdentityDetails + * + *

Input Managed Identity Details. * - * @param identity DppIdentityDetails Input Managed Identity Details. + * @param identity DppIdentityDetails + *

Input Managed Identity Details. * @return the next definition stage. */ WithCreate withIdentity(DppIdentityDetails identity); @@ -209,7 +221,7 @@ interface WithProperties { ResourceGuardResource.Update update(); /** The template for ResourceGuardResource update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { /** * Executes the update request. * @@ -240,13 +252,26 @@ interface WithTags { /** The stage of the ResourceGuardResource update allowing to specify identity. */ interface WithIdentity { /** - * Specifies the identity property: DppIdentityDetails Input Managed Identity Details. + * Specifies the identity property: DppIdentityDetails + * + *

Input Managed Identity Details. * - * @param identity DppIdentityDetails Input Managed Identity Details. + * @param identity DppIdentityDetails + *

Input Managed Identity Details. * @return the next definition stage. */ Update withIdentity(DppIdentityDetails identity); } + /** The stage of the ResourceGuardResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Resource properties.. + * + * @param properties Resource properties. + * @return the next definition stage. + */ + Update withProperties(PatchBackupVaultInput properties); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardResourceList.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardResourceList.java index 161dd11ceba5..343237d8a7bf 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardResourceList.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardResourceList.java @@ -5,23 +5,23 @@ package com.azure.resourcemanager.dataprotection.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dataprotection.fluent.models.ResourceGuardResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** List of ResourceGuard resources. */ @Fluent public final class ResourceGuardResourceList extends DppTrackedResourceList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGuardResourceList.class); - /* * List of resources. */ @JsonProperty(value = "value") private List value; + /** Creates an instance of ResourceGuardResourceList class. */ + public ResourceGuardResourceList() { + } + /** * Get the value property: List of resources. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuards.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuards.java index 5ff9c2cba254..590035d78782 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuards.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuards.java @@ -15,7 +15,7 @@ public interface ResourceGuards { * * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -26,7 +26,7 @@ public interface ResourceGuards { * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -37,7 +37,7 @@ public interface ResourceGuards { * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -49,7 +49,7 @@ public interface ResourceGuards { * @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 ResourceGuard resources. + * @return list of ResourceGuard resources as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -58,50 +58,51 @@ public interface ResourceGuards { * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. + * @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 the response body along with {@link Response}. */ - ResourceGuardResource getByResourceGroup(String resourceGroupName, String resourceGuardsName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceGuardsName, Context context); /** * Returns a ResourceGuard belonging to a resource group. * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. - * @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 getByResourceGroupWithResponse( - String resourceGroupName, String resourceGuardsName, Context context); + ResourceGuardResource getByResourceGroup(String resourceGroupName, String resourceGuardsName); /** * Deletes a ResourceGuard resource from the resource group. * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void deleteByResourceGroup(String resourceGroupName, String resourceGuardsName); + Response deleteByResourceGroupWithResponse( + String resourceGroupName, String resourceGuardsName, Context context); /** * Deletes a ResourceGuard resource from the resource group. * * @param resourceGroupName The name of the resource group where the backup vault is present. * @param resourceGuardsName The name of ResourceGuard. - * @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 resourceGroupName, String resourceGuardsName, Context context); + void deleteByResourceGroup(String resourceGroupName, String resourceGuardsName); /** * Returns collection of operation request objects for a critical operation protected by the given ResourceGuard @@ -112,7 +113,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ PagedIterable getDisableSoftDeleteRequestsObjects( String resourceGroupName, String resourceGuardsName); @@ -127,7 +128,7 @@ PagedIterable getDisableSoftDeleteRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ PagedIterable getDisableSoftDeleteRequestsObjects( String resourceGroupName, String resourceGuardsName, Context context); @@ -141,7 +142,7 @@ PagedIterable getDisableSoftDeleteRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ PagedIterable getDeleteResourceGuardProxyRequestsObjects( String resourceGroupName, String resourceGuardsName); @@ -156,7 +157,7 @@ PagedIterable getDeleteResourceGuardProxyRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ PagedIterable getDeleteResourceGuardProxyRequestsObjects( String resourceGroupName, String resourceGuardsName, Context context); @@ -170,7 +171,7 @@ PagedIterable getDeleteResourceGuardProxyRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ PagedIterable getBackupSecurityPinRequestsObjects( String resourceGroupName, String resourceGuardsName); @@ -185,7 +186,7 @@ PagedIterable getBackupSecurityPinRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ PagedIterable getBackupSecurityPinRequestsObjects( String resourceGroupName, String resourceGuardsName, Context context); @@ -199,7 +200,7 @@ PagedIterable getBackupSecurityPinRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ PagedIterable getDeleteProtectedItemRequestsObjects( String resourceGroupName, String resourceGuardsName); @@ -214,7 +215,7 @@ PagedIterable getDeleteProtectedItemRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ PagedIterable getDeleteProtectedItemRequestsObjects( String resourceGroupName, String resourceGuardsName, Context context); @@ -228,7 +229,7 @@ PagedIterable getDeleteProtectedItemRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ PagedIterable getUpdateProtectionPolicyRequestsObjects( String resourceGroupName, String resourceGuardsName); @@ -243,7 +244,7 @@ PagedIterable getUpdateProtectionPolicyRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ PagedIterable getUpdateProtectionPolicyRequestsObjects( String resourceGroupName, String resourceGuardsName, Context context); @@ -257,7 +258,7 @@ PagedIterable getUpdateProtectionPolicyRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ PagedIterable getUpdateProtectedItemRequestsObjects( String resourceGroupName, String resourceGuardsName); @@ -272,26 +273,11 @@ PagedIterable getUpdateProtectedItemRequestsObjects( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base for all lists of V2 resources. + * @return base for all lists of V2 resources as paginated response with {@link PagedIterable}. */ PagedIterable getUpdateProtectedItemRequestsObjects( String resourceGroupName, String resourceGuardsName, Context context); - /** - * Returns collection of operation request objects for a critical operation protected by the given ResourceGuard - * resource. - * - * @param resourceGroupName The name of the resource group where the backup vault is present. - * @param resourceGuardsName The resourceGuardsName parameter. - * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. - */ - DppBaseResource getDefaultDisableSoftDeleteRequestsObject( - String resourceGroupName, String resourceGuardsName, String requestName); - /** * Returns collection of operation request objects for a critical operation protected by the given ResourceGuard * resource. @@ -303,7 +289,7 @@ DppBaseResource getDefaultDisableSoftDeleteRequestsObject( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ Response getDefaultDisableSoftDeleteRequestsObjectWithResponse( String resourceGroupName, String resourceGuardsName, String requestName, Context context); @@ -320,7 +306,7 @@ Response getDefaultDisableSoftDeleteRequestsObjectWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return base resource under Microsoft.DataProtection provider namespace. */ - DppBaseResource getDefaultDeleteResourceGuardProxyRequestsObject( + DppBaseResource getDefaultDisableSoftDeleteRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName); /** @@ -334,7 +320,7 @@ DppBaseResource getDefaultDeleteResourceGuardProxyRequestsObject( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ Response getDefaultDeleteResourceGuardProxyRequestsObjectWithResponse( String resourceGroupName, String resourceGuardsName, String requestName, Context context); @@ -351,7 +337,7 @@ Response getDefaultDeleteResourceGuardProxyRequestsObjectWithRe * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return base resource under Microsoft.DataProtection provider namespace. */ - DppBaseResource getDefaultBackupSecurityPinRequestsObject( + DppBaseResource getDefaultDeleteResourceGuardProxyRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName); /** @@ -365,7 +351,7 @@ DppBaseResource getDefaultBackupSecurityPinRequestsObject( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ Response getDefaultBackupSecurityPinRequestsObjectWithResponse( String resourceGroupName, String resourceGuardsName, String requestName, Context context); @@ -382,7 +368,7 @@ Response getDefaultBackupSecurityPinRequestsObjectWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return base resource under Microsoft.DataProtection provider namespace. */ - DppBaseResource getDefaultDeleteProtectedItemRequestsObject( + DppBaseResource getDefaultBackupSecurityPinRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName); /** @@ -396,7 +382,7 @@ DppBaseResource getDefaultDeleteProtectedItemRequestsObject( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ Response getDefaultDeleteProtectedItemRequestsObjectWithResponse( String resourceGroupName, String resourceGuardsName, String requestName, Context context); @@ -413,7 +399,7 @@ Response getDefaultDeleteProtectedItemRequestsObjectWithRespons * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return base resource under Microsoft.DataProtection provider namespace. */ - DppBaseResource getDefaultUpdateProtectionPolicyRequestsObject( + DppBaseResource getDefaultDeleteProtectedItemRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName); /** @@ -427,7 +413,7 @@ DppBaseResource getDefaultUpdateProtectionPolicyRequestsObject( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ Response getDefaultUpdateProtectionPolicyRequestsObjectWithResponse( String resourceGroupName, String resourceGuardsName, String requestName, Context context); @@ -444,7 +430,7 @@ Response getDefaultUpdateProtectionPolicyRequestsObjectWithResp * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return base resource under Microsoft.DataProtection provider namespace. */ - DppBaseResource getDefaultUpdateProtectedItemRequestsObject( + DppBaseResource getDefaultUpdateProtectionPolicyRequestsObject( String resourceGroupName, String resourceGuardsName, String requestName); /** @@ -458,11 +444,26 @@ DppBaseResource getDefaultUpdateProtectedItemRequestsObject( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base resource under Microsoft.DataProtection provider namespace. + * @return base resource under Microsoft.DataProtection provider namespace along with {@link Response}. */ Response getDefaultUpdateProtectedItemRequestsObjectWithResponse( String resourceGroupName, String resourceGuardsName, String requestName, Context context); + /** + * Returns collection of operation request objects for a critical operation protected by the given ResourceGuard + * resource. + * + * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param resourceGuardsName The resourceGuardsName parameter. + * @param requestName The requestName 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 base resource under Microsoft.DataProtection provider namespace. + */ + DppBaseResource getDefaultUpdateProtectedItemRequestsObject( + String resourceGroupName, String resourceGuardsName, String requestName); + /** * Returns a ResourceGuard belonging to a resource group. * @@ -470,7 +471,7 @@ Response getDefaultUpdateProtectedItemRequestsObjectWithRespons * @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 the response body along with {@link Response}. */ ResourceGuardResource getById(String id); @@ -482,7 +483,7 @@ Response getDefaultUpdateProtectedItemRequestsObjectWithRespons * @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 the response body along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -504,7 +505,7 @@ Response getDefaultUpdateProtectedItemRequestsObjectWithRespons * @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 the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceMoveDetails.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceMoveDetails.java index 461e44ed229f..667f4b0b865f 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceMoveDetails.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceMoveDetails.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.dataprotection.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; /** ResourceMoveDetails will be returned in response to GetResource call from ARM. */ @Fluent public final class ResourceMoveDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceMoveDetails.class); - /* * CorrelationId of latest ResourceMove operation attempted */ @@ -21,15 +17,13 @@ public final class ResourceMoveDetails { private String operationId; /* - * Start time in UTC of latest ResourceMove operation attempted. ISO 8601 - * format. + * Start time in UTC of latest ResourceMove operation attempted. ISO 8601 format. */ @JsonProperty(value = "startTimeUtc") private String startTimeUtc; /* - * Completion time in UTC of latest ResourceMove operation attempted. ISO - * 8601 format. + * Completion time in UTC of latest ResourceMove operation attempted. ISO 8601 format. */ @JsonProperty(value = "completionTimeUtc") private String completionTimeUtc; @@ -41,12 +35,15 @@ public final class ResourceMoveDetails { private String sourceResourcePath; /* - * ARM resource path of target resource used in latest ResourceMove - * operation + * ARM resource path of target resource used in latest ResourceMove operation */ @JsonProperty(value = "targetResourcePath") private String targetResourcePath; + /** Creates an instance of ResourceMoveDetails class. */ + public ResourceMoveDetails() { + } + /** * Get the operationId property: CorrelationId of latest ResourceMove operation attempted. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceMoveState.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceMoveState.java index f55f0ebb4437..93b5d6ff1162 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceMoveState.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceMoveState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ResourceMoveState. */ +/** Resource move state for backup vault. */ public final class ResourceMoveState extends ExpandableStringEnum { /** Static value Unknown for ResourceMoveState. */ public static final ResourceMoveState UNKNOWN = fromString("Unknown"); @@ -51,7 +51,11 @@ public static ResourceMoveState fromString(String name) { return fromString(name, ResourceMoveState.class); } - /** @return known ResourceMoveState values. */ + /** + * Gets known ResourceMoveState values. + * + * @return known ResourceMoveState values. + */ public static Collection values() { return values(ResourceMoveState.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestorableTimeRange.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestorableTimeRange.java index 2712bf276abd..a52c205c406a 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestorableTimeRange.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestorableTimeRange.java @@ -6,14 +6,11 @@ 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 RestorableTimeRange model. */ @Fluent public final class RestorableTimeRange { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorableTimeRange.class); - /* * Start time for the available restore range */ @@ -32,6 +29,10 @@ public final class RestorableTimeRange { @JsonProperty(value = "objectType") private String objectType; + /** Creates an instance of RestorableTimeRange class. */ + public RestorableTimeRange() { + } + /** * Get the startTime property: Start time for the available restore range. * @@ -99,14 +100,16 @@ public RestorableTimeRange withObjectType(String objectType) { */ public void validate() { if (startTime() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property startTime in model RestorableTimeRange")); } if (endTime() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property endTime in model RestorableTimeRange")); } } + + private static final ClientLogger LOGGER = new ClientLogger(RestorableTimeRange.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestorableTimeRanges.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestorableTimeRanges.java index 3aeb74323ab6..a969f4b0888a 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestorableTimeRanges.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestorableTimeRanges.java @@ -10,36 +10,40 @@ /** Resource collection API of RestorableTimeRanges. */ public interface RestorableTimeRanges { /** - * @param vaultName The name of the backup vault. + * The find operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 list Restore Ranges Response. + * @return list Restore Ranges Response along with {@link Response}. */ - AzureBackupFindRestorableTimeRangesResponseResource find( - String vaultName, + Response findWithResponse( String resourceGroupName, + String vaultName, String backupInstanceName, - AzureBackupFindRestorableTimeRangesRequest parameters); + AzureBackupFindRestorableTimeRangesRequest parameters, + Context context); /** - * @param vaultName The name of the backup vault. + * The find operation. + * * @param resourceGroupName The name of the resource group where the backup vault is present. + * @param vaultName The name of the backup vault. * @param backupInstanceName The name of the backup instance. * @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 list Restore Ranges Response. */ - Response findWithResponse( - String vaultName, + AzureBackupFindRestorableTimeRangesResponseResource find( String resourceGroupName, + String vaultName, String backupInstanceName, - AzureBackupFindRestorableTimeRangesRequest parameters, - Context context); + AzureBackupFindRestorableTimeRangesRequest parameters); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreFilesTargetInfo.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreFilesTargetInfo.java index a32de43d64f3..900f384c5963 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreFilesTargetInfo.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreFilesTargetInfo.java @@ -6,7 +6,6 @@ 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; @@ -16,15 +15,16 @@ @JsonTypeName("RestoreFilesTargetInfo") @Fluent public final class RestoreFilesTargetInfo extends RestoreTargetInfoBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestoreFilesTargetInfo.class); - /* - * Destination of RestoreAsFiles operation, when destination is not a - * datasource + * Destination of RestoreAsFiles operation, when destination is not a datasource */ @JsonProperty(value = "targetDetails", required = true) private TargetDetails targetDetails; + /** Creates an instance of RestoreFilesTargetInfo class. */ + public RestoreFilesTargetInfo() { + } + /** * Get the targetDetails property: Destination of RestoreAsFiles operation, when destination is not a datasource. * @@ -68,7 +68,7 @@ public RestoreFilesTargetInfo withRestoreLocation(String restoreLocation) { public void validate() { super.validate(); if (targetDetails() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetDetails in model RestoreFilesTargetInfo")); @@ -76,4 +76,6 @@ public void validate() { targetDetails().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(RestoreFilesTargetInfo.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreJobRecoveryPointDetails.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreJobRecoveryPointDetails.java index 991160496ca5..b2219de941df 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreJobRecoveryPointDetails.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreJobRecoveryPointDetails.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.dataprotection.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.time.OffsetDateTime; /** The RestoreJobRecoveryPointDetails model. */ @Fluent public final class RestoreJobRecoveryPointDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestoreJobRecoveryPointDetails.class); - /* * The recoveryPointID property. */ @@ -27,6 +23,10 @@ public final class RestoreJobRecoveryPointDetails { @JsonProperty(value = "recoveryPointTime") private OffsetDateTime recoveryPointTime; + /** Creates an instance of RestoreJobRecoveryPointDetails class. */ + public RestoreJobRecoveryPointDetails() { + } + /** * Get the recoveryPointId property: The recoveryPointID property. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreSourceDataStoreType.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreSourceDataStoreType.java index 696f46eb0d8c..9d45336a9998 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreSourceDataStoreType.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreSourceDataStoreType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RestoreSourceDataStoreType. */ +/** Gets or sets the type of the source data store. */ public final class RestoreSourceDataStoreType extends ExpandableStringEnum { /** Static value OperationalStore for RestoreSourceDataStoreType. */ public static final RestoreSourceDataStoreType OPERATIONAL_STORE = fromString("OperationalStore"); @@ -30,7 +30,11 @@ public static RestoreSourceDataStoreType fromString(String name) { return fromString(name, RestoreSourceDataStoreType.class); } - /** @return known RestoreSourceDataStoreType values. */ + /** + * Gets known RestoreSourceDataStoreType values. + * + * @return known RestoreSourceDataStoreType values. + */ public static Collection values() { return values(RestoreSourceDataStoreType.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreTargetInfo.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreTargetInfo.java index b70e93d53833..37d31a513bcd 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreTargetInfo.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreTargetInfo.java @@ -6,7 +6,6 @@ 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; @@ -16,16 +15,18 @@ @JsonTypeName("RestoreTargetInfo") @Fluent public final class RestoreTargetInfo extends RestoreTargetInfoBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestoreTargetInfo.class); - /* - * Datasource Information of target DS + * Datasource + * + * Information of target DS */ @JsonProperty(value = "datasourceInfo", required = true) private Datasource datasourceInfo; /* - * DatasourceSet Information of target DS Set + * DatasourceSet + * + * Information of target DS Set */ @JsonProperty(value = "datasourceSetInfo") private DatasourceSet datasourceSetInfo; @@ -36,8 +37,14 @@ public final class RestoreTargetInfo extends RestoreTargetInfoBase { @JsonProperty(value = "datasourceAuthCredentials") private AuthCredentials datasourceAuthCredentials; + /** Creates an instance of RestoreTargetInfo class. */ + public RestoreTargetInfo() { + } + /** - * Get the datasourceInfo property: Datasource Information of target DS. + * Get the datasourceInfo property: Datasource + * + *

Information of target DS. * * @return the datasourceInfo value. */ @@ -46,7 +53,9 @@ public Datasource datasourceInfo() { } /** - * Set the datasourceInfo property: Datasource Information of target DS. + * Set the datasourceInfo property: Datasource + * + *

Information of target DS. * * @param datasourceInfo the datasourceInfo value to set. * @return the RestoreTargetInfo object itself. @@ -57,7 +66,9 @@ public RestoreTargetInfo withDatasourceInfo(Datasource datasourceInfo) { } /** - * Get the datasourceSetInfo property: DatasourceSet Information of target DS Set. + * Get the datasourceSetInfo property: DatasourceSet + * + *

Information of target DS Set. * * @return the datasourceSetInfo value. */ @@ -66,7 +77,9 @@ public DatasourceSet datasourceSetInfo() { } /** - * Set the datasourceSetInfo property: DatasourceSet Information of target DS Set. + * Set the datasourceSetInfo property: DatasourceSet + * + *

Information of target DS Set. * * @param datasourceSetInfo the datasourceSetInfo value to set. * @return the RestoreTargetInfo object itself. @@ -119,7 +132,7 @@ public RestoreTargetInfo withRestoreLocation(String restoreLocation) { public void validate() { super.validate(); if (datasourceInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property datasourceInfo in model RestoreTargetInfo")); @@ -133,4 +146,6 @@ public void validate() { datasourceAuthCredentials().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(RestoreTargetInfo.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreTargetInfoBase.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreTargetInfoBase.java index 80c1fb7ef70a..cc8c75d19b30 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreTargetInfoBase.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreTargetInfoBase.java @@ -6,7 +6,6 @@ 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; @@ -26,8 +25,6 @@ }) @Fluent public class RestoreTargetInfoBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestoreTargetInfoBase.class); - /* * Recovery Option */ @@ -40,6 +37,10 @@ public class RestoreTargetInfoBase { @JsonProperty(value = "restoreLocation") private String restoreLocation; + /** Creates an instance of RestoreTargetInfoBase class. */ + public RestoreTargetInfoBase() { + } + /** * Get the recoveryOption property: Recovery Option. * @@ -87,10 +88,12 @@ public RestoreTargetInfoBase withRestoreLocation(String restoreLocation) { */ public void validate() { if (recoveryOption() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property recoveryOption in model RestoreTargetInfoBase")); } } + + private static final ClientLogger LOGGER = new ClientLogger(RestoreTargetInfoBase.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreTargetLocationType.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreTargetLocationType.java index affd319d2850..29cd71ea5263 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreTargetLocationType.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RestoreTargetLocationType.java @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RestoreTargetLocationType. */ +/** + * Denotes the target location where the data will be restored, string value for the enum + * {Microsoft.Internal.AzureBackup.DataProtection.Common.Interface.RestoreTargetLocationType}. + */ public final class RestoreTargetLocationType extends ExpandableStringEnum { /** Static value Invalid for RestoreTargetLocationType. */ public static final RestoreTargetLocationType INVALID = fromString("Invalid"); @@ -30,7 +33,11 @@ public static RestoreTargetLocationType fromString(String name) { return fromString(name, RestoreTargetLocationType.class); } - /** @return known RestoreTargetLocationType values. */ + /** + * Gets known RestoreTargetLocationType values. + * + * @return known RestoreTargetLocationType values. + */ public static Collection values() { return values(RestoreTargetLocationType.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RetentionTag.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RetentionTag.java index be582769762d..4e7a9fcffff0 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RetentionTag.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/RetentionTag.java @@ -6,14 +6,15 @@ 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; -/** RetentionTag Retention tag. */ +/** + * RetentionTag + * + *

Retention tag. + */ @Fluent public final class RetentionTag { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RetentionTag.class); - /* * Retention Tag version. */ @@ -32,6 +33,10 @@ public final class RetentionTag { @JsonProperty(value = "tagName", required = true) private String tagName; + /** Creates an instance of RetentionTag class. */ + public RetentionTag() { + } + /** * Get the etag property: Retention Tag version. * @@ -77,9 +82,11 @@ public RetentionTag withTagName(String tagName) { */ public void validate() { if (tagName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property tagName in model RetentionTag")); } } + + private static final ClientLogger LOGGER = new ClientLogger(RetentionTag.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ScheduleBasedBackupCriteria.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ScheduleBasedBackupCriteria.java index 8ed995d5709e..5d2e41413026 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ScheduleBasedBackupCriteria.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ScheduleBasedBackupCriteria.java @@ -5,24 +5,23 @@ package com.azure.resourcemanager.dataprotection.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; -/** ScheduleBasedBackupCriteria Schedule based backup criteria. */ +/** + * ScheduleBasedBackupCriteria + * + *

Schedule based backup criteria. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("ScheduleBasedBackupCriteria") @Fluent public final class ScheduleBasedBackupCriteria extends BackupCriteria { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleBasedBackupCriteria.class); - /* - * it contains absolute values like "AllBackup" / "FirstOfDay" / - * "FirstOfWeek" / "FirstOfMonth" + * it contains absolute values like "AllBackup"\ / "FirstOfDay"\ / "FirstOfWeek"\ / "FirstOfMonth" * and should be part of AbsoluteMarker enum */ @JsonProperty(value = "absoluteCriteria") @@ -58,9 +57,13 @@ public final class ScheduleBasedBackupCriteria extends BackupCriteria { @JsonProperty(value = "weeksOfTheMonth") private List weeksOfTheMonth; + /** Creates an instance of ScheduleBasedBackupCriteria class. */ + public ScheduleBasedBackupCriteria() { + } + /** - * Get the absoluteCriteria property: it contains absolute values like "AllBackup" / "FirstOfDay" / "FirstOfWeek" / - * "FirstOfMonth" and should be part of AbsoluteMarker enum. + * Get the absoluteCriteria property: it contains absolute values like "AllBackup"\ / "FirstOfDay"\ / "FirstOfWeek"\ + * / "FirstOfMonth" and should be part of AbsoluteMarker enum. * * @return the absoluteCriteria value. */ @@ -69,8 +72,8 @@ public List absoluteCriteria() { } /** - * Set the absoluteCriteria property: it contains absolute values like "AllBackup" / "FirstOfDay" / "FirstOfWeek" / - * "FirstOfMonth" and should be part of AbsoluteMarker enum. + * Set the absoluteCriteria property: it contains absolute values like "AllBackup"\ / "FirstOfDay"\ / "FirstOfWeek"\ + * / "FirstOfMonth" and should be part of AbsoluteMarker enum. * * @param absoluteCriteria the absoluteCriteria value to set. * @return the ScheduleBasedBackupCriteria object itself. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ScheduleBasedTriggerContext.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ScheduleBasedTriggerContext.java index 8060d36d2356..40a5440ce131 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ScheduleBasedTriggerContext.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ScheduleBasedTriggerContext.java @@ -6,21 +6,24 @@ 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; -/** ScheduleBasedTriggerContext Schedule based trigger context. */ +/** + * ScheduleBasedTriggerContext + * + *

Schedule based trigger context. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") @JsonTypeName("ScheduleBasedTriggerContext") @Fluent public final class ScheduleBasedTriggerContext extends TriggerContext { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleBasedTriggerContext.class); - /* - * BackupSchedule Schedule for this backup + * BackupSchedule + * + * Schedule for this backup */ @JsonProperty(value = "schedule", required = true) private BackupSchedule schedule; @@ -31,8 +34,14 @@ public final class ScheduleBasedTriggerContext extends TriggerContext { @JsonProperty(value = "taggingCriteria", required = true) private List taggingCriteria; + /** Creates an instance of ScheduleBasedTriggerContext class. */ + public ScheduleBasedTriggerContext() { + } + /** - * Get the schedule property: BackupSchedule Schedule for this backup. + * Get the schedule property: BackupSchedule + * + *

Schedule for this backup. * * @return the schedule value. */ @@ -41,7 +50,9 @@ public BackupSchedule schedule() { } /** - * Set the schedule property: BackupSchedule Schedule for this backup. + * Set the schedule property: BackupSchedule + * + *

Schedule for this backup. * * @param schedule the schedule value to set. * @return the ScheduleBasedTriggerContext object itself. @@ -80,7 +91,7 @@ public ScheduleBasedTriggerContext withTaggingCriteria(List tag public void validate() { super.validate(); if (schedule() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property schedule in model ScheduleBasedTriggerContext")); @@ -88,7 +99,7 @@ public void validate() { schedule().validate(); } if (taggingCriteria() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property taggingCriteria in model ScheduleBasedTriggerContext")); @@ -96,4 +107,6 @@ public void validate() { taggingCriteria().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(ScheduleBasedTriggerContext.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecretStoreBasedAuthCredentials.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecretStoreBasedAuthCredentials.java index b3a7c621d6f3..f26464b3d8d3 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecretStoreBasedAuthCredentials.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecretStoreBasedAuthCredentials.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.dataprotection.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; @@ -16,14 +14,16 @@ @JsonTypeName("SecretStoreBasedAuthCredentials") @Fluent public final class SecretStoreBasedAuthCredentials extends AuthCredentials { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretStoreBasedAuthCredentials.class); - /* * Secret store resource */ @JsonProperty(value = "secretStoreResource") private SecretStoreResource secretStoreResource; + /** Creates an instance of SecretStoreBasedAuthCredentials class. */ + public SecretStoreBasedAuthCredentials() { + } + /** * Get the secretStoreResource property: Secret store resource. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecretStoreResource.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecretStoreResource.java index 05358573dab3..d8f0913175ee 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecretStoreResource.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecretStoreResource.java @@ -6,14 +6,11 @@ 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; /** Class representing a secret store resource. */ @Fluent public final class SecretStoreResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretStoreResource.class); - /* * Uri to get to the resource */ @@ -26,6 +23,16 @@ public final class SecretStoreResource { @JsonProperty(value = "secretStoreType", required = true) private SecretStoreType secretStoreType; + /* + * Gets or sets value stored in secret store resource + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of SecretStoreResource class. */ + public SecretStoreResource() { + } + /** * Get the uri property: Uri to get to the resource. * @@ -66,6 +73,26 @@ public SecretStoreResource withSecretStoreType(SecretStoreType secretStoreType) return this; } + /** + * Get the value property: Gets or sets value stored in secret store resource. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Gets or sets value stored in secret store resource. + * + * @param value the value value to set. + * @return the SecretStoreResource object itself. + */ + public SecretStoreResource withValue(String value) { + this.value = value; + return this; + } + /** * Validates the instance. * @@ -73,10 +100,12 @@ public SecretStoreResource withSecretStoreType(SecretStoreType secretStoreType) */ public void validate() { if (secretStoreType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property secretStoreType in model SecretStoreResource")); } } + + private static final ClientLogger LOGGER = new ClientLogger(SecretStoreResource.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecretStoreType.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecretStoreType.java index 6f16c358d11a..8f9608ef46ea 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecretStoreType.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecretStoreType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for SecretStoreType. */ +/** Gets or sets the type of secret store. */ public final class SecretStoreType extends ExpandableStringEnum { /** Static value Invalid for SecretStoreType. */ public static final SecretStoreType INVALID = fromString("Invalid"); @@ -27,7 +27,11 @@ public static SecretStoreType fromString(String name) { return fromString(name, SecretStoreType.class); } - /** @return known SecretStoreType values. */ + /** + * Gets known SecretStoreType values. + * + * @return known SecretStoreType values. + */ public static Collection values() { return values(SecretStoreType.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecuritySettings.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecuritySettings.java new file mode 100644 index 000000000000..eb039420e2a4 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecuritySettings.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class containing security settings of vault. */ +@Fluent +public final class SecuritySettings { + /* + * Soft delete related settings + */ + @JsonProperty(value = "softDeleteSettings") + private SoftDeleteSettings softDeleteSettings; + + /* + * Immutability Settings at vault level + */ + @JsonProperty(value = "immutabilitySettings") + private ImmutabilitySettings immutabilitySettings; + + /** Creates an instance of SecuritySettings class. */ + public SecuritySettings() { + } + + /** + * Get the softDeleteSettings property: Soft delete related settings. + * + * @return the softDeleteSettings value. + */ + public SoftDeleteSettings softDeleteSettings() { + return this.softDeleteSettings; + } + + /** + * Set the softDeleteSettings property: Soft delete related settings. + * + * @param softDeleteSettings the softDeleteSettings value to set. + * @return the SecuritySettings object itself. + */ + public SecuritySettings withSoftDeleteSettings(SoftDeleteSettings softDeleteSettings) { + this.softDeleteSettings = softDeleteSettings; + return this; + } + + /** + * Get the immutabilitySettings property: Immutability Settings at vault level. + * + * @return the immutabilitySettings value. + */ + public ImmutabilitySettings immutabilitySettings() { + return this.immutabilitySettings; + } + + /** + * Set the immutabilitySettings property: Immutability Settings at vault level. + * + * @param immutabilitySettings the immutabilitySettings value to set. + * @return the SecuritySettings object itself. + */ + public SecuritySettings withImmutabilitySettings(ImmutabilitySettings immutabilitySettings) { + this.immutabilitySettings = immutabilitySettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (softDeleteSettings() != null) { + softDeleteSettings().validate(); + } + if (immutabilitySettings() != null) { + immutabilitySettings().validate(); + } + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SoftDeleteSettings.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SoftDeleteSettings.java new file mode 100644 index 000000000000..832935db4c8c --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SoftDeleteSettings.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.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Soft delete related settings. */ +@Fluent +public final class SoftDeleteSettings { + /* + * State of soft delete + */ + @JsonProperty(value = "state") + private SoftDeleteState state; + + /* + * Soft delete retention duration + */ + @JsonProperty(value = "retentionDurationInDays") + private Double retentionDurationInDays; + + /** Creates an instance of SoftDeleteSettings class. */ + public SoftDeleteSettings() { + } + + /** + * Get the state property: State of soft delete. + * + * @return the state value. + */ + public SoftDeleteState state() { + return this.state; + } + + /** + * Set the state property: State of soft delete. + * + * @param state the state value to set. + * @return the SoftDeleteSettings object itself. + */ + public SoftDeleteSettings withState(SoftDeleteState state) { + this.state = state; + return this; + } + + /** + * Get the retentionDurationInDays property: Soft delete retention duration. + * + * @return the retentionDurationInDays value. + */ + public Double retentionDurationInDays() { + return this.retentionDurationInDays; + } + + /** + * Set the retentionDurationInDays property: Soft delete retention duration. + * + * @param retentionDurationInDays the retentionDurationInDays value to set. + * @return the SoftDeleteSettings object itself. + */ + public SoftDeleteSettings withRetentionDurationInDays(Double retentionDurationInDays) { + this.retentionDurationInDays = retentionDurationInDays; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SoftDeleteState.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SoftDeleteState.java new file mode 100644 index 000000000000..97505ed32cb7 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SoftDeleteState.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of soft delete. */ +public final class SoftDeleteState extends ExpandableStringEnum { + /** Static value Off for SoftDeleteState. */ + public static final SoftDeleteState OFF = fromString("Off"); + + /** Static value On for SoftDeleteState. */ + public static final SoftDeleteState ON = fromString("On"); + + /** Static value AlwaysOn for SoftDeleteState. */ + public static final SoftDeleteState ALWAYS_ON = fromString("AlwaysOn"); + + /** + * Creates or finds a SoftDeleteState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SoftDeleteState. + */ + @JsonCreator + public static SoftDeleteState fromString(String name) { + return fromString(name, SoftDeleteState.class); + } + + /** + * Gets known SoftDeleteState values. + * + * @return known SoftDeleteState values. + */ + public static Collection values() { + return values(SoftDeleteState.class); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SourceDataStoreType.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SourceDataStoreType.java index 5ba8eca14deb..ee8c0b74251b 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SourceDataStoreType.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SourceDataStoreType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for SourceDataStoreType. */ +/** Gets or sets the type of the source data store. */ public final class SourceDataStoreType extends ExpandableStringEnum { /** Static value ArchiveStore for SourceDataStoreType. */ public static final SourceDataStoreType ARCHIVE_STORE = fromString("ArchiveStore"); @@ -30,7 +30,11 @@ public static SourceDataStoreType fromString(String name) { return fromString(name, SourceDataStoreType.class); } - /** @return known SourceDataStoreType values. */ + /** + * Gets known SourceDataStoreType values. + * + * @return known SourceDataStoreType values. + */ public static Collection values() { return values(SourceDataStoreType.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SourceLifeCycle.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SourceLifeCycle.java index cb9138f32ef7..7bf67354c07b 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SourceLifeCycle.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SourceLifeCycle.java @@ -6,23 +6,28 @@ 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; -/** SourceLifeCycle Source LifeCycle. */ +/** + * SourceLifeCycle + * + *

Source LifeCycle. + */ @Fluent public final class SourceLifeCycle { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceLifeCycle.class); - /* - * DeleteOption Delete Option + * DeleteOption + * + * Delete Option */ @JsonProperty(value = "deleteAfter", required = true) private DeleteOption deleteAfter; /* - * DataStoreInfoBase DataStoreInfo base + * DataStoreInfoBase + * + * DataStoreInfo base */ @JsonProperty(value = "sourceDataStore", required = true) private DataStoreInfoBase sourceDataStore; @@ -33,8 +38,14 @@ public final class SourceLifeCycle { @JsonProperty(value = "targetDataStoreCopySettings") private List targetDataStoreCopySettings; + /** Creates an instance of SourceLifeCycle class. */ + public SourceLifeCycle() { + } + /** - * Get the deleteAfter property: DeleteOption Delete Option. + * Get the deleteAfter property: DeleteOption + * + *

Delete Option. * * @return the deleteAfter value. */ @@ -43,7 +54,9 @@ public DeleteOption deleteAfter() { } /** - * Set the deleteAfter property: DeleteOption Delete Option. + * Set the deleteAfter property: DeleteOption + * + *

Delete Option. * * @param deleteAfter the deleteAfter value to set. * @return the SourceLifeCycle object itself. @@ -54,7 +67,9 @@ public SourceLifeCycle withDeleteAfter(DeleteOption deleteAfter) { } /** - * Get the sourceDataStore property: DataStoreInfoBase DataStoreInfo base. + * Get the sourceDataStore property: DataStoreInfoBase + * + *

DataStoreInfo base. * * @return the sourceDataStore value. */ @@ -63,7 +78,9 @@ public DataStoreInfoBase sourceDataStore() { } /** - * Set the sourceDataStore property: DataStoreInfoBase DataStoreInfo base. + * Set the sourceDataStore property: DataStoreInfoBase + * + *

DataStoreInfo base. * * @param sourceDataStore the sourceDataStore value to set. * @return the SourceLifeCycle object itself. @@ -100,14 +117,14 @@ public SourceLifeCycle withTargetDataStoreCopySettings(List t */ public void validate() { if (deleteAfter() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property deleteAfter in model SourceLifeCycle")); } else { deleteAfter().validate(); } if (sourceDataStore() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property sourceDataStore in model SourceLifeCycle")); } else { @@ -117,4 +134,6 @@ public void validate() { targetDataStoreCopySettings().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(SourceLifeCycle.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Status.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Status.java index cd7098c374c5..6c0d195eb0b3 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Status.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/Status.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Status. */ +/** Specifies the protection status of the resource. */ public final class Status extends ExpandableStringEnum { /** Static value ConfiguringProtection for Status. */ public static final Status CONFIGURING_PROTECTION = fromString("ConfiguringProtection"); @@ -39,7 +39,11 @@ public static Status fromString(String name) { return fromString(name, Status.class); } - /** @return known Status values. */ + /** + * Gets known Status values. + * + * @return known Status values. + */ public static Collection values() { return values(Status.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/StorageSetting.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/StorageSetting.java index a68e8d2e34c7..3b71b803caf9 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/StorageSetting.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/StorageSetting.java @@ -5,15 +5,15 @@ package com.azure.resourcemanager.dataprotection.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; -/** StorageSetting Storage setting. */ +/** + * StorageSetting + * + *

Storage setting. + */ @Fluent public final class StorageSetting { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageSetting.class); - /* * Gets or sets the type of the datastore. */ @@ -26,6 +26,10 @@ public final class StorageSetting { @JsonProperty(value = "type") private StorageSettingTypes type; + /** Creates an instance of StorageSetting class. */ + public StorageSetting() { + } + /** * Get the datastoreType property: Gets or sets the type of the datastore. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/StorageSettingStoreTypes.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/StorageSettingStoreTypes.java index a7cd5aee9f86..f645a68e946d 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/StorageSettingStoreTypes.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/StorageSettingStoreTypes.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for StorageSettingStoreTypes. */ +/** Gets or sets the type of the datastore. */ public final class StorageSettingStoreTypes extends ExpandableStringEnum { /** Static value ArchiveStore for StorageSettingStoreTypes. */ public static final StorageSettingStoreTypes ARCHIVE_STORE = fromString("ArchiveStore"); @@ -30,7 +30,11 @@ public static StorageSettingStoreTypes fromString(String name) { return fromString(name, StorageSettingStoreTypes.class); } - /** @return known StorageSettingStoreTypes values. */ + /** + * Gets known StorageSettingStoreTypes values. + * + * @return known StorageSettingStoreTypes values. + */ public static Collection values() { return values(StorageSettingStoreTypes.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/StorageSettingTypes.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/StorageSettingTypes.java index 6cbaa020b612..13c11b282c51 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/StorageSettingTypes.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/StorageSettingTypes.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for StorageSettingTypes. */ +/** Gets or sets the type. */ public final class StorageSettingTypes extends ExpandableStringEnum { /** Static value GeoRedundant for StorageSettingTypes. */ public static final StorageSettingTypes GEO_REDUNDANT = fromString("GeoRedundant"); @@ -16,6 +16,9 @@ public final class StorageSettingTypes extends ExpandableStringEnum values() { return values(StorageSettingTypes.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SupportedFeature.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SupportedFeature.java index 4b089c23756b..c380630bcaac 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SupportedFeature.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SupportedFeature.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.dataprotection.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; /** Elements class for feature request. */ @Fluent public final class SupportedFeature { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportedFeature.class); - /* * support feature type. */ @@ -33,6 +29,10 @@ public final class SupportedFeature { @JsonProperty(value = "exposureControlledFeatures") private List exposureControlledFeatures; + /** Creates an instance of SupportedFeature class. */ + public SupportedFeature() { + } + /** * Get the featureName property: support feature type. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SyncBackupInstanceRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SyncBackupInstanceRequest.java new file mode 100644 index 000000000000..7be89495a4be --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SyncBackupInstanceRequest.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.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sync BackupInstance Request. */ +@Fluent +public final class SyncBackupInstanceRequest { + /* + * Field indicating sync type e.g. to sync only in case of failure or in all cases + */ + @JsonProperty(value = "syncType") + private SyncType syncType; + + /** Creates an instance of SyncBackupInstanceRequest class. */ + public SyncBackupInstanceRequest() { + } + + /** + * Get the syncType property: Field indicating sync type e.g. to sync only in case of failure or in all cases. + * + * @return the syncType value. + */ + public SyncType syncType() { + return this.syncType; + } + + /** + * Set the syncType property: Field indicating sync type e.g. to sync only in case of failure or in all cases. + * + * @param syncType the syncType value to set. + * @return the SyncBackupInstanceRequest object itself. + */ + public SyncBackupInstanceRequest withSyncType(SyncType syncType) { + this.syncType = syncType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SyncType.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SyncType.java new file mode 100644 index 000000000000..9f7d83a18005 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SyncType.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.dataprotection.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Field indicating sync type e.g. to sync only in case of failure or in all cases. */ +public final class SyncType extends ExpandableStringEnum { + /** Static value Default for SyncType. */ + public static final SyncType DEFAULT = fromString("Default"); + + /** Static value ForceResync for SyncType. */ + public static final SyncType FORCE_RESYNC = fromString("ForceResync"); + + /** + * Creates or finds a SyncType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SyncType. + */ + @JsonCreator + public static SyncType fromString(String name) { + return fromString(name, SyncType.class); + } + + /** + * Gets known SyncType values. + * + * @return known SyncType values. + */ + public static Collection values() { + return values(SyncType.class); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TaggingCriteria.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TaggingCriteria.java index 70f1c0c1490e..62970d22adbe 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TaggingCriteria.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TaggingCriteria.java @@ -6,18 +6,18 @@ 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; -/** TaggingCriteria Tagging criteria. */ +/** + * TaggingCriteria + * + *

Tagging criteria. + */ @Fluent public final class TaggingCriteria { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TaggingCriteria.class); - /* - * Criteria which decides whether the tag can be applied to a triggered - * backup. + * Criteria which decides whether the tag can be applied to a triggered backup. */ @JsonProperty(value = "criteria") private List criteria; @@ -35,11 +35,17 @@ public final class TaggingCriteria { private long taggingPriority; /* - * RetentionTag Retention tag information + * RetentionTag + * + * Retention tag information */ @JsonProperty(value = "tagInfo", required = true) private RetentionTag tagInfo; + /** Creates an instance of TaggingCriteria class. */ + public TaggingCriteria() { + } + /** * Get the criteria property: Criteria which decides whether the tag can be applied to a triggered backup. * @@ -101,7 +107,9 @@ public TaggingCriteria withTaggingPriority(long taggingPriority) { } /** - * Get the tagInfo property: RetentionTag Retention tag information. + * Get the tagInfo property: RetentionTag + * + *

Retention tag information. * * @return the tagInfo value. */ @@ -110,7 +118,9 @@ public RetentionTag tagInfo() { } /** - * Set the tagInfo property: RetentionTag Retention tag information. + * Set the tagInfo property: RetentionTag + * + *

Retention tag information. * * @param tagInfo the tagInfo value to set. * @return the TaggingCriteria object itself. @@ -130,11 +140,13 @@ public void validate() { criteria().forEach(e -> e.validate()); } if (tagInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property tagInfo in model TaggingCriteria")); } else { tagInfo().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(TaggingCriteria.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TargetCopySetting.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TargetCopySetting.java index 2f84ba438b49..cff851fd6bd6 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TargetCopySetting.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TargetCopySetting.java @@ -6,28 +6,39 @@ 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; -/** TargetCopySetting Target copy settings. */ +/** + * TargetCopySetting + * + *

Target copy settings. + */ @Fluent public final class TargetCopySetting { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TargetCopySetting.class); - /* - * CopyOption It can be CustomCopyOption or ImmediateCopyOption. + * CopyOption + * + * It can be CustomCopyOption or ImmediateCopyOption. */ @JsonProperty(value = "copyAfter", required = true) private CopyOption copyAfter; /* - * DataStoreInfoBase Info of target datastore + * DataStoreInfoBase + * + * Info of target datastore */ @JsonProperty(value = "dataStore", required = true) private DataStoreInfoBase dataStore; + /** Creates an instance of TargetCopySetting class. */ + public TargetCopySetting() { + } + /** - * Get the copyAfter property: CopyOption It can be CustomCopyOption or ImmediateCopyOption. + * Get the copyAfter property: CopyOption + * + *

It can be CustomCopyOption or ImmediateCopyOption. * * @return the copyAfter value. */ @@ -36,7 +47,9 @@ public CopyOption copyAfter() { } /** - * Set the copyAfter property: CopyOption It can be CustomCopyOption or ImmediateCopyOption. + * Set the copyAfter property: CopyOption + * + *

It can be CustomCopyOption or ImmediateCopyOption. * * @param copyAfter the copyAfter value to set. * @return the TargetCopySetting object itself. @@ -47,7 +60,9 @@ public TargetCopySetting withCopyAfter(CopyOption copyAfter) { } /** - * Get the dataStore property: DataStoreInfoBase Info of target datastore. + * Get the dataStore property: DataStoreInfoBase + * + *

Info of target datastore. * * @return the dataStore value. */ @@ -56,7 +71,9 @@ public DataStoreInfoBase dataStore() { } /** - * Set the dataStore property: DataStoreInfoBase Info of target datastore. + * Set the dataStore property: DataStoreInfoBase + * + *

Info of target datastore. * * @param dataStore the dataStore value to set. * @return the TargetCopySetting object itself. @@ -73,18 +90,20 @@ public TargetCopySetting withDataStore(DataStoreInfoBase dataStore) { */ public void validate() { if (copyAfter() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property copyAfter in model TargetCopySetting")); } else { copyAfter().validate(); } if (dataStore() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property dataStore in model TargetCopySetting")); } else { dataStore().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(TargetCopySetting.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TargetDetails.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TargetDetails.java index 8c005dcb0806..a4dd4eb3778d 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TargetDetails.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TargetDetails.java @@ -6,17 +6,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.JsonProperty; /** Class encapsulating target details, used where the destination is not a datasource. */ @Fluent public final class TargetDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TargetDetails.class); - /* - * Restore operation may create multiple files inside location pointed by - * Url + * Restore operation may create multiple files inside location pointed by Url * Below will be the common prefix for all of them */ @JsonProperty(value = "filePrefix", required = true) @@ -31,12 +27,15 @@ public final class TargetDetails { private RestoreTargetLocationType restoreTargetLocationType; /* - * Url denoting the restore destination. It can point to container / file - * share etc + * Url denoting the restore destination. It can point to container / file share etc */ @JsonProperty(value = "url", required = true) private String url; + /** Creates an instance of TargetDetails class. */ + public TargetDetails() { + } + /** * Get the filePrefix property: Restore operation may create multiple files inside location pointed by Url Below * will be the common prefix for all of them. @@ -108,20 +107,22 @@ public TargetDetails withUrl(String url) { */ public void validate() { if (filePrefix() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property filePrefix in model TargetDetails")); } if (restoreTargetLocationType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property restoreTargetLocationType in model TargetDetails")); } if (url() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property url in model TargetDetails")); } } + + private static final ClientLogger LOGGER = new ClientLogger(TargetDetails.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TriggerBackupRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TriggerBackupRequest.java index c147a2a0eafd..ec95b25d8124 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TriggerBackupRequest.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TriggerBackupRequest.java @@ -6,24 +6,31 @@ 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; -/** TriggerBackupRequest Trigger backup request. */ +/** + * TriggerBackupRequest + * + *

Trigger backup request. + */ @Fluent public final class TriggerBackupRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggerBackupRequest.class); - /* - * AdHocBackupRuleOptions Name for the Rule of the Policy which needs to be - * applied for this backup + * AdHocBackupRuleOptions + * + * Name for the Rule of the Policy which needs to be applied for this backup */ @JsonProperty(value = "backupRuleOptions", required = true) private AdHocBackupRuleOptions backupRuleOptions; + /** Creates an instance of TriggerBackupRequest class. */ + public TriggerBackupRequest() { + } + /** - * Get the backupRuleOptions property: AdHocBackupRuleOptions Name for the Rule of the Policy which needs to be - * applied for this backup. + * Get the backupRuleOptions property: AdHocBackupRuleOptions + * + *

Name for the Rule of the Policy which needs to be applied for this backup. * * @return the backupRuleOptions value. */ @@ -32,8 +39,9 @@ public AdHocBackupRuleOptions backupRuleOptions() { } /** - * Set the backupRuleOptions property: AdHocBackupRuleOptions Name for the Rule of the Policy which needs to be - * applied for this backup. + * Set the backupRuleOptions property: AdHocBackupRuleOptions + * + *

Name for the Rule of the Policy which needs to be applied for this backup. * * @param backupRuleOptions the backupRuleOptions value to set. * @return the TriggerBackupRequest object itself. @@ -50,7 +58,7 @@ public TriggerBackupRequest withBackupRuleOptions(AdHocBackupRuleOptions backupR */ public void validate() { if (backupRuleOptions() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property backupRuleOptions in model TriggerBackupRequest")); @@ -58,4 +66,6 @@ public void validate() { backupRuleOptions().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(TriggerBackupRequest.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TriggerContext.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TriggerContext.java index de2763ef4465..6d31be04c6be 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TriggerContext.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/TriggerContext.java @@ -5,13 +5,15 @@ package com.azure.resourcemanager.dataprotection.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; -/** TriggerContext Trigger context. */ +/** + * TriggerContext + * + *

Trigger context. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -24,7 +26,9 @@ }) @Immutable public class TriggerContext { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggerContext.class); + /** Creates an instance of TriggerContext class. */ + public TriggerContext() { + } /** * Validates the instance. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/UnlockDeleteRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/UnlockDeleteRequest.java new file mode 100644 index 000000000000..fe324d2d291e --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/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.dataprotection.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Request body of unlock delete API. */ +@Fluent +public final class UnlockDeleteRequest { + /* + * The resourceGuardOperationRequests property. + */ + @JsonProperty(value = "resourceGuardOperationRequests") + private List resourceGuardOperationRequests; + + /* + * The resourceToBeDeleted property. + */ + @JsonProperty(value = "resourceToBeDeleted") + private String resourceToBeDeleted; + + /** Creates an instance of UnlockDeleteRequest class. */ + public UnlockDeleteRequest() { + } + + /** + * 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/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/UnlockDeleteResponse.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/UnlockDeleteResponse.java new file mode 100644 index 000000000000..70ba49be1512 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/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.dataprotection.models; + +import com.azure.resourcemanager.dataprotection.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.dataprotection.fluent.models.UnlockDeleteResponseInner object. + * + * @return the inner object. + */ + UnlockDeleteResponseInner innerModel(); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/UserFacingError.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/UserFacingError.java index d92904d1ca88..f23fe2526be7 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/UserFacingError.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/UserFacingError.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.dataprotection.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.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -15,8 +13,6 @@ /** Error object used by layers that have access to localized content, and propagate that to user. */ @Fluent public final class UserFacingError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserFacingError.class); - /* * Unique code for this error */ @@ -30,7 +26,9 @@ public final class UserFacingError { private List details; /* - * InnerError Inner Error + * InnerError + * + * Inner Error */ @JsonProperty(value = "innerError") private InnerError innerError; @@ -72,6 +70,10 @@ public final class UserFacingError { @JsonProperty(value = "target") private String target; + /** Creates an instance of UserFacingError class. */ + public UserFacingError() { + } + /** * Get the code property: Unique code for this error. * @@ -113,7 +115,9 @@ public UserFacingError withDetails(List details) { } /** - * Get the innerError property: InnerError Inner Error. + * Get the innerError property: InnerError + * + *

Inner Error. * * @return the innerError value. */ @@ -122,7 +126,9 @@ public InnerError innerError() { } /** - * Set the innerError property: InnerError Inner Error. + * Set the innerError property: InnerError + * + *

Inner Error. * * @param innerError the innerError value to set. * @return the UserFacingError object itself. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ValidateForBackupRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ValidateForBackupRequest.java index a40f07d68d30..5c1cdfb33665 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ValidateForBackupRequest.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ValidateForBackupRequest.java @@ -6,20 +6,25 @@ 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; -/** ValidateForBackupRequest Validate for backup request. */ +/** + * ValidateForBackupRequest + * + *

Validate for backup request. + */ @Fluent public final class ValidateForBackupRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateForBackupRequest.class); - /* * Backup Instance */ @JsonProperty(value = "backupInstance", required = true) private BackupInstance backupInstance; + /** Creates an instance of ValidateForBackupRequest class. */ + public ValidateForBackupRequest() { + } + /** * Get the backupInstance property: Backup Instance. * @@ -47,7 +52,7 @@ public ValidateForBackupRequest withBackupInstance(BackupInstance backupInstance */ public void validate() { if (backupInstance() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property backupInstance in model ValidateForBackupRequest")); @@ -55,4 +60,6 @@ public void validate() { backupInstance().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ValidateForBackupRequest.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ValidateRestoreRequestObject.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ValidateRestoreRequestObject.java index 7fd964193e2c..3308e273678b 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ValidateRestoreRequestObject.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ValidateRestoreRequestObject.java @@ -6,22 +6,31 @@ 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; -/** ValidateRestoreRequestObject Validate restore request object. */ +/** + * ValidateRestoreRequestObject + * + *

Validate restore request object. + */ @Fluent public final class ValidateRestoreRequestObject { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateRestoreRequestObject.class); - /* - * AzureBackupRestoreRequest Gets or sets the restore request object. + * AzureBackupRestoreRequest + * + * Gets or sets the restore request object. */ @JsonProperty(value = "restoreRequestObject", required = true) private AzureBackupRestoreRequest restoreRequestObject; + /** Creates an instance of ValidateRestoreRequestObject class. */ + public ValidateRestoreRequestObject() { + } + /** - * Get the restoreRequestObject property: AzureBackupRestoreRequest Gets or sets the restore request object. + * Get the restoreRequestObject property: AzureBackupRestoreRequest + * + *

Gets or sets the restore request object. * * @return the restoreRequestObject value. */ @@ -30,7 +39,9 @@ public AzureBackupRestoreRequest restoreRequestObject() { } /** - * Set the restoreRequestObject property: AzureBackupRestoreRequest Gets or sets the restore request object. + * Set the restoreRequestObject property: AzureBackupRestoreRequest + * + *

Gets or sets the restore request object. * * @param restoreRequestObject the restoreRequestObject value to set. * @return the ValidateRestoreRequestObject object itself. @@ -47,7 +58,7 @@ public ValidateRestoreRequestObject withRestoreRequestObject(AzureBackupRestoreR */ public void validate() { if (restoreRequestObject() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property restoreRequestObject in model ValidateRestoreRequestObject")); @@ -55,4 +66,6 @@ public void validate() { restoreRequestObject().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ValidateRestoreRequestObject.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ValidationType.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ValidationType.java new file mode 100644 index 000000000000..ea406295b5a4 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ValidationType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the type of validation. In case of DeepValidation, all validations from /validateForBackup API will run + * again. + */ +public final class ValidationType extends ExpandableStringEnum { + /** Static value ShallowValidation for ValidationType. */ + public static final ValidationType SHALLOW_VALIDATION = fromString("ShallowValidation"); + + /** Static value DeepValidation for ValidationType. */ + public static final ValidationType DEEP_VALIDATION = fromString("DeepValidation"); + + /** + * Creates or finds a ValidationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidationType. + */ + @JsonCreator + public static ValidationType fromString(String name) { + return fromString(name, ValidationType.class); + } + + /** + * Gets known ValidationType values. + * + * @return known ValidationType values. + */ + public static Collection values() { + return values(ValidationType.class); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/WeekNumber.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/WeekNumber.java index dbb3ec225635..5d03f435ea90 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/WeekNumber.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/WeekNumber.java @@ -36,7 +36,11 @@ public static WeekNumber fromString(String name) { return fromString(name, WeekNumber.class); } - /** @return known WeekNumber values. */ + /** + * Gets known WeekNumber values. + * + * @return known WeekNumber values. + */ public static Collection values() { return values(WeekNumber.class); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesAdhocBackupSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesAdhocBackupSamples.java index 79e12eda232e..d675b2b33ced 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesAdhocBackupSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesAdhocBackupSamples.java @@ -12,7 +12,7 @@ /** Samples for BackupInstances AdhocBackup. */ public final class BackupInstancesAdhocBackupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/TriggerBackup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/TriggerBackup.json */ /** * Sample code: Trigger Adhoc Backup. @@ -23,8 +23,8 @@ public static void triggerAdhocBackup(com.azure.resourcemanager.dataprotection.D manager .backupInstances() .adhocBackup( - "PratikPrivatePreviewVault1", "000pikumar", + "PratikPrivatePreviewVault1", "testInstance1", new TriggerBackupRequest() .withBackupRuleOptions( diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesCreateOrUpdateSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesCreateOrUpdateSamples.java index c53b6dad220e..5e21d0576cb2 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesCreateOrUpdateSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesCreateOrUpdateSamples.java @@ -14,12 +14,15 @@ import com.azure.resourcemanager.dataprotection.models.SecretStoreBasedAuthCredentials; import com.azure.resourcemanager.dataprotection.models.SecretStoreResource; import com.azure.resourcemanager.dataprotection.models.SecretStoreType; +import com.azure.resourcemanager.dataprotection.models.ValidationType; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** Samples for BackupInstances CreateOrUpdate. */ public final class BackupInstancesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/PutBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/PutBackupInstance.json */ /** * Sample code: Create BackupInstance. @@ -30,13 +33,14 @@ public static void createBackupInstance(com.azure.resourcemanager.dataprotection manager .backupInstances() .define("testInstance1") - .withExistingBackupVault("PratikPrivatePreviewVault1", "000pikumar") + .withExistingBackupVault("000pikumar", "PratikPrivatePreviewVault1") + .withTags(mapOf("key1", "val1")) .withProperties( new BackupInstance() .withFriendlyName("harshitbi2") .withDataSourceInfo( new Datasource() - .withDatasourceType("OssDB") + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") .withObjectType("Datasource") .withResourceId( "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb") @@ -46,7 +50,7 @@ public static void createBackupInstance(com.azure.resourcemanager.dataprotection .withResourceUri("")) .withDataSourceSetInfo( new DatasourceSet() - .withDatasourceType("OssDB") + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") .withObjectType("DatasourceSet") .withResourceId( "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest") @@ -73,7 +77,19 @@ public static void createBackupInstance(com.azure.resourcemanager.dataprotection new SecretStoreResource() .withUri("https://samplevault.vault.azure.net/secrets/credentials") .withSecretStoreType(SecretStoreType.AZURE_KEY_VAULT))) + .withValidationType(ValidationType.SHALLOW_VALIDATION) .withObjectType("BackupInstance")) .create(); } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesDeleteSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesDeleteSamples.java index 90a9126797ba..3c405f2f237e 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesDeleteSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for BackupInstances Delete. */ public final class BackupInstancesDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/DeleteBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/DeleteBackupInstance.json */ /** * Sample code: Delete BackupInstance. @@ -17,6 +17,6 @@ public final class BackupInstancesDeleteSamples { * @param manager Entry point to DataProtectionManager. */ public static void deleteBackupInstance(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { - manager.backupInstances().delete("PratikPrivatePreviewVault1", "000pikumar", "testInstance1", Context.NONE); + manager.backupInstances().delete("000pikumar", "PratikPrivatePreviewVault1", "testInstance1", Context.NONE); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesExtensionRoutingListSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesExtensionRoutingListSamples.java new file mode 100644 index 000000000000..53151b4d8634 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesExtensionRoutingListSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupInstancesExtensionRouting List. */ +public final class BackupInstancesExtensionRoutingListSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/ListBackupInstancesExtensionRouting.json + */ + /** + * Sample code: List BackupInstances associated with an azure resource. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void listBackupInstancesAssociatedWithAnAzureResource( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .backupInstancesExtensionRoutings() + .list( + "subscriptions/36d32b25-3dc7-41b0-bde1-397500644591/resourceGroups/testRG/providers/Microsoft.Compute/disks/testDisk", + Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesGetBackupInstanceOperationResultSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesGetBackupInstanceOperationResultSamples.java new file mode 100644 index 000000000000..fedf351c2131 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesGetBackupInstanceOperationResultSamples.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.dataprotection.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupInstances GetBackupInstanceOperationResult. */ +public final class BackupInstancesGetBackupInstanceOperationResultSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/GetBackupInstanceOperationResult.json + */ + /** + * Sample code: Get BackupInstanceOperationResult. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void getBackupInstanceOperationResult( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .backupInstances() + .getBackupInstanceOperationResultWithResponse( + "SampleResourceGroup", + "swaggerExample", + "testInstance1", + "YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==", + Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesGetSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesGetSamples.java index 40d26376eb34..4a4c0ad85781 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesGetSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesGetSamples.java @@ -9,7 +9,7 @@ /** Samples for BackupInstances Get. */ public final class BackupInstancesGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/GetBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/GetBackupInstance.json */ /** * Sample code: Get BackupInstance. @@ -19,6 +19,6 @@ public final class BackupInstancesGetSamples { public static void getBackupInstance(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { manager .backupInstances() - .getWithResponse("PratikPrivatePreviewVault1", "000pikumar", "testInstance1", Context.NONE); + .getWithResponse("000pikumar", "PratikPrivatePreviewVault1", "testInstance1", Context.NONE); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesListSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesListSamples.java index fd1f44ca9b85..d412173ee3a0 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesListSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesListSamples.java @@ -9,7 +9,7 @@ /** Samples for BackupInstances List. */ public final class BackupInstancesListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/ListBackupInstances.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/ListBackupInstances.json */ /** * Sample code: List BackupInstances in a Vault. @@ -18,6 +18,6 @@ public final class BackupInstancesListSamples { */ public static void listBackupInstancesInAVault( com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { - manager.backupInstances().list("PratikPrivatePreviewVault1", "000pikumar", Context.NONE); + manager.backupInstances().list("000pikumar", "PratikPrivatePreviewVault1", Context.NONE); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesResumeBackupsSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesResumeBackupsSamples.java new file mode 100644 index 000000000000..6f51899a2d5e --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesResumeBackupsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupInstances ResumeBackups. */ +public final class BackupInstancesResumeBackupsSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/ResumeBackups.json + */ + /** + * Sample code: ResumeBackups. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void resumeBackups(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager.backupInstances().resumeBackups("testrg", "testvault", "testbi", Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesResumeProtectionSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesResumeProtectionSamples.java new file mode 100644 index 000000000000..63fad6b2a643 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesResumeProtectionSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupInstances ResumeProtection. */ +public final class BackupInstancesResumeProtectionSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/ResumeProtection.json + */ + /** + * Sample code: ResumeProtection. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void resumeProtection(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager.backupInstances().resumeProtection("testrg", "testvault", "testbi", Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesStopProtectionSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesStopProtectionSamples.java new file mode 100644 index 000000000000..0f5729c5dd4a --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesStopProtectionSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupInstances StopProtection. */ +public final class BackupInstancesStopProtectionSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/StopProtection.json + */ + /** + * Sample code: StopProtection. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void stopProtection(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager.backupInstances().stopProtection("testrg", "testvault", "testbi", Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesSuspendBackupsSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesSuspendBackupsSamples.java new file mode 100644 index 000000000000..acfb837fec69 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesSuspendBackupsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.generated; + +import com.azure.core.util.Context; + +/** Samples for BackupInstances SuspendBackups. */ +public final class BackupInstancesSuspendBackupsSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/SuspendBackups.json + */ + /** + * Sample code: SuspendBackups. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void suspendBackups(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager.backupInstances().suspendBackups("testrg", "testvault", "testbi", Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesSyncBackupInstanceSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesSyncBackupInstanceSamples.java new file mode 100644 index 000000000000..36871190df88 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesSyncBackupInstanceSamples.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.dataprotection.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.dataprotection.models.SyncBackupInstanceRequest; +import com.azure.resourcemanager.dataprotection.models.SyncType; + +/** Samples for BackupInstances SyncBackupInstance. */ +public final class BackupInstancesSyncBackupInstanceSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/SyncBackupInstance.json + */ + /** + * Sample code: Sync BackupInstance. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void syncBackupInstance(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .backupInstances() + .syncBackupInstance( + "testrg", + "testvault", + "testbi", + new SyncBackupInstanceRequest().withSyncType(SyncType.DEFAULT), + Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesTriggerRehydrateSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesTriggerRehydrateSamples.java index 106eeb333f44..36299bb7e322 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesTriggerRehydrateSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesTriggerRehydrateSamples.java @@ -11,7 +11,7 @@ /** Samples for BackupInstances TriggerRehydrate. */ public final class BackupInstancesTriggerRehydrateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/TriggerRehydrate.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/TriggerRehydrate.json */ /** * Sample code: Trigger Rehydrate. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesTriggerRestoreSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesTriggerRestoreSamples.java index 4ac0953a9c25..4589d5968aad 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesTriggerRestoreSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesTriggerRestoreSamples.java @@ -6,10 +6,11 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.dataprotection.models.AzureBackupRecoveryPointBasedRestoreRequest; -import com.azure.resourcemanager.dataprotection.models.AzureBackupRestoreRequest; +import com.azure.resourcemanager.dataprotection.models.AzureBackupRestoreWithRehydrationRequest; import com.azure.resourcemanager.dataprotection.models.Datasource; import com.azure.resourcemanager.dataprotection.models.DatasourceSet; import com.azure.resourcemanager.dataprotection.models.RecoveryOption; +import com.azure.resourcemanager.dataprotection.models.RehydrationPriority; import com.azure.resourcemanager.dataprotection.models.RestoreFilesTargetInfo; import com.azure.resourcemanager.dataprotection.models.RestoreTargetInfo; import com.azure.resourcemanager.dataprotection.models.RestoreTargetLocationType; @@ -22,7 +23,7 @@ /** Samples for BackupInstances TriggerRestore. */ public final class BackupInstancesTriggerRestoreSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/TriggerRestoreAsFiles.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/TriggerRestoreAsFiles.json */ /** * Sample code: Trigger Restore As Files. @@ -33,8 +34,8 @@ public static void triggerRestoreAsFiles(com.azure.resourcemanager.dataprotectio manager .backupInstances() .triggerRestore( - "PrivatePreviewVault1", "000pikumar", + "PrivatePreviewVault1", "testInstance1", new AzureBackupRecoveryPointBasedRestoreRequest() .withRestoreTargetInfo( @@ -47,12 +48,14 @@ public static void triggerRestoreAsFiles(com.azure.resourcemanager.dataprotectio .withRestoreTargetLocationType(RestoreTargetLocationType.AZURE_BLOBS) .withUrl("https://teststorage.blob.core.windows.net/restoretest"))) .withSourceDataStoreType(SourceDataStoreType.VAULT_STORE) + .withSourceResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb") .withRecoveryPointId("hardcodedRP"), Context.NONE); } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/TriggerRestoreWithRehydration.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/TriggerRestoreWithRehydration.json */ /** * Sample code: Trigger Restore With Rehydration. @@ -64,10 +67,10 @@ public static void triggerRestoreWithRehydration( manager .backupInstances() .triggerRestore( - "PratikPrivatePreviewVault1", "000pikumar", + "PratikPrivatePreviewVault1", "testInstance1", - new AzureBackupRestoreRequest() + new AzureBackupRestoreWithRehydrationRequest() .withRestoreTargetInfo( new RestoreTargetInfo() .withRecoveryOption(RecoveryOption.FAIL_IF_EXISTS) @@ -92,12 +95,17 @@ public static void triggerRestoreWithRehydration( .withResourceName("viveksipgtest") .withResourceType("Microsoft.DBforPostgreSQL/servers") .withResourceUri(""))) - .withSourceDataStoreType(SourceDataStoreType.VAULT_STORE), + .withSourceDataStoreType(SourceDataStoreType.VAULT_STORE) + .withSourceResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb") + .withRecoveryPointId("hardcodedRP") + .withRehydrationPriority(RehydrationPriority.HIGH) + .withRehydrationRetentionDuration("7D"), Context.NONE); } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/TriggerRestore.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/TriggerRestore.json */ /** * Sample code: Trigger Restore. @@ -108,8 +116,8 @@ public static void triggerRestore(com.azure.resourcemanager.dataprotection.DataP manager .backupInstances() .triggerRestore( - "PratikPrivatePreviewVault1", "000pikumar", + "PratikPrivatePreviewVault1", "testInstance1", new AzureBackupRecoveryPointBasedRestoreRequest() .withRestoreTargetInfo( @@ -118,17 +126,17 @@ public static void triggerRestore(com.azure.resourcemanager.dataprotection.DataP .withRestoreLocation("southeastasia") .withDatasourceInfo( new Datasource() - .withDatasourceType("OssDB") + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") .withObjectType("Datasource") .withResourceId( - "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb") + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/targetdb") .withResourceLocation("") - .withResourceName("testdb") + .withResourceName("targetdb") .withResourceType("Microsoft.DBforPostgreSQL/servers/databases") .withResourceUri("")) .withDatasourceSetInfo( new DatasourceSet() - .withDatasourceType("OssDB") + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") .withObjectType("DatasourceSet") .withResourceId( "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest") @@ -143,6 +151,8 @@ public static void triggerRestore(com.azure.resourcemanager.dataprotection.DataP .withUri("https://samplevault.vault.azure.net/secrets/credentials") .withSecretStoreType(SecretStoreType.AZURE_KEY_VAULT)))) .withSourceDataStoreType(SourceDataStoreType.VAULT_STORE) + .withSourceResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb") .withRecoveryPointId("hardcodedRP"), Context.NONE); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesValidateForBackupSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesValidateForBackupSamples.java index 2757afe7d811..c37d2486c4bf 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesValidateForBackupSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesValidateForBackupSamples.java @@ -17,7 +17,7 @@ /** Samples for BackupInstances ValidateForBackup. */ public final class BackupInstancesValidateForBackupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/ValidateForBackup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/ValidateForBackup.json */ /** * Sample code: Validate For Backup. @@ -28,8 +28,8 @@ public static void validateForBackup(com.azure.resourcemanager.dataprotection.Da manager .backupInstances() .validateForBackup( - "PratikPrivatePreviewVault1", "000pikumar", + "PratikPrivatePreviewVault1", new ValidateForBackupRequest() .withBackupInstance( new BackupInstance() diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesValidateForRestoreSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesValidateForRestoreSamples.java index b25ddc8cb793..749cb3da8f48 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesValidateForRestoreSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesValidateForRestoreSamples.java @@ -19,7 +19,7 @@ /** Samples for BackupInstances ValidateForRestore. */ public final class BackupInstancesValidateForRestoreSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/ValidateRestore.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/ValidateRestore.json */ /** * Sample code: Validate Restore. @@ -30,8 +30,8 @@ public static void validateRestore(com.azure.resourcemanager.dataprotection.Data manager .backupInstances() .validateForRestore( - "PratikPrivatePreviewVault1", "000pikumar", + "PratikPrivatePreviewVault1", "testInstance1", new ValidateRestoreRequestObject() .withRestoreRequestObject( @@ -42,17 +42,17 @@ public static void validateRestore(com.azure.resourcemanager.dataprotection.Data .withRestoreLocation("southeastasia") .withDatasourceInfo( new Datasource() - .withDatasourceType("OssDB") + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") .withObjectType("Datasource") .withResourceId( - "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb") + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/targetdb") .withResourceLocation("") - .withResourceName("testdb") + .withResourceName("targetdb") .withResourceType("Microsoft.DBforPostgreSQL/servers/databases") .withResourceUri("")) .withDatasourceSetInfo( new DatasourceSet() - .withDatasourceType("OssDB") + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") .withObjectType("DatasourceSet") .withResourceId( "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest") @@ -67,6 +67,8 @@ public static void validateRestore(com.azure.resourcemanager.dataprotection.Data .withUri("https://samplevault.vault.azure.net/secrets/credentials") .withSecretStoreType(SecretStoreType.AZURE_KEY_VAULT)))) .withSourceDataStoreType(SourceDataStoreType.VAULT_STORE) + .withSourceResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb") .withRecoveryPointId("hardcodedRP")), Context.NONE); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesCreateOrUpdateSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesCreateOrUpdateSamples.java index b363fd0ce4db..3fb1b7983d12 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesCreateOrUpdateSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesCreateOrUpdateSamples.java @@ -24,7 +24,7 @@ /** Samples for BackupPolicies CreateOrUpdate. */ public final class BackupPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/PolicyCRUD/CreateOrUpdateBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/PolicyCRUD/CreateOrUpdateBackupPolicy.json */ /** * Sample code: CreateOrUpdate BackupPolicy. @@ -36,7 +36,7 @@ public static void createOrUpdateBackupPolicy( manager .backupPolicies() .define("OSSDBPolicy") - .withExistingBackupVault("PrivatePreviewVault", "000pikumar") + .withExistingBackupVault("000pikumar", "PrivatePreviewVault") .withProperties( new BackupPolicy() .withDatasourceTypes(Arrays.asList("OssDB")) diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesDeleteSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesDeleteSamples.java index 1a3e811b6154..5486d3a32263 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesDeleteSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for BackupPolicies Delete. */ public final class BackupPoliciesDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/PolicyCRUD/DeleteBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/PolicyCRUD/DeleteBackupPolicy.json */ /** * Sample code: Delete BackupPolicy. @@ -17,6 +17,6 @@ public final class BackupPoliciesDeleteSamples { * @param manager Entry point to DataProtectionManager. */ public static void deleteBackupPolicy(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { - manager.backupPolicies().deleteWithResponse("PrivatePreviewVault", "000pikumar", "OSSDBPolicy", Context.NONE); + manager.backupPolicies().deleteWithResponse("000pikumar", "PrivatePreviewVault", "OSSDBPolicy", Context.NONE); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesGetSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesGetSamples.java index ddb93a6a097e..17ada8732f7a 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesGetSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesGetSamples.java @@ -9,7 +9,7 @@ /** Samples for BackupPolicies Get. */ public final class BackupPoliciesGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/PolicyCRUD/GetBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/PolicyCRUD/GetBackupPolicy.json */ /** * Sample code: Get BackupPolicy. @@ -17,6 +17,6 @@ public final class BackupPoliciesGetSamples { * @param manager Entry point to DataProtectionManager. */ public static void getBackupPolicy(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { - manager.backupPolicies().getWithResponse("PrivatePreviewVault", "000pikumar", "OSSDBPolicy", Context.NONE); + manager.backupPolicies().getWithResponse("000pikumar", "PrivatePreviewVault", "OSSDBPolicy", Context.NONE); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesListSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesListSamples.java index eb4e74848bd2..8c69d0c5a103 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesListSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupPoliciesListSamples.java @@ -9,7 +9,7 @@ /** Samples for BackupPolicies List. */ public final class BackupPoliciesListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/PolicyCRUD/ListBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/PolicyCRUD/ListBackupPolicy.json */ /** * Sample code: List BackupPolicy. @@ -17,6 +17,6 @@ public final class BackupPoliciesListSamples { * @param manager Entry point to DataProtectionManager. */ public static void listBackupPolicy(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { - manager.backupPolicies().list("PrivatePreviewVault", "000pikumar", Context.NONE); + manager.backupPolicies().list("000pikumar", "PrivatePreviewVault", Context.NONE); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultOperationResultsGetSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultOperationResultsGetSamples.java index d18d37821973..dc90ae8bb5e2 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultOperationResultsGetSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultOperationResultsGetSamples.java @@ -9,7 +9,7 @@ /** Samples for BackupVaultOperationResults Get. */ public final class BackupVaultOperationResultsGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/GetOperationResultPatch.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/GetOperationResultPatch.json */ /** * Sample code: GetOperationResult Patch. @@ -20,8 +20,8 @@ public static void getOperationResultPatch(com.azure.resourcemanager.dataprotect manager .backupVaultOperationResults() .getWithResponse( - "swaggerExample", "SampleResourceGroup", + "swaggerExample", "YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==", Context.NONE); } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsCheckNameAvailabilitySamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsCheckNameAvailabilitySamples.java index 8b23bac108cb..0eb88ba8f530 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsCheckNameAvailabilitySamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsCheckNameAvailabilitySamples.java @@ -10,7 +10,7 @@ /** Samples for BackupVaults CheckNameAvailability. */ public final class BackupVaultsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/CheckBackupVaultsNameAvailability.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/CheckBackupVaultsNameAvailability.json */ /** * Sample code: Check BackupVaults name availability. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsCreateOrUpdateSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsCreateOrUpdateSamples.java index b7ac67a28da2..d2d93e691600 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsCreateOrUpdateSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsCreateOrUpdateSamples.java @@ -4,8 +4,11 @@ package com.azure.resourcemanager.dataprotection.generated; +import com.azure.resourcemanager.dataprotection.models.AlertsState; +import com.azure.resourcemanager.dataprotection.models.AzureMonitorAlertSettings; import com.azure.resourcemanager.dataprotection.models.BackupVault; import com.azure.resourcemanager.dataprotection.models.DppIdentityDetails; +import com.azure.resourcemanager.dataprotection.models.MonitoringSettings; import com.azure.resourcemanager.dataprotection.models.StorageSetting; import com.azure.resourcemanager.dataprotection.models.StorageSettingStoreTypes; import com.azure.resourcemanager.dataprotection.models.StorageSettingTypes; @@ -16,7 +19,7 @@ /** Samples for BackupVaults CreateOrUpdate. */ public final class BackupVaultsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/PutBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/PutBackupVault.json */ /** * Sample code: Create BackupVault. @@ -31,6 +34,10 @@ public static void createBackupVault(com.azure.resourcemanager.dataprotection.Da .withExistingResourceGroup("SampleResourceGroup") .withProperties( new BackupVault() + .withMonitoringSettings( + new MonitoringSettings() + .withAzureMonitorAlertSettings( + new AzureMonitorAlertSettings().withAlertsForAllJobFailures(AlertsState.ENABLED))) .withStorageSettings( Arrays .asList( @@ -43,7 +50,7 @@ public static void createBackupVault(com.azure.resourcemanager.dataprotection.Da } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/PutBackupVaultWithMSI.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/PutBackupVaultWithMSI.json */ /** * Sample code: Create BackupVault With MSI. @@ -59,6 +66,10 @@ public static void createBackupVaultWithMSI( .withExistingResourceGroup("SampleResourceGroup") .withProperties( new BackupVault() + .withMonitoringSettings( + new MonitoringSettings() + .withAzureMonitorAlertSettings( + new AzureMonitorAlertSettings().withAlertsForAllJobFailures(AlertsState.ENABLED))) .withStorageSettings( Arrays .asList( diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsDeleteSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsDeleteSamples.java index 4aa9c6855223..f5003a8ba0f8 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsDeleteSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for BackupVaults Delete. */ public final class BackupVaultsDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/DeleteBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/DeleteBackupVault.json */ /** * Sample code: Delete BackupVault. @@ -17,6 +17,6 @@ public final class BackupVaultsDeleteSamples { * @param manager Entry point to DataProtectionManager. */ public static void deleteBackupVault(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { - manager.backupVaults().deleteWithResponse("SampleResourceGroup", "swaggerExample", Context.NONE); + manager.backupVaults().deleteByResourceGroupWithResponse("SampleResourceGroup", "swaggerExample", Context.NONE); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsGetByResourceGroupSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsGetByResourceGroupSamples.java index a7cee1adbf92..25d684f2fe85 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsGetByResourceGroupSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for BackupVaults GetByResourceGroup. */ public final class BackupVaultsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/GetBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/GetBackupVault.json */ /** * Sample code: Get BackupVault. @@ -21,7 +21,7 @@ public static void getBackupVault(com.azure.resourcemanager.dataprotection.DataP } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/GetBackupVaultWithMSI.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/GetBackupVaultWithMSI.json */ /** * Sample code: Get BackupVault With MSI. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsListByResourceGroupSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsListByResourceGroupSamples.java index 58677cda26e8..2277673c3804 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsListByResourceGroupSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsListByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for BackupVaults ListByResourceGroup. */ public final class BackupVaultsListByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/GetBackupVaultsInResourceGroup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/GetBackupVaultsInResourceGroup.json */ /** * Sample code: Get BackupVaults in ResourceGroup. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsListSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsListSamples.java index ddce45ebbe16..9025262b9453 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsListSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsListSamples.java @@ -9,7 +9,7 @@ /** Samples for BackupVaults List. */ public final class BackupVaultsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/GetBackupVaultsInSubscription.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/GetBackupVaultsInSubscription.json */ /** * Sample code: Get BackupVaults in Subscription. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsUpdateSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsUpdateSamples.java index 28465667dd1e..a695a7cf32f9 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsUpdateSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupVaultsUpdateSamples.java @@ -5,14 +5,18 @@ package com.azure.resourcemanager.dataprotection.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.dataprotection.models.AlertsState; +import com.azure.resourcemanager.dataprotection.models.AzureMonitorAlertSettings; import com.azure.resourcemanager.dataprotection.models.BackupVaultResource; +import com.azure.resourcemanager.dataprotection.models.MonitoringSettings; +import com.azure.resourcemanager.dataprotection.models.PatchBackupVaultInput; import java.util.HashMap; import java.util.Map; /** Samples for BackupVaults Update. */ public final class BackupVaultsUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/VaultCRUD/PatchBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/VaultCRUD/PatchBackupVault.json */ /** * Sample code: Patch BackupVault. @@ -25,7 +29,16 @@ public static void patchBackupVault(com.azure.resourcemanager.dataprotection.Dat .backupVaults() .getByResourceGroupWithResponse("SampleResourceGroup", "swaggerExample", Context.NONE) .getValue(); - resource.update().withTags(mapOf("newKey", "newVal")).apply(); + resource + .update() + .withTags(mapOf("newKey", "newVal")) + .withProperties( + new PatchBackupVaultInput() + .withMonitoringSettings( + new MonitoringSettings() + .withAzureMonitorAlertSettings( + new AzureMonitorAlertSettings().withAlertsForAllJobFailures(AlertsState.ENABLED)))) + .apply(); } @SuppressWarnings("unchecked") diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DataProtectionCheckFeatureSupportSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DataProtectionCheckFeatureSupportSamples.java index bffa2dca027a..c90b3bf0ed22 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DataProtectionCheckFeatureSupportSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DataProtectionCheckFeatureSupportSamples.java @@ -11,7 +11,7 @@ /** Samples for DataProtection CheckFeatureSupport. */ public final class DataProtectionCheckFeatureSupportSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/CheckfeatureSupport.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/CheckfeatureSupport.json */ /** * Sample code: Check Azure Vm Backup Feature Support. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DataProtectionOperationsListSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DataProtectionOperationsListSamples.java index c9d238e35c22..207763262cdb 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DataProtectionOperationsListSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DataProtectionOperationsListSamples.java @@ -9,7 +9,7 @@ /** Samples for DataProtectionOperations List. */ public final class DataProtectionOperationsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/Operations/List.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/Operations/List.json */ /** * Sample code: Returns the list of supported REST operations. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DeletedBackupInstancesGetSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DeletedBackupInstancesGetSamples.java new file mode 100644 index 000000000000..86233eff319b --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DeletedBackupInstancesGetSamples.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.dataprotection.generated; + +import com.azure.core.util.Context; + +/** Samples for DeletedBackupInstances Get. */ +public final class DeletedBackupInstancesGetSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/DeletedBackupInstanceOperations/GetDeletedBackupInstance.json + */ + /** + * Sample code: Get DeletedBackupInstance. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void getDeletedBackupInstance( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .deletedBackupInstances() + .getWithResponse("000pikumar", "PratikPrivatePreviewVault1", "testInstance1", Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DeletedBackupInstancesListSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DeletedBackupInstancesListSamples.java new file mode 100644 index 000000000000..2fde269a482d --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DeletedBackupInstancesListSamples.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.dataprotection.generated; + +import com.azure.core.util.Context; + +/** Samples for DeletedBackupInstances List. */ +public final class DeletedBackupInstancesListSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/DeletedBackupInstanceOperations/ListDeletedBackupInstances.json + */ + /** + * Sample code: List DeletedBackupInstances in a Vault. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void listDeletedBackupInstancesInAVault( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager.deletedBackupInstances().list("000pikumar", "PratikPrivatePreviewVault1", Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DeletedBackupInstancesUndeleteSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DeletedBackupInstancesUndeleteSamples.java new file mode 100644 index 000000000000..8defe19d6418 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DeletedBackupInstancesUndeleteSamples.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.dataprotection.generated; + +import com.azure.core.util.Context; + +/** Samples for DeletedBackupInstances Undelete. */ +public final class DeletedBackupInstancesUndeleteSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/DeletedBackupInstanceOperations/UndeleteDeletedBackupInstance.json + */ + /** + * Sample code: Undelete Deleted BackupInstance. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void undeleteDeletedBackupInstance( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager.deletedBackupInstances().undelete("testrg", "testvault", "testbi", Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyDeleteSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyDeleteSamples.java new file mode 100644 index 000000000000..e4c15a072457 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyDeleteSamples.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.dataprotection.generated; + +import com.azure.core.util.Context; + +/** Samples for DppResourceGuardProxy Delete. */ +public final class DppResourceGuardProxyDeleteSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json + */ + /** + * Sample code: Delete ResourceGuardProxy. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void deleteResourceGuardProxy( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .dppResourceGuardProxies() + .deleteWithResponse("SampleResourceGroup", "sampleVault", "swaggerExample", Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyGetSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyGetSamples.java new file mode 100644 index 000000000000..aac49c77597e --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyGetSamples.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.dataprotection.generated; + +import com.azure.core.util.Context; + +/** Samples for DppResourceGuardProxy Get. */ +public final class DppResourceGuardProxyGetSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json + */ + /** + * Sample code: Get ResourceGuardProxy. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void getResourceGuardProxy(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .dppResourceGuardProxies() + .getWithResponse("SampleResourceGroup", "sampleVault", "swaggerExample", Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyListSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyListSamples.java new file mode 100644 index 000000000000..766170fac448 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.generated; + +import com.azure.core.util.Context; + +/** Samples for DppResourceGuardProxy List. */ +public final class DppResourceGuardProxyListSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json + */ + /** + * Sample code: Get ResourceGuardProxies. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void getResourceGuardProxies(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager.dppResourceGuardProxies().list("SampleResourceGroup", "sampleVault", Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyPutSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyPutSamples.java new file mode 100644 index 000000000000..f7c28400a66b --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyPutSamples.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.dataprotection.generated; + +import com.azure.resourcemanager.dataprotection.models.ResourceGuardProxyBase; + +/** Samples for DppResourceGuardProxy Put. */ +public final class DppResourceGuardProxyPutSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json + */ + /** + * Sample code: Create ResourceGuardProxy. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void createResourceGuardProxy( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .dppResourceGuardProxies() + .define("swaggerExample") + .withExistingBackupVault("SampleResourceGroup", "sampleVault") + .withProperties( + new ResourceGuardProxyBase() + .withResourceGuardResourceId( + "/subscriptions/f9e67185-f313-4e79-aa71-6458d429369d/resourceGroups/ResourceGuardSecurityAdminRG/providers/Microsoft.DataProtection/resourceGuards/ResourceGuardTestResource")) + .create(); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyUnlockDeleteSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyUnlockDeleteSamples.java new file mode 100644 index 000000000000..d957878e2607 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyUnlockDeleteSamples.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.dataprotection.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.dataprotection.models.UnlockDeleteRequest; +import java.util.Arrays; + +/** Samples for DppResourceGuardProxy UnlockDelete. */ +public final class DppResourceGuardProxyUnlockDeleteSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json + */ + /** + * Sample code: UnlockDelete ResourceGuardProxy. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void unlockDeleteResourceGuardProxy( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .dppResourceGuardProxies() + .unlockDeleteWithResponse( + "SampleResourceGroup", + "sampleVault", + "swaggerExample", + new UnlockDeleteRequest() + .withResourceGuardOperationRequests( + Arrays + .asList( + "/subscriptions/f9e67185-f313-4e79-aa71-6458d429369d/resourceGroups/ResourceGuardSecurityAdminRG/providers/Microsoft.DataProtection/resourceGuards/ResourceGuardTestResource/deleteBackupInstanceRequests/default")) + .withResourceToBeDeleted( + "/subscriptions/5e13b949-1218-4d18-8b99-7e12155ec4f7/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/backupVaults/sampleVault/backupInstances/TestBI9779f4de"), + Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ExportJobsOperationResultGetSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ExportJobsOperationResultGetSamples.java index cb8937195267..c32f1bae49d5 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ExportJobsOperationResultGetSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ExportJobsOperationResultGetSamples.java @@ -9,7 +9,7 @@ /** Samples for ExportJobsOperationResult Get. */ public final class ExportJobsOperationResultGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/JobCRUD/GetExportJobsOperationResult.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/JobCRUD/GetExportJobsOperationResult.json */ /** * Sample code: Get Export Jobs Operation Result. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ExportJobsTriggerSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ExportJobsTriggerSamples.java index b5ac8f2d9ea0..b9b6e4ee3d7e 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ExportJobsTriggerSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ExportJobsTriggerSamples.java @@ -9,7 +9,7 @@ /** Samples for ExportJobs Trigger. */ public final class ExportJobsTriggerSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/JobCRUD/TriggerExportJobs.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/JobCRUD/TriggerExportJobs.json */ /** * Sample code: Trigger Export Jobs. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/JobsGetSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/JobsGetSamples.java index b0a64b4ee875..7c3eeb658f9c 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/JobsGetSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/JobsGetSamples.java @@ -9,7 +9,7 @@ /** Samples for Jobs Get. */ public final class JobsGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/JobCRUD/GetJob.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/JobCRUD/GetJob.json */ /** * Sample code: Get Job. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/JobsListSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/JobsListSamples.java index fda1a0ba3685..4b6cb22bff21 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/JobsListSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/JobsListSamples.java @@ -9,7 +9,7 @@ /** Samples for Jobs List. */ public final class JobsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/JobCRUD/ListJobs.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/JobCRUD/ListJobs.json */ /** * Sample code: Get Jobs. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationResultGetSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationResultGetSamples.java index 699fe38493b4..c6ada4746c3b 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationResultGetSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationResultGetSamples.java @@ -9,7 +9,7 @@ /** Samples for OperationResult Get. */ public final class OperationResultGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/GetOperationResult.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/GetOperationResult.json */ /** * Sample code: Get OperationResult. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationStatusBackupVaultContextGetSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationStatusBackupVaultContextGetSamples.java new file mode 100644 index 000000000000..c4406ccb63f3 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationStatusBackupVaultContextGetSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.generated; + +import com.azure.core.util.Context; + +/** Samples for OperationStatusBackupVaultContext Get. */ +public final class OperationStatusBackupVaultContextGetSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/GetOperationStatusVaultContext.json + */ + /** + * Sample code: Get OperationStatus. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void getOperationStatus(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .operationStatusBackupVaultContexts() + .getWithResponse( + "SampleResourceGroup", + "swaggerExample", + "MjkxOTMyODMtYTE3My00YzJjLTg5NjctN2E4MDIxNDA3NjA2OzdjNGE2ZWRjLWJjMmItNDRkYi1hYzMzLWY1YzEwNzk5Y2EyOA==", + Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationStatusGetSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationStatusGetSamples.java index 6a74e5ea6873..c4bfdbecd8f6 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationStatusGetSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationStatusGetSamples.java @@ -9,7 +9,7 @@ /** Samples for OperationStatus Get. */ public final class OperationStatusGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/GetOperationStatus.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/GetOperationStatus.json */ /** * Sample code: Get OperationStatus. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationStatusResourceGroupContextGetByResourceGroupSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationStatusResourceGroupContextGetByResourceGroupSamples.java new file mode 100644 index 000000000000..07880efe5245 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/OperationStatusResourceGroupContextGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.generated; + +import com.azure.core.util.Context; + +/** Samples for OperationStatusResourceGroupContext GetByResourceGroup. */ +public final class OperationStatusResourceGroupContextGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/GetOperationStatusRGContext.json + */ + /** + * Sample code: Get OperationStatus. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void getOperationStatus(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .operationStatusResourceGroupContexts() + .getByResourceGroupWithResponse( + "SampleResourceGroup", + "MjkxOTMyODMtYTE3My00YzJjLTg5NjctN2E4MDIxNDA3NjA2OzdjNGE2ZWRjLWJjMmItNDRkYi1hYzMzLWY1YzEwNzk5Y2EyOA==", + Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/RecoveryPointsGetSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/RecoveryPointsGetSamples.java index ebace86c0bc7..938ef8e629da 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/RecoveryPointsGetSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/RecoveryPointsGetSamples.java @@ -9,7 +9,7 @@ /** Samples for RecoveryPoints Get. */ public final class RecoveryPointsGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/GetRecoveryPoint.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/GetRecoveryPoint.json */ /** * Sample code: Get Recovery Point. @@ -20,8 +20,8 @@ public static void getRecoveryPoint(com.azure.resourcemanager.dataprotection.Dat manager .recoveryPoints() .getWithResponse( - "PratikPrivatePreviewVault1", "000pikumar", + "PratikPrivatePreviewVault1", "testInstance1", "7fb2cddd-c5b3-44f6-a0d9-db3c4f9d5f25", Context.NONE); diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/RecoveryPointsListSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/RecoveryPointsListSamples.java index de190f8c0acb..a3e09c3fc497 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/RecoveryPointsListSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/RecoveryPointsListSamples.java @@ -9,7 +9,7 @@ /** Samples for RecoveryPoints List. */ public final class RecoveryPointsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/ListRecoveryPoints.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/ListRecoveryPoints.json */ /** * Sample code: List Recovery Points in a Vault. @@ -20,6 +20,6 @@ public static void listRecoveryPointsInAVault( com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { manager .recoveryPoints() - .list("PratikPrivatePreviewVault1", "000pikumar", "testInstance1", null, null, Context.NONE); + .list("000pikumar", "PratikPrivatePreviewVault1", "testInstance1", null, null, Context.NONE); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsDeleteSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsDeleteSamples.java index 4ce9b7b112a7..1262b291a3a5 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsDeleteSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards Delete. */ public final class ResourceGuardsDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/DeleteResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/DeleteResourceGuard.json */ /** * Sample code: Delete ResourceGuard. @@ -17,6 +17,8 @@ public final class ResourceGuardsDeleteSamples { * @param manager Entry point to DataProtectionManager. */ public static void deleteResourceGuard(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { - manager.resourceGuards().deleteWithResponse("SampleResourceGroup", "swaggerExample", Context.NONE); + manager + .resourceGuards() + .deleteByResourceGroupWithResponse("SampleResourceGroup", "swaggerExample", Context.NONE); } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetBackupSecurityPinRequestsObjectsSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetBackupSecurityPinRequestsObjectsSamples.java index d7d979d140b2..001f87941be9 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetBackupSecurityPinRequestsObjectsSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetBackupSecurityPinRequestsObjectsSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards GetBackupSecurityPinRequestsObjects. */ public final class ResourceGuardsGetBackupSecurityPinRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/ListBackupSecurityPINRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/ListBackupSecurityPINRequests.json */ /** * Sample code: List OperationsRequestObject. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetByResourceGroupSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetByResourceGroupSamples.java index bd7d222ad0d4..3b6fb7c8f4f8 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetByResourceGroupSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards GetByResourceGroup. */ public final class ResourceGuardsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetResourceGuard.json */ /** * Sample code: Get ResourceGuard. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultBackupSecurityPinRequestsObjectSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultBackupSecurityPinRequestsObjectSamples.java index 0c6d563c297f..1619e29349bf 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultBackupSecurityPinRequestsObjectSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultBackupSecurityPinRequestsObjectSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards GetDefaultBackupSecurityPinRequestsObject. */ public final class ResourceGuardsGetDefaultBackupSecurityPinRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetDefaultBackupSecurityPINRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetDefaultBackupSecurityPINRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultDeleteProtectedItemRequestsObjectSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultDeleteProtectedItemRequestsObjectSamples.java index 449e4d838a8c..564783caf074 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultDeleteProtectedItemRequestsObjectSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultDeleteProtectedItemRequestsObjectSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards GetDefaultDeleteProtectedItemRequestsObject. */ public final class ResourceGuardsGetDefaultDeleteProtectedItemRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetDefaultDeleteProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetDefaultDeleteProtectedItemRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultDeleteResourceGuardProxyRequestsObjectSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultDeleteResourceGuardProxyRequestsObjectSamples.java index 9234ccdf8495..13ee3dc8c19a 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultDeleteResourceGuardProxyRequestsObjectSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultDeleteResourceGuardProxyRequestsObjectSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards GetDefaultDeleteResourceGuardProxyRequestsObject. */ public final class ResourceGuardsGetDefaultDeleteResourceGuardProxyRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetDefaultDeleteResourceGuardProxyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetDefaultDeleteResourceGuardProxyRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultDisableSoftDeleteRequestsObjectSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultDisableSoftDeleteRequestsObjectSamples.java index 7476f1934c24..daaf53b7b66d 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultDisableSoftDeleteRequestsObjectSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultDisableSoftDeleteRequestsObjectSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards GetDefaultDisableSoftDeleteRequestsObject. */ public final class ResourceGuardsGetDefaultDisableSoftDeleteRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetDefaultDisableSoftDeleteRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetDefaultDisableSoftDeleteRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultUpdateProtectedItemRequestsObjectSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultUpdateProtectedItemRequestsObjectSamples.java index 45874a35dd1f..d2073cfcf843 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultUpdateProtectedItemRequestsObjectSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultUpdateProtectedItemRequestsObjectSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards GetDefaultUpdateProtectedItemRequestsObject. */ public final class ResourceGuardsGetDefaultUpdateProtectedItemRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetDefaultUpdateProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetDefaultUpdateProtectedItemRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultUpdateProtectionPolicyRequestsObjectSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultUpdateProtectionPolicyRequestsObjectSamples.java index 47abe872c179..0b1107c49390 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultUpdateProtectionPolicyRequestsObjectSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDefaultUpdateProtectionPolicyRequestsObjectSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards GetDefaultUpdateProtectionPolicyRequestsObject. */ public final class ResourceGuardsGetDefaultUpdateProtectionPolicyRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetDefaultUpdateProtectionPolicyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetDefaultUpdateProtectionPolicyRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDeleteProtectedItemRequestsObjectsSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDeleteProtectedItemRequestsObjectsSamples.java index 02d685082788..c0e939afa752 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDeleteProtectedItemRequestsObjectsSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDeleteProtectedItemRequestsObjectsSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards GetDeleteProtectedItemRequestsObjects. */ public final class ResourceGuardsGetDeleteProtectedItemRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/ListDeleteProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/ListDeleteProtectedItemRequests.json */ /** * Sample code: List OperationsRequestObject. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDeleteResourceGuardProxyRequestsObjectsSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDeleteResourceGuardProxyRequestsObjectsSamples.java index 2133d8ca860c..a87a81a16ef5 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDeleteResourceGuardProxyRequestsObjectsSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDeleteResourceGuardProxyRequestsObjectsSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards GetDeleteResourceGuardProxyRequestsObjects. */ public final class ResourceGuardsGetDeleteResourceGuardProxyRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/ListDeleteResourceGuardProxyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/ListDeleteResourceGuardProxyRequests.json */ /** * Sample code: List OperationsRequestObject. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDisableSoftDeleteRequestsObjectsSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDisableSoftDeleteRequestsObjectsSamples.java index d3151261133b..fe1d8e5a54f0 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDisableSoftDeleteRequestsObjectsSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetDisableSoftDeleteRequestsObjectsSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards GetDisableSoftDeleteRequestsObjects. */ public final class ResourceGuardsGetDisableSoftDeleteRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/ListDisableSoftDeleteRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/ListDisableSoftDeleteRequests.json */ /** * Sample code: List OperationsRequestObject. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetUpdateProtectedItemRequestsObjectsSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetUpdateProtectedItemRequestsObjectsSamples.java index 5f1289c44352..329a4f09eebf 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetUpdateProtectedItemRequestsObjectsSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetUpdateProtectedItemRequestsObjectsSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards GetUpdateProtectedItemRequestsObjects. */ public final class ResourceGuardsGetUpdateProtectedItemRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/ListUpdateProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/ListUpdateProtectedItemRequests.json */ /** * Sample code: List OperationsRequestObject. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetUpdateProtectionPolicyRequestsObjectsSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetUpdateProtectionPolicyRequestsObjectsSamples.java index 6ff75eda06d9..228fc9f3425b 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetUpdateProtectionPolicyRequestsObjectsSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsGetUpdateProtectionPolicyRequestsObjectsSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards GetUpdateProtectionPolicyRequestsObjects. */ public final class ResourceGuardsGetUpdateProtectionPolicyRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/ListUpdateProtectionPolicyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/ListUpdateProtectionPolicyRequests.json */ /** * Sample code: List OperationsRequestObject. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsListByResourceGroupSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsListByResourceGroupSamples.java index 76dd20906556..247ef02c2bdd 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsListByResourceGroupSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsListByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards ListByResourceGroup. */ public final class ResourceGuardsListByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetResourceGuardsInResourceGroup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetResourceGuardsInResourceGroup.json */ /** * Sample code: Get ResourceGuards in ResourceGroup. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsListSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsListSamples.java index d180da6eb9ae..f1991f4fb4f9 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsListSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsListSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceGuards List. */ public final class ResourceGuardsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/GetResourceGuardsInSubscription.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/GetResourceGuardsInSubscription.json */ /** * Sample code: Get ResourceGuards in Subscription. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsPatchSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsPatchSamples.java index 69a7c863358c..5d335e138424 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsPatchSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsPatchSamples.java @@ -12,7 +12,7 @@ /** Samples for ResourceGuards Patch. */ public final class ResourceGuardsPatchSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/PatchResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/PatchResourceGuard.json */ /** * Sample code: Patch ResourceGuard. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsPutSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsPutSamples.java index 11d842a4788f..d645ece3bbf2 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsPutSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/ResourceGuardsPutSamples.java @@ -10,7 +10,7 @@ /** Samples for ResourceGuards Put. */ public final class ResourceGuardsPutSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/ResourceGuardCRUD/PutResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/ResourceGuardCRUD/PutResourceGuard.json */ /** * Sample code: Create ResourceGuard. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/RestorableTimeRangesFindSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/RestorableTimeRangesFindSamples.java index 38f78cfbf5c7..b6fbb05dbb49 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/RestorableTimeRangesFindSamples.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/RestorableTimeRangesFindSamples.java @@ -11,7 +11,7 @@ /** Samples for RestorableTimeRanges Find. */ public final class RestorableTimeRangesFindSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/examples/BackupInstanceOperations/FindRestorableTimeRanges.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-11-01-preview/examples/BackupInstanceOperations/FindRestorableTimeRanges.json */ /** * Sample code: Find Restorable Time Ranges. @@ -23,8 +23,8 @@ public static void findRestorableTimeRanges( manager .restorableTimeRanges() .findWithResponse( - "ZBlobBackupVaultBVTD3", "Blob-Backup", + "ZBlobBackupVaultBVTD3", "zblobbackuptestsa58", new AzureBackupFindRestorableTimeRangesRequest() .withSourceDataStoreType(RestoreSourceDataStoreType.OPERATIONAL_STORE)