diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/CHANGELOG.md b/sdk/dataprotection/azure-resourcemanager-dataprotection/CHANGELOG.md index 699e8a053eff..58952085962b 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.4 (Unreleased) +## 1.0.0-beta.1 (2023-05-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-2023-04. 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 f1b326820986..ef2364c23fbd 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-2023-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for DataProtection Management SDK. Open API 2.0 Specs for Azure Data Protection service. Package tag package-preview-2023-04. 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.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/SAMPLE.md b/sdk/dataprotection/azure-resourcemanager-dataprotection/SAMPLE.md index a63e83878af7..daf9674464eb 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/SAMPLE.md +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/SAMPLE.md @@ -14,11 +14,17 @@ - [StopProtection](#backupinstances_stopprotection) - [SuspendBackups](#backupinstances_suspendbackups) - [SyncBackupInstance](#backupinstances_syncbackupinstance) +- [TriggerCrossRegionRestore](#backupinstances_triggercrossregionrestore) - [TriggerRehydrate](#backupinstances_triggerrehydrate) - [TriggerRestore](#backupinstances_triggerrestore) +- [ValidateCrossRegionRestore](#backupinstances_validatecrossregionrestore) - [ValidateForBackup](#backupinstances_validateforbackup) - [ValidateForRestore](#backupinstances_validateforrestore) +## BackupInstancesExtensionRouting + +- [List](#backupinstancesextensionrouting_list) + ## BackupPolicies - [CreateOrUpdate](#backuppolicies_createorupdate) @@ -40,6 +46,14 @@ - [ListByResourceGroup](#backupvaults_listbyresourcegroup) - [Update](#backupvaults_update) +## CrossRegionRestoreJob + +- [Get](#crossregionrestorejob_get) + +## CrossRegionRestoreJobsOperation + +- [List](#crossregionrestorejobsoperation_list) + ## DataProtection - [CheckFeatureSupport](#dataprotection_checkfeaturesupport) @@ -54,6 +68,14 @@ - [List](#deletedbackupinstances_list) - [Undelete](#deletedbackupinstances_undelete) +## DppResourceGuardProxy + +- [CreateOrUpdate](#dppresourceguardproxy_createorupdate) +- [Delete](#dppresourceguardproxy_delete) +- [Get](#dppresourceguardproxy_get) +- [List](#dppresourceguardproxy_list) +- [UnlockDelete](#dppresourceguardproxy_unlockdelete) + ## ExportJobs - [Trigger](#exportjobs_trigger) @@ -112,6 +134,10 @@ ## RestorableTimeRanges - [Find](#restorabletimeranges_find) + +## SecondaryRPs + +- [Fetch](#secondaryrps_fetch) ### BackupInstances_AdhocBackup ```java @@ -122,7 +148,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/2023-01-01/examples/BackupInstanceOperations/TriggerBackup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/TriggerBackup.json */ /** * Sample code: Trigger Adhoc Backup. @@ -167,7 +193,7 @@ import java.util.Map; /** Samples for BackupInstances CreateOrUpdate. */ public final class BackupInstancesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/PutBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/PutBackupInstance.json */ /** * Sample code: Create BackupInstance. @@ -246,7 +272,7 @@ public final class BackupInstancesCreateOrUpdateSamples { /** Samples for BackupInstances Delete. */ public final class BackupInstancesDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/DeleteBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/DeleteBackupInstance.json */ /** * Sample code: Delete BackupInstance. @@ -267,7 +293,7 @@ public final class BackupInstancesDeleteSamples { /** Samples for BackupInstances Get. */ public final class BackupInstancesGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/GetBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/GetBackupInstance.json */ /** * Sample code: Get BackupInstance. @@ -289,7 +315,7 @@ public final class BackupInstancesGetSamples { /** Samples for BackupInstances GetBackupInstanceOperationResult. */ public final class BackupInstancesGetBackupInstanceOperationResultSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/GetBackupInstanceOperationResult.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/GetBackupInstanceOperationResult.json */ /** * Sample code: Get BackupInstanceOperationResult. @@ -316,7 +342,7 @@ public final class BackupInstancesGetBackupInstanceOperationResultSamples { /** Samples for BackupInstances List. */ public final class BackupInstancesListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/ListBackupInstances.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/ListBackupInstances.json */ /** * Sample code: List BackupInstances in a Vault. @@ -336,7 +362,7 @@ public final class BackupInstancesListSamples { /** Samples for BackupInstances ResumeBackups. */ public final class BackupInstancesResumeBackupsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/ResumeBackups.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/ResumeBackups.json */ /** * Sample code: ResumeBackups. @@ -355,7 +381,7 @@ public final class BackupInstancesResumeBackupsSamples { /** Samples for BackupInstances ResumeProtection. */ public final class BackupInstancesResumeProtectionSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/ResumeProtection.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/ResumeProtection.json */ /** * Sample code: ResumeProtection. @@ -374,7 +400,7 @@ public final class BackupInstancesResumeProtectionSamples { /** Samples for BackupInstances StopProtection. */ public final class BackupInstancesStopProtectionSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/StopProtection.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/StopProtection.json */ /** * Sample code: StopProtection. @@ -393,7 +419,7 @@ public final class BackupInstancesStopProtectionSamples { /** Samples for BackupInstances SuspendBackups. */ public final class BackupInstancesSuspendBackupsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/SuspendBackups.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/SuspendBackups.json */ /** * Sample code: SuspendBackups. @@ -415,7 +441,7 @@ 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/stable/2023-01-01/examples/BackupInstanceOperations/SyncBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/SyncBackupInstance.json */ /** * Sample code: Sync BackupInstance. @@ -435,6 +461,85 @@ public final class BackupInstancesSyncBackupInstanceSamples { } ``` +### BackupInstances_TriggerCrossRegionRestore + +```java +import com.azure.resourcemanager.dataprotection.models.AzureBackupRecoveryPointBasedRestoreRequest; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreDetails; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreRequestObject; +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.RestoreTargetInfo; +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.SourceDataStoreType; + +/** Samples for BackupInstances TriggerCrossRegionRestore. */ +public final class BackupInstancesTriggerCrossRegionRestoreSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/CrossRegionRestore/TriggerCrossRegionRestore.json + */ + /** + * Sample code: Trigger Cross Region Restore. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void triggerCrossRegionRestore( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .backupInstances() + .triggerCrossRegionRestore( + "000pikumar", + "EastAsia", + new CrossRegionRestoreRequestObject() + .withRestoreRequestObject( + new AzureBackupRecoveryPointBasedRestoreRequest() + .withRestoreTargetInfo( + new RestoreTargetInfo() + .withRecoveryOption(RecoveryOption.FAIL_IF_EXISTS) + .withRestoreLocation("southeastasia") + .withDatasourceInfo( + new Datasource() + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") + .withObjectType("Datasource") + .withResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/targetdb") + .withResourceLocation("") + .withResourceName("targetdb") + .withResourceType("Microsoft.DBforPostgreSQL/servers/databases") + .withResourceUri("")) + .withDatasourceSetInfo( + new DatasourceSet() + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") + .withObjectType("DatasourceSet") + .withResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest") + .withResourceLocation("") + .withResourceName("viveksipgtest") + .withResourceType("Microsoft.DBforPostgreSQL/servers") + .withResourceUri("")) + .withDatasourceAuthCredentials( + new SecretStoreBasedAuthCredentials() + .withSecretStoreResource( + new SecretStoreResource() + .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")) + .withCrossRegionRestoreDetails( + new CrossRegionRestoreDetails() + .withSourceRegion("east asia") + .withSourceBackupInstanceId( + "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/BackupInstances/harshitbi1")), + com.azure.core.util.Context.NONE); + } +} +``` + ### BackupInstances_TriggerRehydrate ```java @@ -444,7 +549,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/2023-01-01/examples/BackupInstanceOperations/TriggerRehydrate.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/TriggerRehydrate.json */ /** * Sample code: Trigger Rehydrate. @@ -488,7 +593,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/2023-01-01/examples/BackupInstanceOperations/TriggerRestoreAsFiles.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/TriggerRestoreAsFiles.json */ /** * Sample code: Trigger Restore As Files. @@ -520,7 +625,7 @@ public final class BackupInstancesTriggerRestoreSamples { } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/TriggerRestoreWithRehydration.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/TriggerRestoreWithRehydration.json */ /** * Sample code: Trigger Restore With Rehydration. @@ -570,7 +675,7 @@ public final class BackupInstancesTriggerRestoreSamples { } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/TriggerRestore.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/TriggerRestore.json */ /** * Sample code: Trigger Restore. @@ -624,6 +729,85 @@ public final class BackupInstancesTriggerRestoreSamples { } ``` +### BackupInstances_ValidateCrossRegionRestore + +```java +import com.azure.resourcemanager.dataprotection.models.AzureBackupRecoveryPointBasedRestoreRequest; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreDetails; +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.RestoreTargetInfo; +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.SourceDataStoreType; +import com.azure.resourcemanager.dataprotection.models.ValidateCrossRegionRestoreRequestObject; + +/** Samples for BackupInstances ValidateCrossRegionRestore. */ +public final class BackupInstancesValidateCrossRegionRestoreSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/CrossRegionRestore/ValidateCrossRegionRestore.json + */ + /** + * Sample code: Validate Cross Region Restore. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void validateCrossRegionRestore( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .backupInstances() + .validateCrossRegionRestore( + "000pikumar", + "EastAsia", + new ValidateCrossRegionRestoreRequestObject() + .withRestoreRequestObject( + new AzureBackupRecoveryPointBasedRestoreRequest() + .withRestoreTargetInfo( + new RestoreTargetInfo() + .withRecoveryOption(RecoveryOption.FAIL_IF_EXISTS) + .withRestoreLocation("southeastasia") + .withDatasourceInfo( + new Datasource() + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") + .withObjectType("Datasource") + .withResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/targetdb") + .withResourceLocation("") + .withResourceName("targetdb") + .withResourceType("Microsoft.DBforPostgreSQL/servers/databases") + .withResourceUri("")) + .withDatasourceSetInfo( + new DatasourceSet() + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") + .withObjectType("DatasourceSet") + .withResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest") + .withResourceLocation("") + .withResourceName("viveksipgtest") + .withResourceType("Microsoft.DBforPostgreSQL/servers") + .withResourceUri("")) + .withDatasourceAuthCredentials( + new SecretStoreBasedAuthCredentials() + .withSecretStoreResource( + new SecretStoreResource() + .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")) + .withCrossRegionRestoreDetails( + new CrossRegionRestoreDetails() + .withSourceRegion("east asia") + .withSourceBackupInstanceId( + "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/BackupInstances/harshitbi1")), + com.azure.core.util.Context.NONE); + } +} +``` + ### BackupInstances_ValidateForBackup ```java @@ -639,7 +823,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/2023-01-01/examples/BackupInstanceOperations/ValidateForBackup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/ValidateForBackup.json */ /** * Sample code: Validate For Backup. @@ -709,7 +893,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/2023-01-01/examples/BackupInstanceOperations/ValidateRestore.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/ValidateRestore.json */ /** * Sample code: Validate Restore. @@ -765,6 +949,30 @@ public final class BackupInstancesValidateForRestoreSamples { } ``` +### BackupInstancesExtensionRouting_List + +```java +/** Samples for BackupInstancesExtensionRouting List. */ +public final class BackupInstancesExtensionRoutingListSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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", + com.azure.core.util.Context.NONE); + } +} +``` + ### BackupPolicies_CreateOrUpdate ```java @@ -788,7 +996,7 @@ import java.util.Arrays; /** Samples for BackupPolicies CreateOrUpdate. */ public final class BackupPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/PolicyCRUD/CreateOrUpdateBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/PolicyCRUD/CreateOrUpdateBackupPolicy.json */ /** * Sample code: CreateOrUpdate BackupPolicy. @@ -878,7 +1086,7 @@ public final class BackupPoliciesCreateOrUpdateSamples { /** Samples for BackupPolicies Delete. */ public final class BackupPoliciesDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/PolicyCRUD/DeleteBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/PolicyCRUD/DeleteBackupPolicy.json */ /** * Sample code: Delete BackupPolicy. @@ -899,7 +1107,7 @@ public final class BackupPoliciesDeleteSamples { /** Samples for BackupPolicies Get. */ public final class BackupPoliciesGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/PolicyCRUD/GetBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/PolicyCRUD/GetBackupPolicy.json */ /** * Sample code: Get BackupPolicy. @@ -920,7 +1128,7 @@ public final class BackupPoliciesGetSamples { /** Samples for BackupPolicies List. */ public final class BackupPoliciesListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/PolicyCRUD/ListBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/PolicyCRUD/ListBackupPolicy.json */ /** * Sample code: List BackupPolicy. @@ -939,7 +1147,7 @@ public final class BackupPoliciesListSamples { /** Samples for BackupVaultOperationResults Get. */ public final class BackupVaultOperationResultsGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/GetOperationResultPatch.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/GetOperationResultPatch.json */ /** * Sample code: GetOperationResult Patch. @@ -966,7 +1174,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/2023-01-01/examples/VaultCRUD/CheckBackupVaultsNameAvailability.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/CheckBackupVaultsNameAvailability.json */ /** * Sample code: Check BackupVaults name availability. @@ -994,8 +1202,14 @@ public final class BackupVaultsCheckNameAvailabilitySamples { 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.CrossRegionRestoreSettings; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreState; import com.azure.resourcemanager.dataprotection.models.DppIdentityDetails; +import com.azure.resourcemanager.dataprotection.models.FeatureSettings; import com.azure.resourcemanager.dataprotection.models.MonitoringSettings; +import com.azure.resourcemanager.dataprotection.models.SecuritySettings; +import com.azure.resourcemanager.dataprotection.models.SoftDeleteSettings; +import com.azure.resourcemanager.dataprotection.models.SoftDeleteState; import com.azure.resourcemanager.dataprotection.models.StorageSetting; import com.azure.resourcemanager.dataprotection.models.StorageSettingStoreTypes; import com.azure.resourcemanager.dataprotection.models.StorageSettingTypes; @@ -1006,7 +1220,7 @@ import java.util.Map; /** Samples for BackupVaults CreateOrUpdate. */ public final class BackupVaultsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/PutBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/PutBackupVault.json */ /** * Sample code: Create BackupVault. @@ -1025,19 +1239,29 @@ public final class BackupVaultsCreateOrUpdateSamples { new MonitoringSettings() .withAzureMonitorAlertSettings( new AzureMonitorAlertSettings().withAlertsForAllJobFailures(AlertsState.ENABLED))) + .withSecuritySettings( + new SecuritySettings() + .withSoftDeleteSettings( + new SoftDeleteSettings() + .withState(SoftDeleteState.fromString("Enabled")) + .withRetentionDurationInDays(14.0D))) .withStorageSettings( Arrays .asList( new StorageSetting() .withDatastoreType(StorageSettingStoreTypes.VAULT_STORE) - .withType(StorageSettingTypes.LOCALLY_REDUNDANT)))) + .withType(StorageSettingTypes.LOCALLY_REDUNDANT))) + .withFeatureSettings( + new FeatureSettings() + .withCrossRegionRestoreSettings( + new CrossRegionRestoreSettings().withState(CrossRegionRestoreState.ENABLED)))) .withTags(mapOf("key1", "val1")) .withIdentity(new DppIdentityDetails().withType("None")) .create(); } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/PutBackupVaultWithMSI.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/PutBackupVaultWithMSI.json */ /** * Sample code: Create BackupVault With MSI. @@ -1057,12 +1281,22 @@ public final class BackupVaultsCreateOrUpdateSamples { new MonitoringSettings() .withAzureMonitorAlertSettings( new AzureMonitorAlertSettings().withAlertsForAllJobFailures(AlertsState.ENABLED))) + .withSecuritySettings( + new SecuritySettings() + .withSoftDeleteSettings( + new SoftDeleteSettings() + .withState(SoftDeleteState.fromString("Enabled")) + .withRetentionDurationInDays(14.0D))) .withStorageSettings( Arrays .asList( new StorageSetting() .withDatastoreType(StorageSettingStoreTypes.VAULT_STORE) - .withType(StorageSettingTypes.LOCALLY_REDUNDANT)))) + .withType(StorageSettingTypes.LOCALLY_REDUNDANT))) + .withFeatureSettings( + new FeatureSettings() + .withCrossRegionRestoreSettings( + new CrossRegionRestoreSettings().withState(CrossRegionRestoreState.ENABLED)))) .withTags(mapOf("key1", "val1")) .withIdentity(new DppIdentityDetails().withType("systemAssigned")) .create(); @@ -1087,7 +1321,7 @@ public final class BackupVaultsCreateOrUpdateSamples { /** Samples for BackupVaults Delete. */ public final class BackupVaultsDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/DeleteBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/DeleteBackupVault.json */ /** * Sample code: Delete BackupVault. @@ -1106,7 +1340,7 @@ public final class BackupVaultsDeleteSamples { /** Samples for BackupVaults GetByResourceGroup. */ public final class BackupVaultsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/GetBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/GetBackupVault.json */ /** * Sample code: Get BackupVault. @@ -1120,7 +1354,7 @@ public final class BackupVaultsGetByResourceGroupSamples { } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/GetBackupVaultWithMSI.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/GetBackupVaultWithMSI.json */ /** * Sample code: Get BackupVault With MSI. @@ -1141,7 +1375,7 @@ public final class BackupVaultsGetByResourceGroupSamples { /** Samples for BackupVaults List. */ public final class BackupVaultsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/GetBackupVaultsInSubscription.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/GetBackupVaultsInSubscription.json */ /** * Sample code: Get BackupVaults in Subscription. @@ -1161,7 +1395,7 @@ public final class BackupVaultsListSamples { /** Samples for BackupVaults ListByResourceGroup. */ public final class BackupVaultsListByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/GetBackupVaultsInResourceGroup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/GetBackupVaultsInResourceGroup.json */ /** * Sample code: Get BackupVaults in ResourceGroup. @@ -1189,7 +1423,7 @@ import java.util.Map; /** Samples for BackupVaults Update. */ public final class BackupVaultsUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/PatchBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/PatchBackupVault.json */ /** * Sample code: Patch BackupVault. @@ -1228,6 +1462,69 @@ public final class BackupVaultsUpdateSamples { } ``` +### CrossRegionRestoreJob_Get + +```java +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobRequest; + +/** Samples for CrossRegionRestoreJob Get. */ +public final class CrossRegionRestoreJobGetSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/CrossRegionRestore/FetchCrossRegionRestoreJob.json + */ + /** + * Sample code: Get Cross Region Restore Job. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void getCrossRegionRestoreJob( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .crossRegionRestoreJobs() + .getWithResponse( + "BugBash1", + "west us", + new CrossRegionRestoreJobRequest() + .withSourceRegion("east us") + .withSourceBackupVaultId( + "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11") + .withJobId("3c60cb49-63e8-4b21-b9bd-26277b3fdfae"), + com.azure.core.util.Context.NONE); + } +} +``` + +### CrossRegionRestoreJobsOperation_List + +```java +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobsRequest; + +/** Samples for CrossRegionRestoreJobsOperation List. */ +public final class CrossRegionRestoreJobsOperationListSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/CrossRegionRestore/FetchCrossRegionRestoreJobs.json + */ + /** + * Sample code: List Cross Region Restore Jobs. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void listCrossRegionRestoreJobs( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .crossRegionRestoreJobsOperations() + .list( + "BugBash1", + "east us", + new CrossRegionRestoreJobsRequest() + .withSourceRegion("east us") + .withSourceBackupVaultId( + "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11"), + com.azure.core.util.Context.NONE); + } +} +``` + ### DataProtection_CheckFeatureSupport ```java @@ -1237,7 +1534,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/2023-01-01/examples/CheckfeatureSupport.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/CheckfeatureSupport.json */ /** * Sample code: Check Azure Vm Backup Feature Support. @@ -1262,7 +1559,7 @@ public final class DataProtectionCheckFeatureSupportSamples { /** Samples for DataProtectionOperations List. */ public final class DataProtectionOperationsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/Operations/List.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/Operations/List.json */ /** * Sample code: Returns the list of supported REST operations. @@ -1282,7 +1579,7 @@ public final class DataProtectionOperationsListSamples { /** Samples for DeletedBackupInstances Get. */ public final class DeletedBackupInstancesGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/DeletedBackupInstanceOperations/GetDeletedBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/DeletedBackupInstanceOperations/GetDeletedBackupInstance.json */ /** * Sample code: Get DeletedBackupInstance. @@ -1305,7 +1602,7 @@ public final class DeletedBackupInstancesGetSamples { /** Samples for DeletedBackupInstances List. */ public final class DeletedBackupInstancesListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/DeletedBackupInstanceOperations/ListDeletedBackupInstances.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/DeletedBackupInstanceOperations/ListDeletedBackupInstances.json */ /** * Sample code: List DeletedBackupInstances in a Vault. @@ -1327,7 +1624,7 @@ public final class DeletedBackupInstancesListSamples { /** Samples for DeletedBackupInstances Undelete. */ public final class DeletedBackupInstancesUndeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/DeletedBackupInstanceOperations/UndeleteDeletedBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/DeletedBackupInstanceOperations/UndeleteDeletedBackupInstance.json */ /** * Sample code: Undelete Deleted BackupInstance. @@ -1341,13 +1638,142 @@ public final class DeletedBackupInstancesUndeleteSamples { } ``` +### DppResourceGuardProxy_CreateOrUpdate + +```java +import com.azure.resourcemanager.dataprotection.models.ResourceGuardProxyBase; + +/** Samples for DppResourceGuardProxy CreateOrUpdate. */ +public final class DppResourceGuardProxyCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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_Delete + +```java +/** Samples for DppResourceGuardProxy Delete. */ +public final class DppResourceGuardProxyDeleteSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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", com.azure.core.util.Context.NONE); + } +} +``` + +### DppResourceGuardProxy_Get + +```java +/** Samples for DppResourceGuardProxy Get. */ +public final class DppResourceGuardProxyGetSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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", com.azure.core.util.Context.NONE); + } +} +``` + +### DppResourceGuardProxy_List + +```java +/** Samples for DppResourceGuardProxy List. */ +public final class DppResourceGuardProxyListSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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", com.azure.core.util.Context.NONE); + } +} +``` + +### DppResourceGuardProxy_UnlockDelete + +```java +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/2023-04-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"), + com.azure.core.util.Context.NONE); + } +} +``` + ### ExportJobs_Trigger ```java /** Samples for ExportJobs Trigger. */ public final class ExportJobsTriggerSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/JobCRUD/TriggerExportJobs.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/JobCRUD/TriggerExportJobs.json */ /** * Sample code: Trigger Export Jobs. @@ -1366,7 +1792,7 @@ public final class ExportJobsTriggerSamples { /** Samples for ExportJobsOperationResult Get. */ public final class ExportJobsOperationResultGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/JobCRUD/GetExportJobsOperationResult.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/JobCRUD/GetExportJobsOperationResult.json */ /** * Sample code: Get Export Jobs Operation Result. @@ -1392,7 +1818,7 @@ public final class ExportJobsOperationResultGetSamples { /** Samples for Jobs Get. */ public final class JobsGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/JobCRUD/GetJob.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/JobCRUD/GetJob.json */ /** * Sample code: Get Job. @@ -1417,7 +1843,7 @@ public final class JobsGetSamples { /** Samples for Jobs List. */ public final class JobsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/JobCRUD/ListJobs.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/JobCRUD/ListJobs.json */ /** * Sample code: Get Jobs. @@ -1436,7 +1862,7 @@ public final class JobsListSamples { /** Samples for OperationResult Get. */ public final class OperationResultGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/GetOperationResult.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/GetOperationResult.json */ /** * Sample code: Get OperationResult. @@ -1460,7 +1886,7 @@ public final class OperationResultGetSamples { /** Samples for OperationStatus Get. */ public final class OperationStatusGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/GetOperationStatus.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/GetOperationStatus.json */ /** * Sample code: Get OperationStatus. @@ -1484,7 +1910,7 @@ public final class OperationStatusGetSamples { /** Samples for OperationStatusBackupVaultContext Get. */ public final class OperationStatusBackupVaultContextGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/GetOperationStatusVaultContext.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/GetOperationStatusVaultContext.json */ /** * Sample code: Get OperationStatus. @@ -1509,7 +1935,7 @@ public final class OperationStatusBackupVaultContextGetSamples { /** Samples for OperationStatusResourceGroupContext GetByResourceGroup. */ public final class OperationStatusResourceGroupContextGetByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/GetOperationStatusRGContext.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/GetOperationStatusRGContext.json */ /** * Sample code: Get OperationStatus. @@ -1533,7 +1959,7 @@ public final class OperationStatusResourceGroupContextGetByResourceGroupSamples /** Samples for RecoveryPoints Get. */ public final class RecoveryPointsGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/GetRecoveryPoint.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/GetRecoveryPoint.json */ /** * Sample code: Get Recovery Point. @@ -1559,7 +1985,7 @@ public final class RecoveryPointsGetSamples { /** Samples for RecoveryPoints List. */ public final class RecoveryPointsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/ListRecoveryPoints.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/ListRecoveryPoints.json */ /** * Sample code: List Recovery Points in a Vault. @@ -1587,7 +2013,7 @@ public final class RecoveryPointsListSamples { /** Samples for ResourceGuards Delete. */ public final class ResourceGuardsDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/DeleteResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/DeleteResourceGuard.json */ /** * Sample code: Delete ResourceGuard. @@ -1609,7 +2035,7 @@ public final class ResourceGuardsDeleteSamples { /** Samples for ResourceGuards GetBackupSecurityPinRequestsObjects. */ public final class ResourceGuardsGetBackupSecurityPinRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/ListBackupSecurityPINRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/ListBackupSecurityPINRequests.json */ /** * Sample code: List OperationsRequestObject. @@ -1632,7 +2058,7 @@ public final class ResourceGuardsGetBackupSecurityPinRequestsObjectsSamples { /** Samples for ResourceGuards GetByResourceGroup. */ public final class ResourceGuardsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/GetResourceGuard.json */ /** * Sample code: Get ResourceGuard. @@ -1653,7 +2079,7 @@ public final class ResourceGuardsGetByResourceGroupSamples { /** Samples for ResourceGuards GetDefaultBackupSecurityPinRequestsObject. */ public final class ResourceGuardsGetDefaultBackupSecurityPinRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultBackupSecurityPINRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/GetDefaultBackupSecurityPINRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. @@ -1676,7 +2102,7 @@ public final class ResourceGuardsGetDefaultBackupSecurityPinRequestsObjectSample /** Samples for ResourceGuards GetDefaultDeleteProtectedItemRequestsObject. */ public final class ResourceGuardsGetDefaultDeleteProtectedItemRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultDeleteProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/GetDefaultDeleteProtectedItemRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. @@ -1699,7 +2125,7 @@ public final class ResourceGuardsGetDefaultDeleteProtectedItemRequestsObjectSamp /** Samples for ResourceGuards GetDefaultDeleteResourceGuardProxyRequestsObject. */ public final class ResourceGuardsGetDefaultDeleteResourceGuardProxyRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultDeleteResourceGuardProxyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/GetDefaultDeleteResourceGuardProxyRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. @@ -1722,7 +2148,7 @@ public final class ResourceGuardsGetDefaultDeleteResourceGuardProxyRequestsObjec /** Samples for ResourceGuards GetDefaultDisableSoftDeleteRequestsObject. */ public final class ResourceGuardsGetDefaultDisableSoftDeleteRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultDisableSoftDeleteRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/GetDefaultDisableSoftDeleteRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. @@ -1745,7 +2171,7 @@ public final class ResourceGuardsGetDefaultDisableSoftDeleteRequestsObjectSample /** Samples for ResourceGuards GetDefaultUpdateProtectedItemRequestsObject. */ public final class ResourceGuardsGetDefaultUpdateProtectedItemRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultUpdateProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/GetDefaultUpdateProtectedItemRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. @@ -1768,7 +2194,7 @@ public final class ResourceGuardsGetDefaultUpdateProtectedItemRequestsObjectSamp /** Samples for ResourceGuards GetDefaultUpdateProtectionPolicyRequestsObject. */ public final class ResourceGuardsGetDefaultUpdateProtectionPolicyRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultUpdateProtectionPolicyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/GetDefaultUpdateProtectionPolicyRequests.json */ /** * Sample code: Get DefaultOperationsRequestObject. @@ -1791,7 +2217,7 @@ public final class ResourceGuardsGetDefaultUpdateProtectionPolicyRequestsObjectS /** Samples for ResourceGuards GetDeleteProtectedItemRequestsObjects. */ public final class ResourceGuardsGetDeleteProtectedItemRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/ListDeleteProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/ListDeleteProtectedItemRequests.json */ /** * Sample code: List OperationsRequestObject. @@ -1814,7 +2240,7 @@ public final class ResourceGuardsGetDeleteProtectedItemRequestsObjectsSamples { /** Samples for ResourceGuards GetDeleteResourceGuardProxyRequestsObjects. */ public final class ResourceGuardsGetDeleteResourceGuardProxyRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/ListDeleteResourceGuardProxyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/ListDeleteResourceGuardProxyRequests.json */ /** * Sample code: List OperationsRequestObject. @@ -1837,7 +2263,7 @@ public final class ResourceGuardsGetDeleteResourceGuardProxyRequestsObjectsSampl /** Samples for ResourceGuards GetDisableSoftDeleteRequestsObjects. */ public final class ResourceGuardsGetDisableSoftDeleteRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/ListDisableSoftDeleteRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/ListDisableSoftDeleteRequests.json */ /** * Sample code: List OperationsRequestObject. @@ -1860,7 +2286,7 @@ public final class ResourceGuardsGetDisableSoftDeleteRequestsObjectsSamples { /** Samples for ResourceGuards GetUpdateProtectedItemRequestsObjects. */ public final class ResourceGuardsGetUpdateProtectedItemRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/ListUpdateProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/ListUpdateProtectedItemRequests.json */ /** * Sample code: List OperationsRequestObject. @@ -1883,7 +2309,7 @@ public final class ResourceGuardsGetUpdateProtectedItemRequestsObjectsSamples { /** Samples for ResourceGuards GetUpdateProtectionPolicyRequestsObjects. */ public final class ResourceGuardsGetUpdateProtectionPolicyRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/ListUpdateProtectionPolicyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/ListUpdateProtectionPolicyRequests.json */ /** * Sample code: List OperationsRequestObject. @@ -1906,7 +2332,7 @@ public final class ResourceGuardsGetUpdateProtectionPolicyRequestsObjectsSamples /** Samples for ResourceGuards List. */ public final class ResourceGuardsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetResourceGuardsInSubscription.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/GetResourceGuardsInSubscription.json */ /** * Sample code: Get ResourceGuards in Subscription. @@ -1926,7 +2352,7 @@ public final class ResourceGuardsListSamples { /** Samples for ResourceGuards ListByResourceGroup. */ public final class ResourceGuardsListByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetResourceGuardsInResourceGroup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/GetResourceGuardsInResourceGroup.json */ /** * Sample code: Get ResourceGuards in ResourceGroup. @@ -1950,7 +2376,7 @@ import java.util.Map; /** Samples for ResourceGuards Patch. */ public final class ResourceGuardsPatchSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/PatchResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/PatchResourceGuard.json */ /** * Sample code: Patch ResourceGuard. @@ -1989,7 +2415,7 @@ import java.util.Map; /** Samples for ResourceGuards Put. */ public final class ResourceGuardsPutSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/PutResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/PutResourceGuard.json */ /** * Sample code: Create ResourceGuard. @@ -2028,7 +2454,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/2023-01-01/examples/BackupInstanceOperations/FindRestorableTimeRanges.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/FindRestorableTimeRanges.json */ /** * Sample code: Find Restorable Time Ranges. @@ -2052,3 +2478,35 @@ public final class RestorableTimeRangesFindSamples { } ``` +### SecondaryRPs_Fetch + +```java +import com.azure.resourcemanager.dataprotection.models.FetchSecondaryRPsRequestParameters; + +/** Samples for SecondaryRPs Fetch. */ +public final class SecondaryRPsFetchSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/CrossRegionRestore/FetchSecondaryRPs.json + */ + /** + * Sample code: Fetch SecondaryRPs. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void fetchSecondaryRPs(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .secondaryRPs() + .fetch( + "000pikumar", + "WestUS", + new FetchSecondaryRPsRequestParameters() + .withSourceRegion("EastUS") + .withSourceBackupInstanceId( + "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/HelloTest/providers/Microsoft.DataProtection/backupVaults/HelloTestVault/backupInstances/653213d-c5b3-44f6-a0d9-db3c4f9d8e34"), + null, + null, + com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml b/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml index f0b295a044e4..51b6dd49c099 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,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-2023-01. + 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-2023-04. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,8 @@ UTF-8 - true + 0 + 0 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 93f9fbe01096..a15d88df1234 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 @@ -24,14 +24,18 @@ 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; import com.azure.resourcemanager.dataprotection.implementation.BackupVaultsImpl; +import com.azure.resourcemanager.dataprotection.implementation.CrossRegionRestoreJobsImpl; +import com.azure.resourcemanager.dataprotection.implementation.CrossRegionRestoreJobsOperationsImpl; 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; @@ -42,13 +46,18 @@ 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.implementation.SecondaryRPsImpl; 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.CrossRegionRestoreJobs; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobsOperations; 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; @@ -59,12 +68,12 @@ import com.azure.resourcemanager.dataprotection.models.RecoveryPoints; import com.azure.resourcemanager.dataprotection.models.ResourceGuards; import com.azure.resourcemanager.dataprotection.models.RestorableTimeRanges; +import com.azure.resourcemanager.dataprotection.models.SecondaryRPs; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; import java.util.Objects; -import java.util.UUID; import java.util.stream.Collectors; /** Entry point to DataProtectionManager. Open API 2.0 Specs for Azure Data Protection service. */ @@ -91,6 +100,14 @@ public final class DataProtectionManager { private RecoveryPoints recoveryPoints; + private SecondaryRPs secondaryRPs; + + private CrossRegionRestoreJobs crossRegionRestoreJobs; + + private CrossRegionRestoreJobsOperations crossRegionRestoreJobsOperations; + + private BackupInstancesExtensionRoutings backupInstancesExtensionRoutings; + private Jobs jobs; private RestorableTimeRanges restorableTimeRanges; @@ -103,6 +120,8 @@ public final class DataProtectionManager { private ResourceGuards resourceGuards; + private DppResourceGuardProxies dppResourceGuardProxies; + private final DataProtectionClient clientObject; private DataProtectionManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -112,7 +131,7 @@ private DataProtectionManager(HttpPipeline httpPipeline, AzureProfile profile, D new DataProtectionClientBuilder() .pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(UUID.fromString(profile.getSubscriptionId())) + .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); } @@ -268,7 +287,7 @@ public DataProtectionManager authenticate(TokenCredential credential, AzureProfi .append("-") .append("com.azure.resourcemanager.dataprotection") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -462,6 +481,57 @@ public RecoveryPoints recoveryPoints() { return recoveryPoints; } + /** + * Gets the resource collection API of SecondaryRPs. + * + * @return Resource collection API of SecondaryRPs. + */ + public SecondaryRPs secondaryRPs() { + if (this.secondaryRPs == null) { + this.secondaryRPs = new SecondaryRPsImpl(clientObject.getSecondaryRPs(), this); + } + return secondaryRPs; + } + + /** + * Gets the resource collection API of CrossRegionRestoreJobs. + * + * @return Resource collection API of CrossRegionRestoreJobs. + */ + public CrossRegionRestoreJobs crossRegionRestoreJobs() { + if (this.crossRegionRestoreJobs == null) { + this.crossRegionRestoreJobs = + new CrossRegionRestoreJobsImpl(clientObject.getCrossRegionRestoreJobs(), this); + } + return crossRegionRestoreJobs; + } + + /** + * Gets the resource collection API of CrossRegionRestoreJobsOperations. + * + * @return Resource collection API of CrossRegionRestoreJobsOperations. + */ + public CrossRegionRestoreJobsOperations crossRegionRestoreJobsOperations() { + if (this.crossRegionRestoreJobsOperations == null) { + this.crossRegionRestoreJobsOperations = + new CrossRegionRestoreJobsOperationsImpl(clientObject.getCrossRegionRestoreJobsOperations(), this); + } + return crossRegionRestoreJobsOperations; + } + + /** + * 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 Jobs. * @@ -536,6 +606,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 b2b97c863eb4..14d86ed7005c 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,8 +15,10 @@ 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.CrossRegionRestoreRequestObject; import com.azure.resourcemanager.dataprotection.models.SyncBackupInstanceRequest; import com.azure.resourcemanager.dataprotection.models.TriggerBackupRequest; +import com.azure.resourcemanager.dataprotection.models.ValidateCrossRegionRestoreRequestObject; import com.azure.resourcemanager.dataprotection.models.ValidateForBackupRequest; import com.azure.resourcemanager.dataprotection.models.ValidateRestoreRequestObject; @@ -380,6 +382,135 @@ Response getBackupInstanceOperationResultWithRespon BackupInstanceResourceInner getBackupInstanceOperationResult( String resourceGroupName, String vaultName, String backupInstanceName, String operationId); + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationJobExtendedInfoInner> beginTriggerCrossRegionRestore( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters); + + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationJobExtendedInfoInner> beginTriggerCrossRegionRestore( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters, Context context); + + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationJobExtendedInfoInner triggerCrossRegionRestore( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters); + + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationJobExtendedInfoInner triggerCrossRegionRestore( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters, Context context); + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationJobExtendedInfoInner> + beginValidateCrossRegionRestore( + String resourceGroupName, String location, ValidateCrossRegionRestoreRequestObject parameters); + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationJobExtendedInfoInner> + beginValidateCrossRegionRestore( + String resourceGroupName, + String location, + ValidateCrossRegionRestoreRequestObject parameters, + Context context); + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationJobExtendedInfoInner validateCrossRegionRestore( + String resourceGroupName, String location, ValidateCrossRegionRestoreRequestObject parameters); + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationJobExtendedInfoInner validateCrossRegionRestore( + String resourceGroupName, String location, ValidateCrossRegionRestoreRequestObject parameters, Context context); + /** * rehydrate recovery point for restore for a BackupInstance. * 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..d60a4309d8fc --- /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 of 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 of backup instances associated with a tracked resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceId); + + /** + * Gets a list of 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 of 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/CrossRegionRestoreJobsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/CrossRegionRestoreJobsClient.java new file mode 100644 index 000000000000..fd405e955816 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/CrossRegionRestoreJobsClient.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.AzureBackupJobResourceInner; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobRequest; + +/** An instance of this class provides access to all the operations defined in CrossRegionRestoreJobsClient. */ +public interface CrossRegionRestoreJobsClient { + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 azureBackup Job Resource Class along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String location, CrossRegionRestoreJobRequest parameters, Context context); + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 azureBackup Job Resource Class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureBackupJobResourceInner get(String resourceGroupName, String location, CrossRegionRestoreJobRequest parameters); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/CrossRegionRestoreJobsOperationsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/CrossRegionRestoreJobsOperationsClient.java new file mode 100644 index 000000000000..d2b5a41aa9e3 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/CrossRegionRestoreJobsOperationsClient.java @@ -0,0 +1,48 @@ +// 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.AzureBackupJobResourceInner; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobsRequest; + +/** + * An instance of this class provides access to all the operations defined in CrossRegionRestoreJobsOperationsClient. + */ +public interface CrossRegionRestoreJobsOperationsClient { + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 list of AzureBackup Job resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String location, CrossRegionRestoreJobsRequest parameters); + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 list of AzureBackup Job resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String location, CrossRegionRestoreJobsRequest parameters, Context context); +} 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 a0783217ebd5..c9f29c1b212f 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 @@ -6,7 +6,6 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -import java.util.UUID; /** The interface for DataProtectionClient class. */ public interface DataProtectionClient { @@ -15,7 +14,7 @@ public interface DataProtectionClient { * * @return the subscriptionId value. */ - UUID getSubscriptionId(); + String getSubscriptionId(); /** * Gets server parameter. @@ -122,6 +121,34 @@ public interface DataProtectionClient { */ RecoveryPointsClient getRecoveryPoints(); + /** + * Gets the SecondaryRPsClient object to access its operations. + * + * @return the SecondaryRPsClient object. + */ + SecondaryRPsClient getSecondaryRPs(); + + /** + * Gets the CrossRegionRestoreJobsClient object to access its operations. + * + * @return the CrossRegionRestoreJobsClient object. + */ + CrossRegionRestoreJobsClient getCrossRegionRestoreJobs(); + + /** + * Gets the CrossRegionRestoreJobsOperationsClient object to access its operations. + * + * @return the CrossRegionRestoreJobsOperationsClient object. + */ + CrossRegionRestoreJobsOperationsClient getCrossRegionRestoreJobsOperations(); + + /** + * Gets the BackupInstancesExtensionRoutingsClient object to access its operations. + * + * @return the BackupInstancesExtensionRoutingsClient object. + */ + BackupInstancesExtensionRoutingsClient getBackupInstancesExtensionRoutings(); + /** * Gets the JobsClient object to access its operations. * @@ -163,4 +190,11 @@ public interface DataProtectionClient { * @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/DppResourceGuardProxiesClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DppResourceGuardProxiesClient.java new file mode 100644 index 000000000000..0c65348d2f92 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DppResourceGuardProxiesClient.java @@ -0,0 +1,183 @@ +// 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 { + /** + * Returns the list of ResourceGuardProxies associated with the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Returns the list of ResourceGuardProxies associated with the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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 resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String resourceGuardProxyName, Context context); + + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceGuardProxyBaseResourceInner get(String resourceGroupName, String vaultName, String resourceGuardProxyName); + + /** + * Creates or Updates a ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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 resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + ResourceGuardProxyBaseResourceInner parameters, + Context context); + + /** + * Creates or Updates a ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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 resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceGuardProxyBaseResourceInner createOrUpdate( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + ResourceGuardProxyBaseResourceInner parameters); + + /** + * Deletes the ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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); + + /** + * Deletes the ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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); + + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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); + + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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/SecondaryRPsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/SecondaryRPsClient.java new file mode 100644 index 000000000000..b5f92b1b67d0 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/SecondaryRPsClient.java @@ -0,0 +1,55 @@ +// 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.AzureBackupRecoveryPointResourceInner; +import com.azure.resourcemanager.dataprotection.models.FetchSecondaryRPsRequestParameters; + +/** An instance of this class provides access to all the operations defined in SecondaryRPsClient. */ +public interface SecondaryRPsClient { + /** + * Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross Region + * Restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 azureBackupRecoveryPointResourceList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable fetch( + String resourceGroupName, String location, FetchSecondaryRPsRequestParameters parameters); + + /** + * Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross Region + * Restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for operation. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azureBackupRecoveryPointResourceList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable fetch( + String resourceGroupName, + String location, + FetchSecondaryRPsRequestParameters parameters, + String filter, + String skipToken, + Context context); +} 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..74f1a3ed9c83 --- /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; + +/** ResourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs. */ +@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/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/BackupInstancesClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesClientImpl.java index 292ae0e63669..8fa062a61039 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 @@ -38,12 +38,13 @@ 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.CrossRegionRestoreRequestObject; import com.azure.resourcemanager.dataprotection.models.SyncBackupInstanceRequest; import com.azure.resourcemanager.dataprotection.models.TriggerBackupRequest; +import com.azure.resourcemanager.dataprotection.models.ValidateCrossRegionRestoreRequestObject; import com.azure.resourcemanager.dataprotection.models.ValidateForBackupRequest; import com.azure.resourcemanager.dataprotection.models.ValidateRestoreRequestObject; import java.nio.ByteBuffer; -import java.util.UUID; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -75,14 +76,13 @@ public final class BackupInstancesClientImpl implements BackupInstancesClient { public interface BackupInstancesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @HeaderParam("Accept") String accept, @@ -90,14 +90,13 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @@ -106,14 +105,13 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @@ -123,14 +121,13 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @@ -139,14 +136,13 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/backup") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/backup") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> adhocBackup( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @@ -156,14 +152,13 @@ Mono>> adhocBackup( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/validateForBackup") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/validateForBackup") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> validateForBackup( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @BodyParam("application/json") ValidateForBackupRequest parameters, @@ -172,13 +167,12 @@ Mono>> validateForBackup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/operationResults/{operationId}") + "/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") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @@ -189,15 +183,44 @@ Mono> getBackupInstanceOperationResult( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/rehydrate") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/crossRegionRestore") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> triggerCrossRegionRestore( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @BodyParam("application/json") CrossRegionRestoreRequestObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/validateCrossRegionRestore") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateCrossRegionRestore( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @BodyParam("application/json") ValidateCrossRegionRestoreRequestObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/rehydrate") @ExpectedResponses({202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> triggerRehydrate( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @BodyParam("application/json") AzureBackupRehydrationRequest parameters, @@ -206,14 +229,13 @@ Mono>> triggerRehydrate( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/restore") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/restore") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> triggerRestore( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @@ -223,13 +245,12 @@ Mono>> triggerRestore( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/resumeBackups") + "/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") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @@ -239,13 +260,12 @@ Mono>> resumeBackups( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/resumeProtection") + "/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") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @@ -255,13 +275,12 @@ Mono>> resumeProtection( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/stopProtection") + "/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") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @@ -271,13 +290,12 @@ Mono>> stopProtection( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/suspendBackups") + "/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") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @@ -287,13 +305,12 @@ Mono>> suspendBackups( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/sync") + "/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") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @@ -304,14 +321,13 @@ Mono>> syncBackupInstance( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/validateRestore") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/validateRestore") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> validateForRestore( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @@ -2005,6 +2021,575 @@ public BackupInstanceResourceInner getBackupInstanceOperationResult( .getValue(); } + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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>> triggerCrossRegionRestoreWithResponseAsync( + String resourceGroupName, String location, CrossRegionRestoreRequestObject 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 + .triggerCrossRegionRestore( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + location, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerCrossRegionRestoreWithResponseAsync( + String resourceGroupName, String location, CrossRegionRestoreRequestObject 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 + .triggerCrossRegionRestore( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + location, + parameters, + accept, + context); + } + + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationJobExtendedInfoInner> + beginTriggerCrossRegionRestoreAsync( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters) { + Mono>> mono = + triggerCrossRegionRestoreWithResponseAsync(resourceGroupName, location, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationJobExtendedInfoInner.class, + OperationJobExtendedInfoInner.class, + this.client.getContext()); + } + + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationJobExtendedInfoInner> + beginTriggerCrossRegionRestoreAsync( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + triggerCrossRegionRestoreWithResponseAsync(resourceGroupName, location, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationJobExtendedInfoInner.class, + OperationJobExtendedInfoInner.class, + context); + } + + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationJobExtendedInfoInner> + beginTriggerCrossRegionRestore( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters) { + return this.beginTriggerCrossRegionRestoreAsync(resourceGroupName, location, parameters).getSyncPoller(); + } + + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationJobExtendedInfoInner> + beginTriggerCrossRegionRestore( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters, Context context) { + return this + .beginTriggerCrossRegionRestoreAsync(resourceGroupName, location, parameters, context) + .getSyncPoller(); + } + + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerCrossRegionRestoreAsync( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters) { + return beginTriggerCrossRegionRestoreAsync(resourceGroupName, location, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerCrossRegionRestoreAsync( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters, Context context) { + return beginTriggerCrossRegionRestoreAsync(resourceGroupName, location, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationJobExtendedInfoInner triggerCrossRegionRestore( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters) { + return triggerCrossRegionRestoreAsync(resourceGroupName, location, parameters).block(); + } + + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationJobExtendedInfoInner triggerCrossRegionRestore( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters, Context context) { + return triggerCrossRegionRestoreAsync(resourceGroupName, location, parameters, context).block(); + } + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateCrossRegionRestoreWithResponseAsync( + String resourceGroupName, String location, ValidateCrossRegionRestoreRequestObject 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 + .validateCrossRegionRestore( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + location, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateCrossRegionRestoreWithResponseAsync( + String resourceGroupName, + String location, + ValidateCrossRegionRestoreRequestObject 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 + .validateCrossRegionRestore( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + location, + parameters, + accept, + context); + } + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationJobExtendedInfoInner> + beginValidateCrossRegionRestoreAsync( + String resourceGroupName, String location, ValidateCrossRegionRestoreRequestObject parameters) { + Mono>> mono = + validateCrossRegionRestoreWithResponseAsync(resourceGroupName, location, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationJobExtendedInfoInner.class, + OperationJobExtendedInfoInner.class, + this.client.getContext()); + } + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationJobExtendedInfoInner> + beginValidateCrossRegionRestoreAsync( + String resourceGroupName, + String location, + ValidateCrossRegionRestoreRequestObject parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateCrossRegionRestoreWithResponseAsync(resourceGroupName, location, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationJobExtendedInfoInner.class, + OperationJobExtendedInfoInner.class, + context); + } + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationJobExtendedInfoInner> + beginValidateCrossRegionRestore( + String resourceGroupName, String location, ValidateCrossRegionRestoreRequestObject parameters) { + return this.beginValidateCrossRegionRestoreAsync(resourceGroupName, location, parameters).getSyncPoller(); + } + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationJobExtendedInfoInner> + beginValidateCrossRegionRestore( + String resourceGroupName, + String location, + ValidateCrossRegionRestoreRequestObject parameters, + Context context) { + return this + .beginValidateCrossRegionRestoreAsync(resourceGroupName, location, parameters, context) + .getSyncPoller(); + } + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateCrossRegionRestoreAsync( + String resourceGroupName, String location, ValidateCrossRegionRestoreRequestObject parameters) { + return beginValidateCrossRegionRestoreAsync(resourceGroupName, location, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateCrossRegionRestoreAsync( + String resourceGroupName, + String location, + ValidateCrossRegionRestoreRequestObject parameters, + Context context) { + return beginValidateCrossRegionRestoreAsync(resourceGroupName, location, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationJobExtendedInfoInner validateCrossRegionRestore( + String resourceGroupName, String location, ValidateCrossRegionRestoreRequestObject parameters) { + return validateCrossRegionRestoreAsync(resourceGroupName, location, parameters).block(); + } + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationJobExtendedInfoInner validateCrossRegionRestore( + String resourceGroupName, + String location, + ValidateCrossRegionRestoreRequestObject parameters, + Context context) { + return validateCrossRegionRestoreAsync(resourceGroupName, location, parameters, context).block(); + } + /** * rehydrate recovery point for restore for a BackupInstance. * 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..e3d621b706cb --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesExtensionRoutingsClientImpl.java @@ -0,0 +1,297 @@ +// 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(value = "resourceId", encoded = true) 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 of 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 of 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(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of 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 of 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(), + null)); + } + + /** + * Gets a list of 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 of 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 of 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 of 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 of 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 of 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 of 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 of 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(), + 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(), + 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 e57967c90d92..98b4ec0a3d20 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 @@ -16,9 +16,11 @@ import com.azure.resourcemanager.dataprotection.models.AzureBackupRestoreRequest; import com.azure.resourcemanager.dataprotection.models.BackupInstanceResource; import com.azure.resourcemanager.dataprotection.models.BackupInstances; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreRequestObject; 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.ValidateCrossRegionRestoreRequestObject; import com.azure.resourcemanager.dataprotection.models.ValidateForBackupRequest; import com.azure.resourcemanager.dataprotection.models.ValidateRestoreRequestObject; @@ -158,6 +160,53 @@ public BackupInstanceResource getBackupInstanceOperationResult( } } + public OperationJobExtendedInfo triggerCrossRegionRestore( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters) { + OperationJobExtendedInfoInner inner = + this.serviceClient().triggerCrossRegionRestore(resourceGroupName, location, parameters); + if (inner != null) { + return new OperationJobExtendedInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationJobExtendedInfo triggerCrossRegionRestore( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters, Context context) { + OperationJobExtendedInfoInner inner = + this.serviceClient().triggerCrossRegionRestore(resourceGroupName, location, parameters, context); + if (inner != null) { + return new OperationJobExtendedInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationJobExtendedInfo validateCrossRegionRestore( + String resourceGroupName, String location, ValidateCrossRegionRestoreRequestObject parameters) { + OperationJobExtendedInfoInner inner = + this.serviceClient().validateCrossRegionRestore(resourceGroupName, location, parameters); + if (inner != null) { + return new OperationJobExtendedInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationJobExtendedInfo validateCrossRegionRestore( + String resourceGroupName, + String location, + ValidateCrossRegionRestoreRequestObject parameters, + Context context) { + OperationJobExtendedInfoInner inner = + this.serviceClient().validateCrossRegionRestore(resourceGroupName, location, parameters, context); + if (inner != null) { + return new OperationJobExtendedInfoImpl(inner, this.manager()); + } else { + return null; + } + } + public void triggerRehydrate( String resourceGroupName, String vaultName, 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 d0b4aa92f306..ab36936cc1c3 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 @@ -31,7 +31,6 @@ import com.azure.resourcemanager.dataprotection.fluent.BackupPoliciesClient; import com.azure.resourcemanager.dataprotection.fluent.models.BaseBackupPolicyResourceInner; import com.azure.resourcemanager.dataprotection.models.BaseBackupPolicyResourceList; -import java.util.UUID; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in BackupPoliciesClient. */ @@ -62,14 +61,13 @@ public final class BackupPoliciesClientImpl implements BackupPoliciesClient { public interface BackupPoliciesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupPolicies") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @HeaderParam("Accept") String accept, @@ -77,14 +75,13 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupPolicyName") String backupPolicyName, @@ -93,14 +90,13 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupPolicyName") String backupPolicyName, @@ -110,14 +106,13 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupPolicyName") String backupPolicyName, 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 a73cf0048cb0..e147a197605c 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 @@ -23,7 +23,6 @@ import com.azure.resourcemanager.dataprotection.fluent.BackupVaultOperationResultsClient; import com.azure.resourcemanager.dataprotection.fluent.models.BackupVaultResourceInner; import com.azure.resourcemanager.dataprotection.models.BackupVaultOperationResultsGetResponse; -import java.util.UUID; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in BackupVaultOperationResultsClient. */ @@ -56,14 +55,13 @@ public final class BackupVaultOperationResultsClientImpl implements BackupVaultO public interface BackupVaultOperationResultsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/operationResults/{operationId}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/operationResults/{operationId}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("operationId") String operationId, 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 ae93db038830..effc191253ed 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 @@ -40,7 +40,6 @@ import com.azure.resourcemanager.dataprotection.models.CheckNameAvailabilityRequest; import com.azure.resourcemanager.dataprotection.models.PatchResourceRequestInput; import java.nio.ByteBuffer; -import java.util.UUID; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -77,34 +76,32 @@ public interface BackupVaultsService { Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @HeaderParam("Accept") String accept, @@ -112,14 +109,13 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @BodyParam("application/json") BackupVaultResourceInner parameters, @@ -128,14 +124,13 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @HeaderParam("Accept") String accept, @@ -143,14 +138,13 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @BodyParam("application/json") PatchResourceRequestInput parameters, @@ -159,15 +153,14 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/locations/{location}/checkNameAvailability") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/checkNameAvailability") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> checkNameAvailability( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @BodyParam("application/json") CheckNameAvailabilityRequest parameters, @HeaderParam("Accept") String accept, diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/CrossRegionRestoreJobsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/CrossRegionRestoreJobsClientImpl.java new file mode 100644 index 000000000000..e0f31b949c54 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/CrossRegionRestoreJobsClientImpl.java @@ -0,0 +1,233 @@ +// 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.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.dataprotection.fluent.CrossRegionRestoreJobsClient; +import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupJobResourceInner; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CrossRegionRestoreJobsClient. */ +public final class CrossRegionRestoreJobsClientImpl implements CrossRegionRestoreJobsClient { + /** The proxy service used to perform REST calls. */ + private final CrossRegionRestoreJobsService service; + + /** The service client containing this operation class. */ + private final DataProtectionClientImpl client; + + /** + * Initializes an instance of CrossRegionRestoreJobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrossRegionRestoreJobsClientImpl(DataProtectionClientImpl client) { + this.service = + RestProxy + .create(CrossRegionRestoreJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataProtectionClientCrossRegionRestoreJobs to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataProtectionClient") + public interface CrossRegionRestoreJobsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/fetchCrossRegionRestoreJob") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @BodyParam("application/json") CrossRegionRestoreJobRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 azureBackup Job Resource Class along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String location, CrossRegionRestoreJobRequest 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceGroupName, + this.client.getSubscriptionId(), + location, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 azureBackup Job Resource Class along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String location, CrossRegionRestoreJobRequest parameters, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceGroupName, + this.client.getSubscriptionId(), + location, + parameters, + accept, + context); + } + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 azureBackup Job Resource Class on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String location, CrossRegionRestoreJobRequest parameters) { + return getWithResponseAsync(resourceGroupName, location, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 azureBackup Job Resource Class along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String location, CrossRegionRestoreJobRequest parameters, Context context) { + return getWithResponseAsync(resourceGroupName, location, parameters, context).block(); + } + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 azureBackup Job Resource Class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureBackupJobResourceInner get( + String resourceGroupName, String location, CrossRegionRestoreJobRequest parameters) { + return getWithResponse(resourceGroupName, location, parameters, Context.NONE).getValue(); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/CrossRegionRestoreJobsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/CrossRegionRestoreJobsImpl.java new file mode 100644 index 000000000000..45cc688fcd56 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/CrossRegionRestoreJobsImpl.java @@ -0,0 +1,63 @@ +// 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.CrossRegionRestoreJobsClient; +import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupJobResourceInner; +import com.azure.resourcemanager.dataprotection.models.AzureBackupJobResource; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobRequest; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobs; + +public final class CrossRegionRestoreJobsImpl implements CrossRegionRestoreJobs { + private static final ClientLogger LOGGER = new ClientLogger(CrossRegionRestoreJobsImpl.class); + + private final CrossRegionRestoreJobsClient innerClient; + + private final com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager; + + public CrossRegionRestoreJobsImpl( + CrossRegionRestoreJobsClient innerClient, + com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String location, CrossRegionRestoreJobRequest parameters, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, location, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AzureBackupJobResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AzureBackupJobResource get( + String resourceGroupName, String location, CrossRegionRestoreJobRequest parameters) { + AzureBackupJobResourceInner inner = this.serviceClient().get(resourceGroupName, location, parameters); + if (inner != null) { + return new AzureBackupJobResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private CrossRegionRestoreJobsClient 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/CrossRegionRestoreJobsOperationsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/CrossRegionRestoreJobsOperationsClientImpl.java new file mode 100644 index 000000000000..e46d79054cb8 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/CrossRegionRestoreJobsOperationsClientImpl.java @@ -0,0 +1,370 @@ +// 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.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.dataprotection.fluent.CrossRegionRestoreJobsOperationsClient; +import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupJobResourceInner; +import com.azure.resourcemanager.dataprotection.models.AzureBackupJobResourceList; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobsRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CrossRegionRestoreJobsOperationsClient. + */ +public final class CrossRegionRestoreJobsOperationsClientImpl implements CrossRegionRestoreJobsOperationsClient { + /** The proxy service used to perform REST calls. */ + private final CrossRegionRestoreJobsOperationsService service; + + /** The service client containing this operation class. */ + private final DataProtectionClientImpl client; + + /** + * Initializes an instance of CrossRegionRestoreJobsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrossRegionRestoreJobsOperationsClientImpl(DataProtectionClientImpl client) { + this.service = + RestProxy + .create( + CrossRegionRestoreJobsOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataProtectionClientCrossRegionRestoreJobsOperations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataProtectionClient") + public interface CrossRegionRestoreJobsOperationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/fetchCrossRegionRestoreJobs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @BodyParam("application/json") CrossRegionRestoreJobsRequest 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. The name is case insensitive. + * @param location The location 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 list of AzureBackup Job resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String location, CrossRegionRestoreJobsRequest 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceGroupName, + this.client.getSubscriptionId(), + location, + parameters, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 list of AzureBackup Job resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String location, CrossRegionRestoreJobsRequest parameters, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceGroupName, + this.client.getSubscriptionId(), + location, + parameters, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 list of AzureBackup Job resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String location, CrossRegionRestoreJobsRequest parameters) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, location, parameters), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 list of AzureBackup Job resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String location, CrossRegionRestoreJobsRequest parameters, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, location, parameters, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 list of AzureBackup Job resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String location, CrossRegionRestoreJobsRequest parameters) { + return new PagedIterable<>(listAsync(resourceGroupName, location, parameters)); + } + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 list of AzureBackup Job resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String location, CrossRegionRestoreJobsRequest parameters, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, location, parameters, 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 list of AzureBackup Job 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(), + 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 AzureBackup Job 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(), + null)); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/CrossRegionRestoreJobsOperationsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/CrossRegionRestoreJobsOperationsImpl.java new file mode 100644 index 000000000000..c3c1b2bd91c7 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/CrossRegionRestoreJobsOperationsImpl.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.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dataprotection.fluent.CrossRegionRestoreJobsOperationsClient; +import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupJobResourceInner; +import com.azure.resourcemanager.dataprotection.models.AzureBackupJobResource; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobsOperations; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobsRequest; + +public final class CrossRegionRestoreJobsOperationsImpl implements CrossRegionRestoreJobsOperations { + private static final ClientLogger LOGGER = new ClientLogger(CrossRegionRestoreJobsOperationsImpl.class); + + private final CrossRegionRestoreJobsOperationsClient innerClient; + + private final com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager; + + public CrossRegionRestoreJobsOperationsImpl( + CrossRegionRestoreJobsOperationsClient innerClient, + com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String location, CrossRegionRestoreJobsRequest parameters) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, location, parameters); + return Utils.mapPage(inner, inner1 -> new AzureBackupJobResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String location, CrossRegionRestoreJobsRequest parameters, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, location, parameters, context); + return Utils.mapPage(inner, inner1 -> new AzureBackupJobResourceImpl(inner1, this.manager())); + } + + private CrossRegionRestoreJobsOperationsClient 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/DataProtectionClientBuilder.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DataProtectionClientBuilder.java index c07fefc083b1..4fcf7d3886f2 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 @@ -13,7 +13,6 @@ import com.azure.core.management.serializer.SerializerFactory; import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -import java.util.UUID; /** A builder for creating a new instance of the DataProtectionClientImpl type. */ @ServiceClientBuilder(serviceClients = {DataProtectionClientImpl.class}) @@ -21,7 +20,7 @@ public final class DataProtectionClientBuilder { /* * The ID of the target subscription. The value must be an UUID. */ - private UUID subscriptionId; + private String subscriptionId; /** * Sets The ID of the target subscription. The value must be an UUID. @@ -29,7 +28,7 @@ public final class DataProtectionClientBuilder { * @param subscriptionId the subscriptionId value. * @return the DataProtectionClientBuilder. */ - public DataProtectionClientBuilder subscriptionId(UUID subscriptionId) { + public DataProtectionClientBuilder subscriptionId(String subscriptionId) { this.subscriptionId = subscriptionId; return this; } 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 ac108ea17571..be40b7fef5bc 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 @@ -23,13 +23,17 @@ 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.CrossRegionRestoreJobsClient; +import com.azure.resourcemanager.dataprotection.fluent.CrossRegionRestoreJobsOperationsClient; 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; @@ -40,13 +44,13 @@ import com.azure.resourcemanager.dataprotection.fluent.RecoveryPointsClient; import com.azure.resourcemanager.dataprotection.fluent.ResourceGuardsClient; import com.azure.resourcemanager.dataprotection.fluent.RestorableTimeRangesClient; +import com.azure.resourcemanager.dataprotection.fluent.SecondaryRPsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.UUID; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -54,14 +58,14 @@ @ServiceClient(builder = DataProtectionClientBuilder.class) public final class DataProtectionClientImpl implements DataProtectionClient { /** The ID of the target subscription. The value must be an UUID. */ - private final UUID subscriptionId; + private final String subscriptionId; /** * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ - public UUID getSubscriptionId() { + public String getSubscriptionId() { return this.subscriptionId; } @@ -257,6 +261,54 @@ public RecoveryPointsClient getRecoveryPoints() { return this.recoveryPoints; } + /** The SecondaryRPsClient object to access its operations. */ + private final SecondaryRPsClient secondaryRPs; + + /** + * Gets the SecondaryRPsClient object to access its operations. + * + * @return the SecondaryRPsClient object. + */ + public SecondaryRPsClient getSecondaryRPs() { + return this.secondaryRPs; + } + + /** The CrossRegionRestoreJobsClient object to access its operations. */ + private final CrossRegionRestoreJobsClient crossRegionRestoreJobs; + + /** + * Gets the CrossRegionRestoreJobsClient object to access its operations. + * + * @return the CrossRegionRestoreJobsClient object. + */ + public CrossRegionRestoreJobsClient getCrossRegionRestoreJobs() { + return this.crossRegionRestoreJobs; + } + + /** The CrossRegionRestoreJobsOperationsClient object to access its operations. */ + private final CrossRegionRestoreJobsOperationsClient crossRegionRestoreJobsOperations; + + /** + * Gets the CrossRegionRestoreJobsOperationsClient object to access its operations. + * + * @return the CrossRegionRestoreJobsOperationsClient object. + */ + public CrossRegionRestoreJobsOperationsClient getCrossRegionRestoreJobsOperations() { + return this.crossRegionRestoreJobsOperations; + } + + /** 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 JobsClient object to access its operations. */ private final JobsClient jobs; @@ -329,6 +381,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. * @@ -344,14 +408,14 @@ public ResourceGuardsClient getResourceGuards() { SerializerAdapter serializerAdapter, Duration defaultPollInterval, AzureEnvironment environment, - UUID subscriptionId, + String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-01-01"; + this.apiVersion = "2023-04-01-preview"; this.backupVaults = new BackupVaultsClientImpl(this); this.operationResults = new OperationResultsClientImpl(this); this.operationStatus = new OperationStatusClientImpl(this); @@ -363,12 +427,17 @@ public ResourceGuardsClient getResourceGuards() { this.backupPolicies = new BackupPoliciesClientImpl(this); this.backupInstances = new BackupInstancesClientImpl(this); this.recoveryPoints = new RecoveryPointsClientImpl(this); + this.secondaryRPs = new SecondaryRPsClientImpl(this); + this.crossRegionRestoreJobs = new CrossRegionRestoreJobsClientImpl(this); + this.crossRegionRestoreJobsOperations = new CrossRegionRestoreJobsOperationsClientImpl(this); + this.backupInstancesExtensionRoutings = new BackupInstancesExtensionRoutingsClientImpl(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); } /** 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 c3b8b1c93516..36da3791b925 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 @@ -25,7 +25,6 @@ import com.azure.resourcemanager.dataprotection.fluent.DataProtectionsClient; import com.azure.resourcemanager.dataprotection.fluent.models.FeatureValidationResponseBaseInner; import com.azure.resourcemanager.dataprotection.models.FeatureValidationRequestBase; -import java.util.UUID; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in DataProtectionsClient. */ @@ -56,14 +55,13 @@ public final class DataProtectionsClientImpl implements DataProtectionsClient { public interface DataProtectionsService { @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}" - + "/checkFeatureSupport") + "/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/checkFeatureSupport") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> checkFeatureSupport( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @BodyParam("application/json") FeatureValidationRequestBase parameters, @HeaderParam("Accept") String accept, 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 index 3f4520e65d1d..5cdc9c5acf1e 100644 --- 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 @@ -33,7 +33,6 @@ import com.azure.resourcemanager.dataprotection.fluent.models.DeletedBackupInstanceResourceInner; import com.azure.resourcemanager.dataprotection.models.DeletedBackupInstanceResourceList; import java.nio.ByteBuffer; -import java.util.UUID; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -66,14 +65,13 @@ public final class DeletedBackupInstancesClientImpl implements DeletedBackupInst public interface DeletedBackupInstancesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/deletedBackupInstances") + "/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") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @HeaderParam("Accept") String accept, @@ -81,14 +79,13 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/deletedBackupInstances/{backupInstanceName}") + "/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") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @@ -97,14 +94,13 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/deletedBackupInstances/{backupInstanceName}/undelete") + "/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") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, 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..d3c612d676f8 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DppResourceGuardProxiesClientImpl.java @@ -0,0 +1,1123 @@ +// 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> createOrUpdate( + @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); + } + + /** + * Returns the list of ResourceGuardProxies associated with the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the list of ResourceGuardProxies associated with the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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(), + null)); + } + + /** + * Returns the list of ResourceGuardProxies associated with the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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)); + } + + /** + * Returns the list of ResourceGuardProxies associated with the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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)); + } + + /** + * Returns the list of ResourceGuardProxies associated with the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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)); + } + + /** + * Returns the list of ResourceGuardProxies associated with the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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)); + } + + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs + * 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())); + } + + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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 resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs + * 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); + } + + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs + * 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())); + } + + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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 resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs + * 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(); + } + + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceGuardProxyBaseResourceInner get( + String resourceGroupName, String vaultName, String resourceGuardProxyName) { + return getWithResponse(resourceGroupName, vaultName, resourceGuardProxyName, Context.NONE).getValue(); + } + + /** + * Creates or Updates a ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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 resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + 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 + .createOrUpdate( + 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())); + } + + /** + * Creates or Updates a ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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 resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + 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 + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + resourceGuardProxyName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates or Updates a ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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 resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + ResourceGuardProxyBaseResourceInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, resourceGuardProxyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or Updates a ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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 resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + ResourceGuardProxyBaseResourceInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, vaultName, resourceGuardProxyName, parameters, context) + .block(); + } + + /** + * Creates or Updates a ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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 resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceGuardProxyBaseResourceInner createOrUpdate( + String resourceGroupName, + String vaultName, + String resourceGuardProxyName, + ResourceGuardProxyBaseResourceInner parameters) { + return createOrUpdateWithResponse( + resourceGroupName, vaultName, resourceGuardProxyName, parameters, Context.NONE) + .getValue(); + } + + /** + * Deletes the ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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())); + } + + /** + * Deletes the ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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); + } + + /** + * Deletes the ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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()); + } + + /** + * Deletes the ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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(); + } + + /** + * Deletes the ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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); + } + + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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())); + } + + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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); + } + + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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())); + } + + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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(); + } + + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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(), + 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(), + 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 8720157e96ee..9b15ab425b84 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 @@ -26,7 +26,6 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.dataprotection.fluent.ExportJobsClient; import java.nio.ByteBuffer; -import java.util.UUID; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -58,14 +57,13 @@ public final class ExportJobsClientImpl implements ExportJobsClient { public interface ExportJobsService { @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/exportBackupJobs") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/exportBackupJobs") @ExpectedResponses({202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> trigger( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @HeaderParam("Accept") String accept, 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 de3525676c63..a396d1120518 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 @@ -23,7 +23,6 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.dataprotection.fluent.ExportJobsOperationResultsClient; import com.azure.resourcemanager.dataprotection.fluent.models.ExportJobsResultInner; -import java.util.UUID; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in ExportJobsOperationResultsClient. */ @@ -56,14 +55,13 @@ public final class ExportJobsOperationResultsClientImpl implements ExportJobsOpe public interface ExportJobsOperationResultsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupJobs/operations/{operationId}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/operations/{operationId}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("operationId") String operationId, 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 9b65cc879517..d51c7a5da666 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 @@ -28,7 +28,6 @@ import com.azure.resourcemanager.dataprotection.fluent.JobsClient; import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupJobResourceInner; import com.azure.resourcemanager.dataprotection.models.AzureBackupJobResourceList; -import java.util.UUID; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in JobsClient. */ @@ -58,14 +57,13 @@ public final class JobsClientImpl implements JobsClient { public interface JobsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupJobs") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @HeaderParam("Accept") String accept, @@ -73,14 +71,13 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupJobs/{jobId}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/{jobId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("jobId") String jobId, 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 78c4d9ae3b81..99d117d502d5 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 @@ -23,7 +23,6 @@ import com.azure.resourcemanager.dataprotection.fluent.OperationResultsClient; import com.azure.resourcemanager.dataprotection.fluent.models.OperationJobExtendedInfoInner; import com.azure.resourcemanager.dataprotection.models.OperationResultsGetResponse; -import java.util.UUID; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationResultsClient. */ @@ -54,14 +53,13 @@ public final class OperationResultsClientImpl implements OperationResultsClient public interface OperationResultsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationResults" - + "/{operationId}") + "/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationResults/{operationId}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("operationId") String operationId, @PathParam("location") String location, @HeaderParam("Accept") String accept, 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 index c0dd5e121dda..6249467cbd58 100644 --- 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 @@ -23,7 +23,6 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.dataprotection.fluent.OperationStatusBackupVaultContextsClient; import com.azure.resourcemanager.dataprotection.fluent.models.OperationResourceInner; -import java.util.UUID; import reactor.core.publisher.Mono; /** @@ -60,13 +59,12 @@ public final class OperationStatusBackupVaultContextsClientImpl implements Opera public interface OperationStatusBackupVaultContextsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/operationStatus/{operationId}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/operationStatus/{operationId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("operationId") String operationId, 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 1579ee18cc7b..fdc735d8f12e 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 @@ -23,7 +23,6 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.dataprotection.fluent.OperationStatusClient; import com.azure.resourcemanager.dataprotection.fluent.models.OperationResourceInner; -import java.util.UUID; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationStatusClient. */ @@ -54,14 +53,13 @@ public final class OperationStatusClientImpl implements OperationStatusClient { public interface OperationStatusService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationStatus" - + "/{operationId}") + "/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationStatus/{operationId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, 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 index 41084e46d827..957f20e81b2c 100644 --- 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 @@ -23,7 +23,6 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.dataprotection.fluent.OperationStatusResourceGroupContextsClient; import com.azure.resourcemanager.dataprotection.fluent.models.OperationResourceInner; -import java.util.UUID; import reactor.core.publisher.Mono; /** @@ -62,15 +61,14 @@ public final class OperationStatusResourceGroupContextsClientImpl public interface OperationStatusResourceGroupContextsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/operationStatus/{operationId}") + "/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") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); 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 be66ce1d085e..17b8270d8026 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 @@ -28,7 +28,6 @@ import com.azure.resourcemanager.dataprotection.fluent.RecoveryPointsClient; import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupRecoveryPointResourceInner; import com.azure.resourcemanager.dataprotection.models.AzureBackupRecoveryPointResourceList; -import java.util.UUID; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in RecoveryPointsClient. */ @@ -59,14 +58,13 @@ public final class RecoveryPointsClientImpl implements RecoveryPointsClient { public interface RecoveryPointsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, @@ -77,14 +75,13 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints/{recoveryPointId}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints/{recoveryPointId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, 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..9660797cfd29 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardProxyBaseResourceImpl.java @@ -0,0 +1,169 @@ +// 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() + .createOrUpdateWithResponse( + resourceGroupName, vaultName, resourceGuardProxyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ResourceGuardProxyBaseResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDppResourceGuardProxies() + .createOrUpdateWithResponse( + 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() + .createOrUpdateWithResponse( + resourceGroupName, vaultName, resourceGuardProxyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ResourceGuardProxyBaseResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDppResourceGuardProxies() + .createOrUpdateWithResponse( + 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/ResourceGuardsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/ResourceGuardsClientImpl.java index d6dee868b073..d3f9ae7bb1ff 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 @@ -35,7 +35,6 @@ import com.azure.resourcemanager.dataprotection.models.DppBaseResourceList; import com.azure.resourcemanager.dataprotection.models.PatchResourceGuardInput; import com.azure.resourcemanager.dataprotection.models.ResourceGuardResourceList; -import java.util.UUID; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in ResourceGuardsClient. */ @@ -71,35 +70,33 @@ public interface ResourceGuardsService { Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> put( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @BodyParam("application/json") ResourceGuardResourceInner parameters, @HeaderParam("Accept") String accept, @@ -107,45 +104,42 @@ Mono> put( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> patch( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @BodyParam("application/json") PatchResourceGuardInput parameters, @HeaderParam("Accept") String accept, @@ -153,105 +147,98 @@ Mono> patch( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}/disableSoftDeleteRequests") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/disableSoftDeleteRequests") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getDisableSoftDeleteRequestsObjects( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}/deleteResourceGuardProxyRequests") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteResourceGuardProxyRequests") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getDeleteResourceGuardProxyRequestsObjects( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}/getBackupSecurityPINRequests") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/getBackupSecurityPINRequests") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getBackupSecurityPinRequestsObjects( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}/deleteProtectedItemRequests") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteProtectedItemRequests") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getDeleteProtectedItemRequestsObjects( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}/updateProtectionPolicyRequests") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectionPolicyRequests") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getUpdateProtectionPolicyRequestsObjects( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}/updateProtectedItemRequests") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectedItemRequests") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getUpdateProtectedItemRequestsObjects( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}/disableSoftDeleteRequests/{requestName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/disableSoftDeleteRequests/{requestName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getDefaultDisableSoftDeleteRequestsObject( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @PathParam("requestName") String requestName, @HeaderParam("Accept") String accept, @@ -259,15 +246,14 @@ Mono> getDefaultDisableSoftDeleteRequestsObject( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}/deleteResourceGuardProxyRequests/{requestName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteResourceGuardProxyRequests/{requestName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getDefaultDeleteResourceGuardProxyRequestsObject( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @PathParam("requestName") String requestName, @HeaderParam("Accept") String accept, @@ -275,15 +261,14 @@ Mono> getDefaultDeleteResourceGuardProxyRequestsO @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}/getBackupSecurityPINRequests/{requestName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/getBackupSecurityPINRequests/{requestName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getDefaultBackupSecurityPinRequestsObject( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @PathParam("requestName") String requestName, @HeaderParam("Accept") String accept, @@ -291,15 +276,14 @@ Mono> getDefaultBackupSecurityPinRequestsObject( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}/deleteProtectedItemRequests/{requestName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteProtectedItemRequests/{requestName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getDefaultDeleteProtectedItemRequestsObject( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @PathParam("requestName") String requestName, @HeaderParam("Accept") String accept, @@ -307,15 +291,14 @@ Mono> getDefaultDeleteProtectedItemRequestsObject @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}/updateProtectionPolicyRequests/{requestName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectionPolicyRequests/{requestName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getDefaultUpdateProtectionPolicyRequestsObject( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @PathParam("requestName") String requestName, @HeaderParam("Accept") String accept, @@ -323,15 +306,14 @@ Mono> getDefaultUpdateProtectionPolicyRequestsObj @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/resourceGuards/{resourceGuardsName}/updateProtectedItemRequests/{requestName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectedItemRequests/{requestName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getDefaultUpdateProtectedItemRequestsObject( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGuardsName") String resourceGuardsName, @PathParam("requestName") String requestName, @HeaderParam("Accept") String accept, 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 eb66fb2c4b48..0b3cad71ea5e 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 @@ -25,7 +25,6 @@ import com.azure.resourcemanager.dataprotection.fluent.RestorableTimeRangesClient; import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupFindRestorableTimeRangesResponseResourceInner; import com.azure.resourcemanager.dataprotection.models.AzureBackupFindRestorableTimeRangesRequest; -import java.util.UUID; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in RestorableTimeRangesClient. */ @@ -57,14 +56,13 @@ public final class RestorableTimeRangesClientImpl implements RestorableTimeRange public interface RestorableTimeRangesService { @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection" - + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/findRestorableTimeRanges") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/findRestorableTimeRanges") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> find( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") UUID subscriptionId, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("backupInstanceName") String backupInstanceName, diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/SecondaryRPsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/SecondaryRPsClientImpl.java new file mode 100644 index 000000000000..09667fcfae67 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/SecondaryRPsClientImpl.java @@ -0,0 +1,434 @@ +// 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.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.dataprotection.fluent.SecondaryRPsClient; +import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupRecoveryPointResourceInner; +import com.azure.resourcemanager.dataprotection.models.AzureBackupRecoveryPointResourceList; +import com.azure.resourcemanager.dataprotection.models.FetchSecondaryRPsRequestParameters; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SecondaryRPsClient. */ +public final class SecondaryRPsClientImpl implements SecondaryRPsClient { + /** The proxy service used to perform REST calls. */ + private final SecondaryRPsService service; + + /** The service client containing this operation class. */ + private final DataProtectionClientImpl client; + + /** + * Initializes an instance of SecondaryRPsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecondaryRPsClientImpl(DataProtectionClientImpl client) { + this.service = + RestProxy.create(SecondaryRPsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataProtectionClientSecondaryRPs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataProtectionClient") + public interface SecondaryRPsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/fetchSecondaryRecoveryPoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> fetch( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, + @BodyParam("application/json") FetchSecondaryRPsRequestParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> fetchNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross Region + * Restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for operation. + * @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> fetchSinglePageAsync( + String resourceGroupName, + String location, + FetchSecondaryRPsRequestParameters parameters, + String filter, + String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 + .fetch( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + location, + filter, + skipToken, + parameters, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross Region + * Restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for operation. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azureBackupRecoveryPointResourceList along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> fetchSinglePageAsync( + String resourceGroupName, + String location, + FetchSecondaryRPsRequestParameters parameters, + String filter, + String skipToken, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 + .fetch( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + location, + filter, + skipToken, + parameters, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross Region + * Restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for operation. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux fetchAsync( + String resourceGroupName, + String location, + FetchSecondaryRPsRequestParameters parameters, + String filter, + String skipToken) { + return new PagedFlux<>( + () -> fetchSinglePageAsync(resourceGroupName, location, parameters, filter, skipToken), + nextLink -> fetchNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross Region + * Restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 azureBackupRecoveryPointResourceList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux fetchAsync( + String resourceGroupName, String location, FetchSecondaryRPsRequestParameters parameters) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>( + () -> fetchSinglePageAsync(resourceGroupName, location, parameters, filter, skipToken), + nextLink -> fetchNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross Region + * Restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for operation. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azureBackupRecoveryPointResourceList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux fetchAsync( + String resourceGroupName, + String location, + FetchSecondaryRPsRequestParameters parameters, + String filter, + String skipToken, + Context context) { + return new PagedFlux<>( + () -> fetchSinglePageAsync(resourceGroupName, location, parameters, filter, skipToken, context), + nextLink -> fetchNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross Region + * Restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 azureBackupRecoveryPointResourceList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable fetch( + String resourceGroupName, String location, FetchSecondaryRPsRequestParameters parameters) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>(fetchAsync(resourceGroupName, location, parameters, filter, skipToken)); + } + + /** + * Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross Region + * Restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for operation. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azureBackupRecoveryPointResourceList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable fetch( + String resourceGroupName, + String location, + FetchSecondaryRPsRequestParameters parameters, + String filter, + String skipToken, + Context context) { + return new PagedIterable<>(fetchAsync(resourceGroupName, location, parameters, filter, skipToken, 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 azureBackupRecoveryPointResourceList along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> fetchNextSinglePageAsync(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.fetchNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> fetchNextSinglePageAsync( + 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 + .fetchNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/SecondaryRPsImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/SecondaryRPsImpl.java new file mode 100644 index 000000000000..1e82e492345e --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/SecondaryRPsImpl.java @@ -0,0 +1,55 @@ +// 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.SecondaryRPsClient; +import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupRecoveryPointResourceInner; +import com.azure.resourcemanager.dataprotection.models.AzureBackupRecoveryPointResource; +import com.azure.resourcemanager.dataprotection.models.FetchSecondaryRPsRequestParameters; +import com.azure.resourcemanager.dataprotection.models.SecondaryRPs; + +public final class SecondaryRPsImpl implements SecondaryRPs { + private static final ClientLogger LOGGER = new ClientLogger(SecondaryRPsImpl.class); + + private final SecondaryRPsClient innerClient; + + private final com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager; + + public SecondaryRPsImpl( + SecondaryRPsClient innerClient, com.azure.resourcemanager.dataprotection.DataProtectionManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable fetch( + String resourceGroupName, String location, FetchSecondaryRPsRequestParameters parameters) { + PagedIterable inner = + this.serviceClient().fetch(resourceGroupName, location, parameters); + return Utils.mapPage(inner, inner1 -> new AzureBackupRecoveryPointResourceImpl(inner1, this.manager())); + } + + public PagedIterable fetch( + String resourceGroupName, + String location, + FetchSecondaryRPsRequestParameters parameters, + String filter, + String skipToken, + Context context) { + PagedIterable inner = + this.serviceClient().fetch(resourceGroupName, location, parameters, filter, skipToken, context); + return Utils.mapPage(inner, inner1 -> new AzureBackupRecoveryPointResourceImpl(inner1, this.manager())); + } + + private SecondaryRPsClient 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/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/AzureBackupRecoveryPointBasedRestoreRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/AzureBackupRecoveryPointBasedRestoreRequest.java index 94ea6bc8dc45..2426bde6d94f 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 @@ -81,6 +81,13 @@ public AzureBackupRecoveryPointBasedRestoreRequest withSourceResourceId(String s return this; } + /** {@inheritDoc} */ + @Override + public AzureBackupRecoveryPointBasedRestoreRequest withIdentityDetails(IdentityDetails identityDetails) { + super.withIdentityDetails(identityDetails); + return this; + } + /** * Validates the instance. * 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 09bf9f30d004..79edd83db64b 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 @@ -70,6 +70,13 @@ public AzureBackupRecoveryTimeBasedRestoreRequest withSourceResourceId(String so return this; } + /** {@inheritDoc} */ + @Override + public AzureBackupRecoveryTimeBasedRestoreRequest withIdentityDetails(IdentityDetails identityDetails) { + super.withIdentityDetails(identityDetails); + return this; + } + /** * Validates the instance. * 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 608bedde5ecc..3aa39e8426f0 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 @@ -50,6 +50,13 @@ public class AzureBackupRestoreRequest { @JsonProperty(value = "sourceResourceId") private String sourceResourceId; + /* + * Contains information of the Identity Details for the BI. + * If it is null, default will be considered as System Assigned. + */ + @JsonProperty(value = "identityDetails") + private IdentityDetails identityDetails; + /** Creates an instance of AzureBackupRestoreRequest class. */ public AzureBackupRestoreRequest() { } @@ -116,6 +123,28 @@ public AzureBackupRestoreRequest withSourceResourceId(String sourceResourceId) { return this; } + /** + * Get the identityDetails property: Contains information of the Identity Details for the BI. If it is null, default + * will be considered as System Assigned. + * + * @return the identityDetails value. + */ + public IdentityDetails identityDetails() { + return this.identityDetails; + } + + /** + * Set the identityDetails property: Contains information of the Identity Details for the BI. If it is null, default + * will be considered as System Assigned. + * + * @param identityDetails the identityDetails value to set. + * @return the AzureBackupRestoreRequest object itself. + */ + public AzureBackupRestoreRequest withIdentityDetails(IdentityDetails identityDetails) { + this.identityDetails = identityDetails; + return this; + } + /** * Validates the instance. * @@ -136,6 +165,9 @@ public void validate() { new IllegalArgumentException( "Missing required property sourceDataStoreType in model AzureBackupRestoreRequest")); } + if (identityDetails() != null) { + identityDetails().validate(); + } } 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 20bb5c5eea08..5008dc3ca1d8 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 @@ -104,6 +104,13 @@ public AzureBackupRestoreWithRehydrationRequest withSourceResourceId(String sour return this; } + /** {@inheritDoc} */ + @Override + public AzureBackupRestoreWithRehydrationRequest withIdentityDetails(IdentityDetails identityDetails) { + super.withIdentityDetails(identityDetails); + return this; + } + /** * Validates the instance. * 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 073a774fb984..402a5f39faba 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 @@ -80,6 +80,13 @@ public class BackupInstance { @JsonProperty(value = "validationType") private ValidationType validationType; + /* + * Contains information of the Identity Details for the BI. + * If it is null, default will be considered as System Assigned. + */ + @JsonProperty(value = "identityDetails") + private IdentityDetails identityDetails; + /* * The objectType property. */ @@ -263,6 +270,28 @@ public BackupInstance withValidationType(ValidationType validationType) { return this; } + /** + * Get the identityDetails property: Contains information of the Identity Details for the BI. If it is null, default + * will be considered as System Assigned. + * + * @return the identityDetails value. + */ + public IdentityDetails identityDetails() { + return this.identityDetails; + } + + /** + * Set the identityDetails property: Contains information of the Identity Details for the BI. If it is null, default + * will be considered as System Assigned. + * + * @param identityDetails the identityDetails value to set. + * @return the BackupInstance object itself. + */ + public BackupInstance withIdentityDetails(IdentityDetails identityDetails) { + this.identityDetails = identityDetails; + return this; + } + /** * Get the objectType property: The objectType property. * @@ -315,6 +344,9 @@ public void validate() { if (datasourceAuthCredentials() != null) { datasourceAuthCredentials().validate(); } + if (identityDetails() != null) { + identityDetails().validate(); + } if (objectType() == null) { throw LOGGER .logExceptionAsError( 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 c9b1634d541f..cd74da8e962c 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 @@ -183,6 +183,64 @@ Response getBackupInstanceOperationResultWithResponse( BackupInstanceResource getBackupInstanceOperationResult( String resourceGroupName, String vaultName, String backupInstanceName, String operationId); + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR 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. + */ + OperationJobExtendedInfo triggerCrossRegionRestore( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters); + + /** + * The triggerCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for trigger CRR 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. + */ + OperationJobExtendedInfo triggerCrossRegionRestore( + String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters, Context context); + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo. + */ + OperationJobExtendedInfo validateCrossRegionRestore( + String resourceGroupName, String location, ValidateCrossRegionRestoreRequestObject parameters); + + /** + * The validateCrossRegionRestore operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 operationJobExtendedInfo. + */ + OperationJobExtendedInfo validateCrossRegionRestore( + String resourceGroupName, String location, ValidateCrossRegionRestoreRequestObject parameters, Context context); + /** * rehydrate recovery point for restore for a BackupInstance. * 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..b87c66eb5608 --- /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 of 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 of backup instances associated with a tracked resource as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceId); + + /** + * Gets a list of 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 of 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/BackupVault.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/BackupVault.java index f5fd32374ae4..2f929eef5d70 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 @@ -64,6 +64,12 @@ public final class BackupVault { @JsonProperty(value = "featureSettings") private FeatureSettings featureSettings; + /* + * Secure Score of Backup Vault + */ + @JsonProperty(value = "secureScore", access = JsonProperty.Access.WRITE_ONLY) + private SecureScoreLevel secureScore; + /** Creates an instance of BackupVault class. */ public BackupVault() { } @@ -184,6 +190,15 @@ public BackupVault withFeatureSettings(FeatureSettings featureSettings) { return this; } + /** + * Get the secureScore property: Secure Score of Backup Vault. + * + * @return the secureScore value. + */ + public SecureScoreLevel secureScore() { + return this.secureScore; + } + /** * Validates the instance. * diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreDetails.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreDetails.java new file mode 100644 index 000000000000..31e770b8ba56 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreDetails.java @@ -0,0 +1,91 @@ +// 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; + +/** Cross Region Restore details. */ +@Fluent +public final class CrossRegionRestoreDetails { + /* + * The sourceRegion property. + */ + @JsonProperty(value = "sourceRegion", required = true) + private String sourceRegion; + + /* + * The sourceBackupInstanceId property. + */ + @JsonProperty(value = "sourceBackupInstanceId", required = true) + private String sourceBackupInstanceId; + + /** Creates an instance of CrossRegionRestoreDetails class. */ + public CrossRegionRestoreDetails() { + } + + /** + * Get the sourceRegion property: The sourceRegion property. + * + * @return the sourceRegion value. + */ + public String sourceRegion() { + return this.sourceRegion; + } + + /** + * Set the sourceRegion property: The sourceRegion property. + * + * @param sourceRegion the sourceRegion value to set. + * @return the CrossRegionRestoreDetails object itself. + */ + public CrossRegionRestoreDetails withSourceRegion(String sourceRegion) { + this.sourceRegion = sourceRegion; + return this; + } + + /** + * Get the sourceBackupInstanceId property: The sourceBackupInstanceId property. + * + * @return the sourceBackupInstanceId value. + */ + public String sourceBackupInstanceId() { + return this.sourceBackupInstanceId; + } + + /** + * Set the sourceBackupInstanceId property: The sourceBackupInstanceId property. + * + * @param sourceBackupInstanceId the sourceBackupInstanceId value to set. + * @return the CrossRegionRestoreDetails object itself. + */ + public CrossRegionRestoreDetails withSourceBackupInstanceId(String sourceBackupInstanceId) { + this.sourceBackupInstanceId = sourceBackupInstanceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceRegion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceRegion in model CrossRegionRestoreDetails")); + } + if (sourceBackupInstanceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceBackupInstanceId in model CrossRegionRestoreDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CrossRegionRestoreDetails.class); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreJobRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreJobRequest.java new file mode 100644 index 000000000000..2df08997e5e8 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreJobRequest.java @@ -0,0 +1,123 @@ +// 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; + +/** The CrossRegionRestoreJobRequest model. */ +@Fluent +public final class CrossRegionRestoreJobRequest { + /* + * The sourceRegion property. + */ + @JsonProperty(value = "sourceRegion", required = true) + private String sourceRegion; + + /* + * The sourceBackupVaultId property. + */ + @JsonProperty(value = "sourceBackupVaultId", required = true) + private String sourceBackupVaultId; + + /* + * The jobId property. + */ + @JsonProperty(value = "jobId", required = true) + private String jobId; + + /** Creates an instance of CrossRegionRestoreJobRequest class. */ + public CrossRegionRestoreJobRequest() { + } + + /** + * Get the sourceRegion property: The sourceRegion property. + * + * @return the sourceRegion value. + */ + public String sourceRegion() { + return this.sourceRegion; + } + + /** + * Set the sourceRegion property: The sourceRegion property. + * + * @param sourceRegion the sourceRegion value to set. + * @return the CrossRegionRestoreJobRequest object itself. + */ + public CrossRegionRestoreJobRequest withSourceRegion(String sourceRegion) { + this.sourceRegion = sourceRegion; + return this; + } + + /** + * Get the sourceBackupVaultId property: The sourceBackupVaultId property. + * + * @return the sourceBackupVaultId value. + */ + public String sourceBackupVaultId() { + return this.sourceBackupVaultId; + } + + /** + * Set the sourceBackupVaultId property: The sourceBackupVaultId property. + * + * @param sourceBackupVaultId the sourceBackupVaultId value to set. + * @return the CrossRegionRestoreJobRequest object itself. + */ + public CrossRegionRestoreJobRequest withSourceBackupVaultId(String sourceBackupVaultId) { + this.sourceBackupVaultId = sourceBackupVaultId; + return this; + } + + /** + * Get the jobId property: The jobId property. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Set the jobId property: The jobId property. + * + * @param jobId the jobId value to set. + * @return the CrossRegionRestoreJobRequest object itself. + */ + public CrossRegionRestoreJobRequest withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceRegion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceRegion in model CrossRegionRestoreJobRequest")); + } + if (sourceBackupVaultId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceBackupVaultId in model CrossRegionRestoreJobRequest")); + } + if (jobId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property jobId in model CrossRegionRestoreJobRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CrossRegionRestoreJobRequest.class); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreJobs.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreJobs.java new file mode 100644 index 000000000000..417eef1a4cae --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreJobs.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 CrossRegionRestoreJobs. */ +public interface CrossRegionRestoreJobs { + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 azureBackup Job Resource Class along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String location, CrossRegionRestoreJobRequest parameters, Context context); + + /** + * The get operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 azureBackup Job Resource Class. + */ + AzureBackupJobResource get(String resourceGroupName, String location, CrossRegionRestoreJobRequest parameters); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreJobsOperations.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreJobsOperations.java new file mode 100644 index 000000000000..0abb689195da --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreJobsOperations.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of CrossRegionRestoreJobsOperations. */ +public interface CrossRegionRestoreJobsOperations { + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 list of AzureBackup Job resources as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String location, CrossRegionRestoreJobsRequest parameters); + + /** + * The list operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 list of AzureBackup Job resources as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String location, CrossRegionRestoreJobsRequest parameters, Context context); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreJobsRequest.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreJobsRequest.java new file mode 100644 index 000000000000..a3d9042e43f7 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreJobsRequest.java @@ -0,0 +1,91 @@ +// 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; + +/** The CrossRegionRestoreJobsRequest model. */ +@Fluent +public final class CrossRegionRestoreJobsRequest { + /* + * The sourceRegion property. + */ + @JsonProperty(value = "sourceRegion", required = true) + private String sourceRegion; + + /* + * The sourceBackupVaultId property. + */ + @JsonProperty(value = "sourceBackupVaultId", required = true) + private String sourceBackupVaultId; + + /** Creates an instance of CrossRegionRestoreJobsRequest class. */ + public CrossRegionRestoreJobsRequest() { + } + + /** + * Get the sourceRegion property: The sourceRegion property. + * + * @return the sourceRegion value. + */ + public String sourceRegion() { + return this.sourceRegion; + } + + /** + * Set the sourceRegion property: The sourceRegion property. + * + * @param sourceRegion the sourceRegion value to set. + * @return the CrossRegionRestoreJobsRequest object itself. + */ + public CrossRegionRestoreJobsRequest withSourceRegion(String sourceRegion) { + this.sourceRegion = sourceRegion; + return this; + } + + /** + * Get the sourceBackupVaultId property: The sourceBackupVaultId property. + * + * @return the sourceBackupVaultId value. + */ + public String sourceBackupVaultId() { + return this.sourceBackupVaultId; + } + + /** + * Set the sourceBackupVaultId property: The sourceBackupVaultId property. + * + * @param sourceBackupVaultId the sourceBackupVaultId value to set. + * @return the CrossRegionRestoreJobsRequest object itself. + */ + public CrossRegionRestoreJobsRequest withSourceBackupVaultId(String sourceBackupVaultId) { + this.sourceBackupVaultId = sourceBackupVaultId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceRegion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceRegion in model CrossRegionRestoreJobsRequest")); + } + if (sourceBackupVaultId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceBackupVaultId in model CrossRegionRestoreJobsRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CrossRegionRestoreJobsRequest.class); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreRequestObject.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreRequestObject.java new file mode 100644 index 000000000000..814427d44f43 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreRequestObject.java @@ -0,0 +1,103 @@ +// 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; + +/** Cross Region Restore Request Object. */ +@Fluent +public final class CrossRegionRestoreRequestObject { + /* + * AzureBackupRestoreRequest + * + * Gets or sets the restore request object. + */ + @JsonProperty(value = "restoreRequestObject", required = true) + private AzureBackupRestoreRequest restoreRequestObject; + + /* + * Cross region restore details. + */ + @JsonProperty(value = "crossRegionRestoreDetails", required = true) + private CrossRegionRestoreDetails crossRegionRestoreDetails; + + /** Creates an instance of CrossRegionRestoreRequestObject class. */ + public CrossRegionRestoreRequestObject() { + } + + /** + * Get the restoreRequestObject property: AzureBackupRestoreRequest + * + *

