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