Gets or sets the restore request object. + * + * @return the restoreRequestObject value. + */ + public AzureBackupRestoreRequest restoreRequestObject() { + return this.restoreRequestObject; + } + + /** + * Set the restoreRequestObject property: AzureBackupRestoreRequest + * + *

Gets or sets the restore request object. + * + * @param restoreRequestObject the restoreRequestObject value to set. + * @return the CrossRegionRestoreRequestObject object itself. + */ + public CrossRegionRestoreRequestObject withRestoreRequestObject(AzureBackupRestoreRequest restoreRequestObject) { + this.restoreRequestObject = restoreRequestObject; + return this; + } + + /** + * Get the crossRegionRestoreDetails property: Cross region restore details. + * + * @return the crossRegionRestoreDetails value. + */ + public CrossRegionRestoreDetails crossRegionRestoreDetails() { + return this.crossRegionRestoreDetails; + } + + /** + * Set the crossRegionRestoreDetails property: Cross region restore details. + * + * @param crossRegionRestoreDetails the crossRegionRestoreDetails value to set. + * @return the CrossRegionRestoreRequestObject object itself. + */ + public CrossRegionRestoreRequestObject withCrossRegionRestoreDetails( + CrossRegionRestoreDetails crossRegionRestoreDetails) { + this.crossRegionRestoreDetails = crossRegionRestoreDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (restoreRequestObject() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property restoreRequestObject in model CrossRegionRestoreRequestObject")); + } else { + restoreRequestObject().validate(); + } + if (crossRegionRestoreDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property crossRegionRestoreDetails in model" + + " CrossRegionRestoreRequestObject")); + } else { + crossRegionRestoreDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CrossRegionRestoreRequestObject.class); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreSettings.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreSettings.java new file mode 100644 index 000000000000..eb9dbd0906f6 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreSettings.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; + +/** The CrossRegionRestoreSettings model. */ +@Fluent +public final class CrossRegionRestoreSettings { + /* + * CrossRegionRestore state + */ + @JsonProperty(value = "state") + private CrossRegionRestoreState state; + + /** Creates an instance of CrossRegionRestoreSettings class. */ + public CrossRegionRestoreSettings() { + } + + /** + * Get the state property: CrossRegionRestore state. + * + * @return the state value. + */ + public CrossRegionRestoreState state() { + return this.state; + } + + /** + * Set the state property: CrossRegionRestore state. + * + * @param state the state value to set. + * @return the CrossRegionRestoreSettings object itself. + */ + public CrossRegionRestoreSettings withState(CrossRegionRestoreState 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/CrossRegionRestoreState.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreState.java new file mode 100644 index 000000000000..81c5290794e8 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/CrossRegionRestoreState.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; + +/** CrossRegionRestore state. */ +public final class CrossRegionRestoreState extends ExpandableStringEnum { + /** Static value Disabled for CrossRegionRestoreState. */ + public static final CrossRegionRestoreState DISABLED = fromString("Disabled"); + + /** Static value Enabled for CrossRegionRestoreState. */ + public static final CrossRegionRestoreState ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of CrossRegionRestoreState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CrossRegionRestoreState() { + } + + /** + * Creates or finds a CrossRegionRestoreState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CrossRegionRestoreState. + */ + @JsonCreator + public static CrossRegionRestoreState fromString(String name) { + return fromString(name, CrossRegionRestoreState.class); + } + + /** + * Gets known CrossRegionRestoreState values. + * + * @return known CrossRegionRestoreState values. + */ + public static Collection values() { + return values(CrossRegionRestoreState.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 index ad4cb4797f28..022fb0320215 100644 --- 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 @@ -71,6 +71,13 @@ public DeletedBackupInstance withValidationType(ValidationType validationType) { return this; } + /** {@inheritDoc} */ + @Override + public DeletedBackupInstance withIdentityDetails(IdentityDetails identityDetails) { + super.withIdentityDetails(identityDetails); + return this; + } + /** {@inheritDoc} */ @Override public DeletedBackupInstance withObjectType(String objectType) { 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 4fb7183a6981..6e7810f626b1 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,7 +5,9 @@ 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 java.util.Map; /** * DppIdentityDetails @@ -28,11 +30,18 @@ public final class DppIdentityDetails { private String tenantId; /* - * The identityType which can be either SystemAssigned or None + * The identityType which can be either SystemAssigned, UserAssigned, 'SystemAssigned,UserAssigned' or None */ @JsonProperty(value = "type") private String type; + /* + * Gets or sets the user assigned identities. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + /** Creates an instance of DppIdentityDetails class. */ public DppIdentityDetails() { } @@ -58,7 +67,8 @@ public String tenantId() { } /** - * Get the type property: The identityType which can be either SystemAssigned or None. + * Get the type property: The identityType which can be either SystemAssigned, UserAssigned, + * 'SystemAssigned,UserAssigned' or None. * * @return the type value. */ @@ -67,7 +77,8 @@ public String type() { } /** - * Set the type property: The identityType which can be either SystemAssigned or None. + * Set the type property: The identityType which can be either SystemAssigned, UserAssigned, + * 'SystemAssigned,UserAssigned' or None. * * @param type the type value to set. * @return the DppIdentityDetails object itself. @@ -77,11 +88,42 @@ public DppIdentityDetails withType(String type) { return this; } + /** + * Get the userAssignedIdentities property: Gets or sets the user assigned identities. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: Gets or sets the user assigned identities. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the DppIdentityDetails object itself. + */ + public DppIdentityDetails withUserAssignedIdentities( + Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } } } 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..99253ca734c5 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DppResourceGuardProxies.java @@ -0,0 +1,183 @@ +// 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 { + /** + * Returns the list of ResourceGuardProxies associated with the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Returns the list of ResourceGuardProxies associated with the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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 resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs + * along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String resourceGuardProxyName, Context context); + + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs. + */ + ResourceGuardProxyBaseResource get(String resourceGroupName, String vaultName, String resourceGuardProxyName); + + /** + * Deletes the ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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); + + /** + * Deletes the ResourceGuardProxy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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); + + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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); + + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy. + * @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); + + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the request. + * + * @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 resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs + * along with {@link Response}. + */ + ResourceGuardProxyBaseResource getById(String id); + + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the request. + * + * @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 resourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs + * along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the ResourceGuardProxy. + * + * @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); + + /** + * Deletes the ResourceGuardProxy. + * + * @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/FeatureSettings.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureSettings.java index c85a2ab7d80d..529c68eda2d7 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureSettings.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FeatureSettings.java @@ -16,6 +16,12 @@ public final class FeatureSettings { @JsonProperty(value = "crossSubscriptionRestoreSettings") private CrossSubscriptionRestoreSettings crossSubscriptionRestoreSettings; + /* + * The crossRegionRestoreSettings property. + */ + @JsonProperty(value = "crossRegionRestoreSettings") + private CrossRegionRestoreSettings crossRegionRestoreSettings; + /** Creates an instance of FeatureSettings class. */ public FeatureSettings() { } @@ -41,6 +47,26 @@ public FeatureSettings withCrossSubscriptionRestoreSettings( return this; } + /** + * Get the crossRegionRestoreSettings property: The crossRegionRestoreSettings property. + * + * @return the crossRegionRestoreSettings value. + */ + public CrossRegionRestoreSettings crossRegionRestoreSettings() { + return this.crossRegionRestoreSettings; + } + + /** + * Set the crossRegionRestoreSettings property: The crossRegionRestoreSettings property. + * + * @param crossRegionRestoreSettings the crossRegionRestoreSettings value to set. + * @return the FeatureSettings object itself. + */ + public FeatureSettings withCrossRegionRestoreSettings(CrossRegionRestoreSettings crossRegionRestoreSettings) { + this.crossRegionRestoreSettings = crossRegionRestoreSettings; + return this; + } + /** * Validates the instance. * @@ -50,5 +76,8 @@ public void validate() { if (crossSubscriptionRestoreSettings() != null) { crossSubscriptionRestoreSettings().validate(); } + if (crossRegionRestoreSettings() != null) { + crossRegionRestoreSettings().validate(); + } } } diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FetchSecondaryRPsRequestParameters.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FetchSecondaryRPsRequestParameters.java new file mode 100644 index 000000000000..708d29082146 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/FetchSecondaryRPsRequestParameters.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; + +/** Information about BI whose secondary RecoveryPoints are requested Source region and BI ARM path. */ +@Fluent +public final class FetchSecondaryRPsRequestParameters { + /* + * Source region in which BackupInstance is located + */ + @JsonProperty(value = "sourceRegion") + private String sourceRegion; + + /* + * ARM Path of BackupInstance + */ + @JsonProperty(value = "sourceBackupInstanceId") + private String sourceBackupInstanceId; + + /** Creates an instance of FetchSecondaryRPsRequestParameters class. */ + public FetchSecondaryRPsRequestParameters() { + } + + /** + * Get the sourceRegion property: Source region in which BackupInstance is located. + * + * @return the sourceRegion value. + */ + public String sourceRegion() { + return this.sourceRegion; + } + + /** + * Set the sourceRegion property: Source region in which BackupInstance is located. + * + * @param sourceRegion the sourceRegion value to set. + * @return the FetchSecondaryRPsRequestParameters object itself. + */ + public FetchSecondaryRPsRequestParameters withSourceRegion(String sourceRegion) { + this.sourceRegion = sourceRegion; + return this; + } + + /** + * Get the sourceBackupInstanceId property: ARM Path of BackupInstance. + * + * @return the sourceBackupInstanceId value. + */ + public String sourceBackupInstanceId() { + return this.sourceBackupInstanceId; + } + + /** + * Set the sourceBackupInstanceId property: ARM Path of BackupInstance. + * + * @param sourceBackupInstanceId the sourceBackupInstanceId value to set. + * @return the FetchSecondaryRPsRequestParameters object itself. + */ + public FetchSecondaryRPsRequestParameters withSourceBackupInstanceId(String sourceBackupInstanceId) { + this.sourceBackupInstanceId = sourceBackupInstanceId; + 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/IdentityDetails.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/IdentityDetails.java new file mode 100644 index 000000000000..2c786f6b6115 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/IdentityDetails.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 IdentityDetails model. */ +@Fluent +public final class IdentityDetails { + /* + * Specifies if the BI is protected by System Identity. + */ + @JsonProperty(value = "useSystemAssignedIdentity") + private Boolean useSystemAssignedIdentity; + + /* + * ARM URL for User Assigned Identity. + */ + @JsonProperty(value = "userAssignedIdentityArmUrl") + private String userAssignedIdentityArmUrl; + + /** Creates an instance of IdentityDetails class. */ + public IdentityDetails() { + } + + /** + * Get the useSystemAssignedIdentity property: Specifies if the BI is protected by System Identity. + * + * @return the useSystemAssignedIdentity value. + */ + public Boolean useSystemAssignedIdentity() { + return this.useSystemAssignedIdentity; + } + + /** + * Set the useSystemAssignedIdentity property: Specifies if the BI is protected by System Identity. + * + * @param useSystemAssignedIdentity the useSystemAssignedIdentity value to set. + * @return the IdentityDetails object itself. + */ + public IdentityDetails withUseSystemAssignedIdentity(Boolean useSystemAssignedIdentity) { + this.useSystemAssignedIdentity = useSystemAssignedIdentity; + return this; + } + + /** + * Get the userAssignedIdentityArmUrl property: ARM URL for User Assigned Identity. + * + * @return the userAssignedIdentityArmUrl value. + */ + public String userAssignedIdentityArmUrl() { + return this.userAssignedIdentityArmUrl; + } + + /** + * Set the userAssignedIdentityArmUrl property: ARM URL for User Assigned Identity. + * + * @param userAssignedIdentityArmUrl the userAssignedIdentityArmUrl value to set. + * @return the IdentityDetails object itself. + */ + public IdentityDetails withUserAssignedIdentityArmUrl(String userAssignedIdentityArmUrl) { + this.userAssignedIdentityArmUrl = userAssignedIdentityArmUrl; + 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/ResourceGuardOperationDetail.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardOperationDetail.java new file mode 100644 index 000000000000..9f5046df9fe8 --- /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; + +/** VaultCritical Operation protected by a resource guard. */ +@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/ResourceGuardProxyBase.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ResourceGuardProxyBase.java new file mode 100644 index 000000000000..5a041a34378f --- /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; + +/** ResourceGuardProxyBase object, used in ResourceGuardProxyBaseResource. */ +@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..b55d7e99aba6 --- /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. The name is case insensitive. + * @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); + + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it. + * + * @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); + + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it. + * + * @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/ScheduleBasedBackupCriteria.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ScheduleBasedBackupCriteria.java index 4aed0a36fff6..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 @@ -21,7 +21,7 @@ @Fluent public final class ScheduleBasedBackupCriteria extends BackupCriteria { /* - * 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") @@ -62,8 +62,8 @@ 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. */ @@ -72,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/SecondaryRPs.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecondaryRPs.java new file mode 100644 index 000000000000..2ab8e322131b --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecondaryRPs.java @@ -0,0 +1,49 @@ +// 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 SecondaryRPs. */ +public interface SecondaryRPs { + /** + * Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross Region + * Restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location 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 azureBackupRecoveryPointResourceList as paginated response with {@link PagedIterable}. + */ + PagedIterable fetch( + String resourceGroupName, String location, FetchSecondaryRPsRequestParameters parameters); + + /** + * Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross Region + * Restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location parameter. + * @param parameters Request body for operation. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azureBackupRecoveryPointResourceList as paginated response with {@link PagedIterable}. + */ + PagedIterable fetch( + String resourceGroupName, + String location, + FetchSecondaryRPsRequestParameters parameters, + String filter, + String skipToken, + Context context); +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecureScoreLevel.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecureScoreLevel.java new file mode 100644 index 000000000000..aabf158c6736 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/SecureScoreLevel.java @@ -0,0 +1,56 @@ +// 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; + +/** Secure Score of Backup Vault. */ +public final class SecureScoreLevel extends ExpandableStringEnum { + /** Static value None for SecureScoreLevel. */ + public static final SecureScoreLevel NONE = fromString("None"); + + /** Static value Minimum for SecureScoreLevel. */ + public static final SecureScoreLevel MINIMUM = fromString("Minimum"); + + /** Static value Adequate for SecureScoreLevel. */ + public static final SecureScoreLevel ADEQUATE = fromString("Adequate"); + + /** Static value Maximum for SecureScoreLevel. */ + public static final SecureScoreLevel MAXIMUM = fromString("Maximum"); + + /** Static value NotSupported for SecureScoreLevel. */ + public static final SecureScoreLevel NOT_SUPPORTED = fromString("NotSupported"); + + /** + * Creates a new instance of SecureScoreLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecureScoreLevel() { + } + + /** + * Creates or finds a SecureScoreLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecureScoreLevel. + */ + @JsonCreator + public static SecureScoreLevel fromString(String name) { + return fromString(name, SecureScoreLevel.class); + } + + /** + * Gets known SecureScoreLevel values. + * + * @return known SecureScoreLevel values. + */ + public static Collection values() { + return values(SecureScoreLevel.class); + } +} 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/UserAssignedIdentityDetails.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/UserAssignedIdentityDetails.java new file mode 100644 index 000000000000..fc5ce7a183f3 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/UserAssignedIdentityDetails.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** User Assigned Identity Details. */ +@Immutable +public final class UserAssignedIdentityDetails { + /* + * The Client Id of the User Assigned Managed Identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /* + * The Object Id of the User Assigned Managed Identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** Creates an instance of UserAssignedIdentityDetails class. */ + public UserAssignedIdentityDetails() { + } + + /** + * Get the clientId property: The Client Id of the User Assigned Managed Identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Get the principalId property: The Object Id of the User Assigned Managed Identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * 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/ValidateCrossRegionRestoreRequestObject.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ValidateCrossRegionRestoreRequestObject.java new file mode 100644 index 000000000000..113eb91d2c4a --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ValidateCrossRegionRestoreRequestObject.java @@ -0,0 +1,105 @@ +// 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; + +/** Cross Region Restore Request Object. */ +@Fluent +public final class ValidateCrossRegionRestoreRequestObject { + /* + * AzureBackupRestoreRequest + * + * Gets or sets the restore request object. + */ + @JsonProperty(value = "restoreRequestObject", required = true) + private AzureBackupRestoreRequest restoreRequestObject; + + /* + * Cross region restore details. + */ + @JsonProperty(value = "crossRegionRestoreDetails", required = true) + private CrossRegionRestoreDetails crossRegionRestoreDetails; + + /** Creates an instance of ValidateCrossRegionRestoreRequestObject class. */ + public ValidateCrossRegionRestoreRequestObject() { + } + + /** + * Get the restoreRequestObject property: AzureBackupRestoreRequest + * + *

Gets or sets the restore request object. + * + * @return the restoreRequestObject value. + */ + public AzureBackupRestoreRequest restoreRequestObject() { + return this.restoreRequestObject; + } + + /** + * Set the restoreRequestObject property: AzureBackupRestoreRequest + * + *

Gets or sets the restore request object. + * + * @param restoreRequestObject the restoreRequestObject value to set. + * @return the ValidateCrossRegionRestoreRequestObject object itself. + */ + public ValidateCrossRegionRestoreRequestObject withRestoreRequestObject( + AzureBackupRestoreRequest restoreRequestObject) { + this.restoreRequestObject = restoreRequestObject; + return this; + } + + /** + * Get the crossRegionRestoreDetails property: Cross region restore details. + * + * @return the crossRegionRestoreDetails value. + */ + public CrossRegionRestoreDetails crossRegionRestoreDetails() { + return this.crossRegionRestoreDetails; + } + + /** + * Set the crossRegionRestoreDetails property: Cross region restore details. + * + * @param crossRegionRestoreDetails the crossRegionRestoreDetails value to set. + * @return the ValidateCrossRegionRestoreRequestObject object itself. + */ + public ValidateCrossRegionRestoreRequestObject withCrossRegionRestoreDetails( + CrossRegionRestoreDetails crossRegionRestoreDetails) { + this.crossRegionRestoreDetails = crossRegionRestoreDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (restoreRequestObject() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property restoreRequestObject in model" + + " ValidateCrossRegionRestoreRequestObject")); + } else { + restoreRequestObject().validate(); + } + if (crossRegionRestoreDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property crossRegionRestoreDetails in model" + + " ValidateCrossRegionRestoreRequestObject")); + } else { + crossRegionRestoreDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ValidateCrossRegionRestoreRequestObject.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 e1f7f92751a7..d4a92d1f6f2d 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 @@ -11,7 +11,7 @@ /** Samples for BackupInstances AdhocBackup. */ public final class BackupInstancesAdhocBackupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/TriggerBackup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/TriggerBackup.json */ /** * Sample code: Trigger Adhoc Backup. 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 d47bc4c09505..32f486d8c34e 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 @@ -22,7 +22,7 @@ /** Samples for BackupInstances CreateOrUpdate. */ public final class BackupInstancesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/PutBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/PutBackupInstance.json */ /** * Sample code: Create BackupInstance. 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 a5ecf39862d7..47cc9c7cdfd1 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 @@ -7,7 +7,7 @@ /** Samples for BackupInstances Delete. */ public final class BackupInstancesDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/DeleteBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/DeleteBackupInstance.json */ /** * Sample code: Delete BackupInstance. 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..ae87116f982f --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesExtensionRoutingListSamples.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; + +/** Samples for BackupInstancesExtensionRouting List. */ +public final class BackupInstancesExtensionRoutingListSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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", + com.azure.core.util.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 index ed9a665f2390..2064b292653c 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for BackupInstances GetBackupInstanceOperationResult. */ public final class BackupInstancesGetBackupInstanceOperationResultSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/GetBackupInstanceOperationResult.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/GetBackupInstanceOperationResult.json */ /** * Sample code: Get BackupInstanceOperationResult. 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 7e1748b397ed..627ccdad4b61 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 @@ -7,7 +7,7 @@ /** Samples for BackupInstances Get. */ public final class BackupInstancesGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/GetBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/GetBackupInstance.json */ /** * Sample code: Get BackupInstance. 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 5ba92edc6cd1..cd9144bff923 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 @@ -7,7 +7,7 @@ /** Samples for BackupInstances List. */ public final class BackupInstancesListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/ListBackupInstances.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/ListBackupInstances.json */ /** * Sample code: List BackupInstances in a Vault. 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 index bf27ffa9c0b0..39e80663e500 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for BackupInstances ResumeBackups. */ public final class BackupInstancesResumeBackupsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/ResumeBackups.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/ResumeBackups.json */ /** * Sample code: ResumeBackups. 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 index e106ee120baf..98380f8069b0 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for BackupInstances ResumeProtection. */ public final class BackupInstancesResumeProtectionSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/ResumeProtection.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/ResumeProtection.json */ /** * Sample code: ResumeProtection. 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 index 87b9dc181b8b..b132d741c911 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for BackupInstances StopProtection. */ public final class BackupInstancesStopProtectionSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/StopProtection.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/StopProtection.json */ /** * Sample code: StopProtection. 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 index 190a9d029b14..a83871d50905 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for BackupInstances SuspendBackups. */ public final class BackupInstancesSuspendBackupsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/SuspendBackups.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/SuspendBackups.json */ /** * Sample code: SuspendBackups. 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 index f6afbbe55657..6e992e1fda2a 100644 --- 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 @@ -10,7 +10,7 @@ /** Samples for BackupInstances SyncBackupInstance. */ public final class BackupInstancesSyncBackupInstanceSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/SyncBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/SyncBackupInstance.json */ /** * Sample code: Sync BackupInstance. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesTriggerCrossRegionRestoreSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesTriggerCrossRegionRestoreSamples.java new file mode 100644 index 000000000000..23282fec76f7 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesTriggerCrossRegionRestoreSamples.java @@ -0,0 +1,80 @@ +// 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.AzureBackupRecoveryPointBasedRestoreRequest; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreDetails; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreRequestObject; +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.RestoreTargetInfo; +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.SourceDataStoreType; + +/** Samples for BackupInstances TriggerCrossRegionRestore. */ +public final class BackupInstancesTriggerCrossRegionRestoreSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/CrossRegionRestore/TriggerCrossRegionRestore.json + */ + /** + * Sample code: Trigger Cross Region Restore. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void triggerCrossRegionRestore( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .backupInstances() + .triggerCrossRegionRestore( + "000pikumar", + "EastAsia", + new CrossRegionRestoreRequestObject() + .withRestoreRequestObject( + new AzureBackupRecoveryPointBasedRestoreRequest() + .withRestoreTargetInfo( + new RestoreTargetInfo() + .withRecoveryOption(RecoveryOption.FAIL_IF_EXISTS) + .withRestoreLocation("southeastasia") + .withDatasourceInfo( + new Datasource() + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") + .withObjectType("Datasource") + .withResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/targetdb") + .withResourceLocation("") + .withResourceName("targetdb") + .withResourceType("Microsoft.DBforPostgreSQL/servers/databases") + .withResourceUri("")) + .withDatasourceSetInfo( + new DatasourceSet() + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") + .withObjectType("DatasourceSet") + .withResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest") + .withResourceLocation("") + .withResourceName("viveksipgtest") + .withResourceType("Microsoft.DBforPostgreSQL/servers") + .withResourceUri("")) + .withDatasourceAuthCredentials( + new SecretStoreBasedAuthCredentials() + .withSecretStoreResource( + new SecretStoreResource() + .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")) + .withCrossRegionRestoreDetails( + new CrossRegionRestoreDetails() + .withSourceRegion("east asia") + .withSourceBackupInstanceId( + "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/BackupInstances/harshitbi1")), + com.azure.core.util.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 d3f86ffedbf8..b2b91775c235 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 @@ -10,7 +10,7 @@ /** Samples for BackupInstances TriggerRehydrate. */ public final class BackupInstancesTriggerRehydrateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/TriggerRehydrate.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 23882f544b33..a6e750770f49 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 @@ -22,7 +22,7 @@ /** Samples for BackupInstances TriggerRestore. */ public final class BackupInstancesTriggerRestoreSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/TriggerRestoreAsFiles.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/TriggerRestoreAsFiles.json */ /** * Sample code: Trigger Restore As Files. @@ -54,7 +54,7 @@ public static void triggerRestoreAsFiles(com.azure.resourcemanager.dataprotectio } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/TriggerRestoreWithRehydration.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/TriggerRestoreWithRehydration.json */ /** * Sample code: Trigger Restore With Rehydration. @@ -104,7 +104,7 @@ public static void triggerRestoreWithRehydration( } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/TriggerRestore.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/TriggerRestore.json */ /** * Sample code: Trigger Restore. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesValidateCrossRegionRestoreSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesValidateCrossRegionRestoreSamples.java new file mode 100644 index 000000000000..1c56c6f80aca --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/BackupInstancesValidateCrossRegionRestoreSamples.java @@ -0,0 +1,80 @@ +// 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.AzureBackupRecoveryPointBasedRestoreRequest; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreDetails; +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.RestoreTargetInfo; +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.SourceDataStoreType; +import com.azure.resourcemanager.dataprotection.models.ValidateCrossRegionRestoreRequestObject; + +/** Samples for BackupInstances ValidateCrossRegionRestore. */ +public final class BackupInstancesValidateCrossRegionRestoreSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/CrossRegionRestore/ValidateCrossRegionRestore.json + */ + /** + * Sample code: Validate Cross Region Restore. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void validateCrossRegionRestore( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .backupInstances() + .validateCrossRegionRestore( + "000pikumar", + "EastAsia", + new ValidateCrossRegionRestoreRequestObject() + .withRestoreRequestObject( + new AzureBackupRecoveryPointBasedRestoreRequest() + .withRestoreTargetInfo( + new RestoreTargetInfo() + .withRecoveryOption(RecoveryOption.FAIL_IF_EXISTS) + .withRestoreLocation("southeastasia") + .withDatasourceInfo( + new Datasource() + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") + .withObjectType("Datasource") + .withResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/targetdb") + .withResourceLocation("") + .withResourceName("targetdb") + .withResourceType("Microsoft.DBforPostgreSQL/servers/databases") + .withResourceUri("")) + .withDatasourceSetInfo( + new DatasourceSet() + .withDatasourceType("Microsoft.DBforPostgreSQL/servers/databases") + .withObjectType("DatasourceSet") + .withResourceId( + "/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest") + .withResourceLocation("") + .withResourceName("viveksipgtest") + .withResourceType("Microsoft.DBforPostgreSQL/servers") + .withResourceUri("")) + .withDatasourceAuthCredentials( + new SecretStoreBasedAuthCredentials() + .withSecretStoreResource( + new SecretStoreResource() + .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")) + .withCrossRegionRestoreDetails( + new CrossRegionRestoreDetails() + .withSourceRegion("east asia") + .withSourceBackupInstanceId( + "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/BackupInstances/harshitbi1")), + com.azure.core.util.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 710fc813657f..cb1f665c2e1a 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 @@ -16,7 +16,7 @@ /** Samples for BackupInstances ValidateForBackup. */ public final class BackupInstancesValidateForBackupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/ValidateForBackup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/ValidateForBackup.json */ /** * Sample code: Validate For Backup. 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 eedc78502099..6967c07ac3fe 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 @@ -18,7 +18,7 @@ /** Samples for BackupInstances ValidateForRestore. */ public final class BackupInstancesValidateForRestoreSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/ValidateRestore.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/ValidateRestore.json */ /** * Sample code: Validate Restore. 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 04a4a94c6f19..86e6a2e756f5 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/2023-01-01/examples/PolicyCRUD/CreateOrUpdateBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/PolicyCRUD/CreateOrUpdateBackupPolicy.json */ /** * Sample code: CreateOrUpdate BackupPolicy. 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 f1de428037c8..3c8615fde474 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 @@ -7,7 +7,7 @@ /** Samples for BackupPolicies Delete. */ public final class BackupPoliciesDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/PolicyCRUD/DeleteBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/PolicyCRUD/DeleteBackupPolicy.json */ /** * Sample code: Delete BackupPolicy. 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 d156004eb3b6..068c0c3810d0 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 @@ -7,7 +7,7 @@ /** Samples for BackupPolicies Get. */ public final class BackupPoliciesGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/PolicyCRUD/GetBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/PolicyCRUD/GetBackupPolicy.json */ /** * Sample code: Get BackupPolicy. 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 da187067f517..70eea227e05c 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 @@ -7,7 +7,7 @@ /** Samples for BackupPolicies List. */ public final class BackupPoliciesListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/PolicyCRUD/ListBackupPolicy.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/PolicyCRUD/ListBackupPolicy.json */ /** * Sample code: List BackupPolicy. 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 4394bacbdc65..3d04af7be5b3 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 @@ -7,7 +7,7 @@ /** Samples for BackupVaultOperationResults Get. */ public final class BackupVaultOperationResultsGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/GetOperationResultPatch.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/GetOperationResultPatch.json */ /** * Sample code: GetOperationResult Patch. 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 c3890a967acc..9197c2445033 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 @@ -9,7 +9,7 @@ /** Samples for BackupVaults CheckNameAvailability. */ public final class BackupVaultsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/CheckBackupVaultsNameAvailability.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 e606871d204c..bf8e372695f7 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 @@ -7,8 +7,14 @@ 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.CrossRegionRestoreSettings; +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreState; import com.azure.resourcemanager.dataprotection.models.DppIdentityDetails; +import com.azure.resourcemanager.dataprotection.models.FeatureSettings; import com.azure.resourcemanager.dataprotection.models.MonitoringSettings; +import com.azure.resourcemanager.dataprotection.models.SecuritySettings; +import com.azure.resourcemanager.dataprotection.models.SoftDeleteSettings; +import com.azure.resourcemanager.dataprotection.models.SoftDeleteState; import com.azure.resourcemanager.dataprotection.models.StorageSetting; import com.azure.resourcemanager.dataprotection.models.StorageSettingStoreTypes; import com.azure.resourcemanager.dataprotection.models.StorageSettingTypes; @@ -19,7 +25,7 @@ /** Samples for BackupVaults CreateOrUpdate. */ public final class BackupVaultsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/PutBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/PutBackupVault.json */ /** * Sample code: Create BackupVault. @@ -38,19 +44,29 @@ public static void createBackupVault(com.azure.resourcemanager.dataprotection.Da new MonitoringSettings() .withAzureMonitorAlertSettings( new AzureMonitorAlertSettings().withAlertsForAllJobFailures(AlertsState.ENABLED))) + .withSecuritySettings( + new SecuritySettings() + .withSoftDeleteSettings( + new SoftDeleteSettings() + .withState(SoftDeleteState.fromString("Enabled")) + .withRetentionDurationInDays(14.0D))) .withStorageSettings( Arrays .asList( new StorageSetting() .withDatastoreType(StorageSettingStoreTypes.VAULT_STORE) - .withType(StorageSettingTypes.LOCALLY_REDUNDANT)))) + .withType(StorageSettingTypes.LOCALLY_REDUNDANT))) + .withFeatureSettings( + new FeatureSettings() + .withCrossRegionRestoreSettings( + new CrossRegionRestoreSettings().withState(CrossRegionRestoreState.ENABLED)))) .withTags(mapOf("key1", "val1")) .withIdentity(new DppIdentityDetails().withType("None")) .create(); } /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/PutBackupVaultWithMSI.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/PutBackupVaultWithMSI.json */ /** * Sample code: Create BackupVault With MSI. @@ -70,12 +86,22 @@ public static void createBackupVaultWithMSI( new MonitoringSettings() .withAzureMonitorAlertSettings( new AzureMonitorAlertSettings().withAlertsForAllJobFailures(AlertsState.ENABLED))) + .withSecuritySettings( + new SecuritySettings() + .withSoftDeleteSettings( + new SoftDeleteSettings() + .withState(SoftDeleteState.fromString("Enabled")) + .withRetentionDurationInDays(14.0D))) .withStorageSettings( Arrays .asList( new StorageSetting() .withDatastoreType(StorageSettingStoreTypes.VAULT_STORE) - .withType(StorageSettingTypes.LOCALLY_REDUNDANT)))) + .withType(StorageSettingTypes.LOCALLY_REDUNDANT))) + .withFeatureSettings( + new FeatureSettings() + .withCrossRegionRestoreSettings( + new CrossRegionRestoreSettings().withState(CrossRegionRestoreState.ENABLED)))) .withTags(mapOf("key1", "val1")) .withIdentity(new DppIdentityDetails().withType("systemAssigned")) .create(); 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 95e82ea6e695..10f373afacf6 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 @@ -7,7 +7,7 @@ /** Samples for BackupVaults Delete. */ public final class BackupVaultsDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/DeleteBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/DeleteBackupVault.json */ /** * Sample code: Delete BackupVault. 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 f516de8c1b39..8a1d1fb09085 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 @@ -7,7 +7,7 @@ /** Samples for BackupVaults GetByResourceGroup. */ public final class BackupVaultsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/GetBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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/2023-01-01/examples/VaultCRUD/GetBackupVaultWithMSI.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 a0371db1247d..4ea3f057b33d 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 @@ -7,7 +7,7 @@ /** Samples for BackupVaults ListByResourceGroup. */ public final class BackupVaultsListByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/GetBackupVaultsInResourceGroup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 7b871d5b8f61..aef4f1c808d6 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 @@ -7,7 +7,7 @@ /** Samples for BackupVaults List. */ public final class BackupVaultsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/GetBackupVaultsInSubscription.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 1a528300410d..db9117b96cd2 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 @@ -15,7 +15,7 @@ /** Samples for BackupVaults Update. */ public final class BackupVaultsUpdateSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/PatchBackupVault.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/VaultCRUD/PatchBackupVault.json */ /** * Sample code: Patch BackupVault. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/CrossRegionRestoreJobGetSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/CrossRegionRestoreJobGetSamples.java new file mode 100644 index 000000000000..d9b5bc618ddf --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/CrossRegionRestoreJobGetSamples.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.generated; + +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobRequest; + +/** Samples for CrossRegionRestoreJob Get. */ +public final class CrossRegionRestoreJobGetSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/CrossRegionRestore/FetchCrossRegionRestoreJob.json + */ + /** + * Sample code: Get Cross Region Restore Job. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void getCrossRegionRestoreJob( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .crossRegionRestoreJobs() + .getWithResponse( + "BugBash1", + "west us", + new CrossRegionRestoreJobRequest() + .withSourceRegion("east us") + .withSourceBackupVaultId( + "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11") + .withJobId("3c60cb49-63e8-4b21-b9bd-26277b3fdfae"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/CrossRegionRestoreJobsOperationListSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/CrossRegionRestoreJobsOperationListSamples.java new file mode 100644 index 000000000000..a112980af3b4 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/CrossRegionRestoreJobsOperationListSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dataprotection.generated; + +import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobsRequest; + +/** Samples for CrossRegionRestoreJobsOperation List. */ +public final class CrossRegionRestoreJobsOperationListSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/CrossRegionRestore/FetchCrossRegionRestoreJobs.json + */ + /** + * Sample code: List Cross Region Restore Jobs. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void listCrossRegionRestoreJobs( + com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .crossRegionRestoreJobsOperations() + .list( + "BugBash1", + "east us", + new CrossRegionRestoreJobsRequest() + .withSourceRegion("east us") + .withSourceBackupVaultId( + "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11"), + com.azure.core.util.Context.NONE); + } +} 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 10f34629a0cb..5d77844b6f3f 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 @@ -10,7 +10,7 @@ /** Samples for DataProtection CheckFeatureSupport. */ public final class DataProtectionCheckFeatureSupportSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/CheckfeatureSupport.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 faca35484bb7..66ef59f5c7c5 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 @@ -7,7 +7,7 @@ /** Samples for DataProtectionOperations List. */ public final class DataProtectionOperationsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/Operations/List.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 index a93dbdd9daef..b56b460913eb 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for DeletedBackupInstances Get. */ public final class DeletedBackupInstancesGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/DeletedBackupInstanceOperations/GetDeletedBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/DeletedBackupInstanceOperations/GetDeletedBackupInstance.json */ /** * Sample code: Get DeletedBackupInstance. 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 index ec1fb1030192..2e400571c448 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for DeletedBackupInstances List. */ public final class DeletedBackupInstancesListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/DeletedBackupInstanceOperations/ListDeletedBackupInstances.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/DeletedBackupInstanceOperations/ListDeletedBackupInstances.json */ /** * Sample code: List DeletedBackupInstances in a Vault. 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 index 491ac8399f56..af8dc1d0916a 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for DeletedBackupInstances Undelete. */ public final class DeletedBackupInstancesUndeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/DeletedBackupInstanceOperations/UndeleteDeletedBackupInstance.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/DeletedBackupInstanceOperations/UndeleteDeletedBackupInstance.json */ /** * Sample code: Undelete Deleted BackupInstance. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyCreateOrUpdateSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b8e0ddac1372 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyCreateOrUpdateSamples.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 CreateOrUpdate. */ +public final class DppResourceGuardProxyCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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/DppResourceGuardProxyDeleteSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyDeleteSamples.java new file mode 100644 index 000000000000..a4f6732d2de2 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyDeleteSamples.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; + +/** Samples for DppResourceGuardProxy Delete. */ +public final class DppResourceGuardProxyDeleteSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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", com.azure.core.util.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..f205a6e7edee --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyGetSamples.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; + +/** Samples for DppResourceGuardProxy Get. */ +public final class DppResourceGuardProxyGetSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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", com.azure.core.util.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..0239fce4e065 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyListSamples.java @@ -0,0 +1,20 @@ +// 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; + +/** Samples for DppResourceGuardProxy List. */ +public final class DppResourceGuardProxyListSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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", com.azure.core.util.Context.NONE); + } +} 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..f213fa566f3b --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/DppResourceGuardProxyUnlockDeleteSamples.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.generated; + +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/2023-04-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"), + com.azure.core.util.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 ef547827169d..f5d9d88805d0 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 @@ -7,7 +7,7 @@ /** Samples for ExportJobsOperationResult Get. */ public final class ExportJobsOperationResultGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/JobCRUD/GetExportJobsOperationResult.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 825f228e5655..2baa30b463ac 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 @@ -7,7 +7,7 @@ /** Samples for ExportJobs Trigger. */ public final class ExportJobsTriggerSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/JobCRUD/TriggerExportJobs.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 a81af15a80db..662a1a63b779 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 @@ -7,7 +7,7 @@ /** Samples for Jobs Get. */ public final class JobsGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/JobCRUD/GetJob.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 9c6ead6aa081..3319d0d67d1f 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 @@ -7,7 +7,7 @@ /** Samples for Jobs List. */ public final class JobsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/JobCRUD/ListJobs.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 be78fc8f2523..fd2d0f62f244 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 @@ -7,7 +7,7 @@ /** Samples for OperationResult Get. */ public final class OperationResultGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/GetOperationResult.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 index 7342b86b913f..39a6d51feec1 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for OperationStatusBackupVaultContext Get. */ public final class OperationStatusBackupVaultContextGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/GetOperationStatusVaultContext.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/GetOperationStatusVaultContext.json */ /** * Sample code: Get OperationStatus. 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 096333fd704f..c8721368e0fd 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 @@ -7,7 +7,7 @@ /** Samples for OperationStatus Get. */ public final class OperationStatusGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/GetOperationStatus.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 index 0c004679aae6..d69b3b5a5414 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for OperationStatusResourceGroupContext GetByResourceGroup. */ public final class OperationStatusResourceGroupContextGetByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/GetOperationStatusRGContext.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/GetOperationStatusRGContext.json */ /** * Sample code: Get OperationStatus. 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 a1821f2bdc38..796ecd1fe475 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 @@ -7,7 +7,7 @@ /** Samples for RecoveryPoints Get. */ public final class RecoveryPointsGetSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/GetRecoveryPoint.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/GetRecoveryPoint.json */ /** * Sample code: Get Recovery Point. 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 529f9e77de1e..5e873a15f5c6 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 @@ -7,7 +7,7 @@ /** Samples for RecoveryPoints List. */ public final class RecoveryPointsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/ListRecoveryPoints.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/ListRecoveryPoints.json */ /** * Sample code: List Recovery Points in a Vault. 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 c144cd46dfd9..e52ca6b1147b 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards Delete. */ public final class ResourceGuardsDeleteSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/DeleteResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/ResourceGuardCRUD/DeleteResourceGuard.json */ /** * Sample code: Delete ResourceGuard. 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 f6eb10769ae7..b7964c331c52 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards GetBackupSecurityPinRequestsObjects. */ public final class ResourceGuardsGetBackupSecurityPinRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/ListBackupSecurityPINRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 e6b590bf50c9..cb512ef7b84b 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards GetByResourceGroup. */ public final class ResourceGuardsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 14cec9279215..dd2d86d3637b 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards GetDefaultBackupSecurityPinRequestsObject. */ public final class ResourceGuardsGetDefaultBackupSecurityPinRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultBackupSecurityPINRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 79b976f8db32..f954570d8764 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards GetDefaultDeleteProtectedItemRequestsObject. */ public final class ResourceGuardsGetDefaultDeleteProtectedItemRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultDeleteProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 f276a98bb765..cfca9c2dc271 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards GetDefaultDeleteResourceGuardProxyRequestsObject. */ public final class ResourceGuardsGetDefaultDeleteResourceGuardProxyRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultDeleteResourceGuardProxyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 b3597582716d..cc06abce835b 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards GetDefaultDisableSoftDeleteRequestsObject. */ public final class ResourceGuardsGetDefaultDisableSoftDeleteRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultDisableSoftDeleteRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 a8c5f7c6448b..e4397ec73233 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards GetDefaultUpdateProtectedItemRequestsObject. */ public final class ResourceGuardsGetDefaultUpdateProtectedItemRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultUpdateProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 dad91f4f75ef..5a8dca44a558 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards GetDefaultUpdateProtectionPolicyRequestsObject. */ public final class ResourceGuardsGetDefaultUpdateProtectionPolicyRequestsObjectSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultUpdateProtectionPolicyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 ebc32c13aee0..cd7716987a3b 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards GetDeleteProtectedItemRequestsObjects. */ public final class ResourceGuardsGetDeleteProtectedItemRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/ListDeleteProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 388dd19e7b8f..bb0064d65275 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards GetDeleteResourceGuardProxyRequestsObjects. */ public final class ResourceGuardsGetDeleteResourceGuardProxyRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/ListDeleteResourceGuardProxyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 43f669f51d0e..7af76011107a 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards GetDisableSoftDeleteRequestsObjects. */ public final class ResourceGuardsGetDisableSoftDeleteRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/ListDisableSoftDeleteRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 1de219460306..381fd506c7f0 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards GetUpdateProtectedItemRequestsObjects. */ public final class ResourceGuardsGetUpdateProtectedItemRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/ListUpdateProtectedItemRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 e8cd2642990a..7af081171c1d 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards GetUpdateProtectionPolicyRequestsObjects. */ public final class ResourceGuardsGetUpdateProtectionPolicyRequestsObjectsSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/ListUpdateProtectionPolicyRequests.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 dad9e15d5cd2..579531283f71 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards ListByResourceGroup. */ public final class ResourceGuardsListByResourceGroupSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetResourceGuardsInResourceGroup.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 37b8174816ac..9d9cb4182aa3 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 @@ -7,7 +7,7 @@ /** Samples for ResourceGuards List. */ public final class ResourceGuardsListSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetResourceGuardsInSubscription.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 8b70436cb0de..2528e628bf6c 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 @@ -11,7 +11,7 @@ /** Samples for ResourceGuards Patch. */ public final class ResourceGuardsPatchSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/PatchResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 e0540f71ee1e..1d79ec2cddf8 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/2023-01-01/examples/ResourceGuardCRUD/PutResourceGuard.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-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 6a68c0686165..595569c6cae2 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 @@ -10,7 +10,7 @@ /** Samples for RestorableTimeRanges Find. */ public final class RestorableTimeRangesFindSamples { /* - * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/FindRestorableTimeRanges.json + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/BackupInstanceOperations/FindRestorableTimeRanges.json */ /** * Sample code: Find Restorable Time Ranges. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/SecondaryRPsFetchSamples.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/SecondaryRPsFetchSamples.java new file mode 100644 index 000000000000..33ebf6f3eb90 --- /dev/null +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/samples/java/com/azure/resourcemanager/dataprotection/generated/SecondaryRPsFetchSamples.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.generated; + +import com.azure.resourcemanager.dataprotection.models.FetchSecondaryRPsRequestParameters; + +/** Samples for SecondaryRPs Fetch. */ +public final class SecondaryRPsFetchSamples { + /* + * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2023-04-01-preview/examples/CrossRegionRestore/FetchSecondaryRPs.json + */ + /** + * Sample code: Fetch SecondaryRPs. + * + * @param manager Entry point to DataProtectionManager. + */ + public static void fetchSecondaryRPs(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) { + manager + .secondaryRPs() + .fetch( + "000pikumar", + "WestUS", + new FetchSecondaryRPsRequestParameters() + .withSourceRegion("EastUS") + .withSourceBackupInstanceId( + "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/HelloTest/providers/Microsoft.DataProtection/backupVaults/HelloTestVault/backupInstances/653213d-c5b3-44f6-a0d9-db3c4f9d8e34"), + null, + null, + com.azure.core.util.Context.NONE); + } +}